{% set name = "anaconda-auth" %}
{% set version = "0.15.1" %}

package:
  name: {{ name|lower }}
  version: {{ version }}

source:
  git_url: https://github.com/anaconda/{{ name }}.git
  git_rev: v{{ version }}

build:
  entry_points:
    - conda-token = anaconda_auth._conda.conda_token:cli
  skip: true  # [py<310]
  script:
    - {{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation
    # Do not use python -m ... here to avoid unnecessary imports
    - {{ PYTHON }} ./src/anaconda_auth/_conda/config.py --install
  number: 0

requirements:
  build:
    - git
  host:
    - python
    - hatchling
    - hatch-vcs >=0.3
    - setuptools-scm >=7.1
    - pip
  run:
    - python
    - keyring
    - pkce
    - python-dotenv
    - pydantic
    - pyjwt
    - requests
    - cryptography >=3.4.0
    - semver <4
    - anaconda-cli-base >=0.8.1
    - httpx
  run_constrained:
    - conda >=23.9.0
    - conda-token >=0.7.0
    - anaconda-cloud-auth >=0.8

test:
  imports:
    - anaconda_auth
  commands:
    - conda-token --help
    - anaconda auth --help
    - python -c "from anaconda_auth import __version__; assert __version__ == \"{{ version }}\""
    - python -m anaconda_auth._conda.config --verify
    - pip check
  requires:
    - python
    - conda
    - pip

about:
  summary: A client auth library for Anaconda APIs
  description: A client library for Anaconda APIs to authenticate and securely store API keys
  doc_url: https://anaconda.github.io/anaconda-auth
  dev_url: https://github.com/anaconda/anaconda-auth
  home: https://www.anaconda.com
  license: BSD-3-Clause
  license_file: LICENSE
  license_family: BSD

extra:
  recipe-maintainers:
    - AlbertDeFusco
    - mattkram
