{% set name = "unearth" %}
{% set version = "0.18.2" %}

package:
  name: {{ name }}
  version: {{ version }}

source:
  url: https://pypi.org/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz
  sha256: 1e53d7f52f46dd5f875e77ff1c55b12477e215a092e4b66c9764a77df4a9b520

build:
  number: 0
  script: {{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation --ignore-installed
  entry_points:
    - unearth = unearth.__main__:cli
  skip: true  # [py<39]

requirements:
  host:
    - pip
    - python
    - pdm-backend
  run:
    - python
    - packaging >=20
    - httpx >=0.27.0,<1
  run_constrained:
    # legacy
    - requests >=2.25

# >   assert evaluate_package(package, requirement, allow_prereleases) is expected
# E   AssertionError: assert True is False
# E    +  where True = evaluate_package(Package(name='click', version='8.0.0a0'), <Requirement('click')>, None)
{% set deselect_tests = " --deselect=tests/test_evaluator.py::test_evaluate_packages_matching_version" %}
test:
  source_files:
    - tests
  imports:
    - unearth
  commands:
    - pip check
    - pytest -v tests {{ deselect_tests }}
  requires:
    - pip
    - pytest >=6.1
    - pytest-httpserver >=1.0.4
    - flask >=2.1.2
    - requests-wsgi-adapter >=0.4.1
    - trustme >=0.9.0  # [py<313]
    - keyring
    - pytest-mock >=3.12.0

about:
  home: https://pypi.org/project/unearth
  summary: A utility to fetch and download python packages
  description: A utility to fetch and download python packages
  license: MIT
  license_family: MIT
  license_file: LICENSE
  dev_url: https://github.com/frostming/unearth
  doc_url: https://unearth.readthedocs.io

extra:
  recipe-maintainers:
    - theAeon
