{% set name = "anaconda-anon-usage" %}
{% set version = "0.4.2" %}
{% set sha256 = "c4e86f45c9ab89b7c0a655e9797da36d2c7d16f74e2dcef8cf55701267e9779e" %}

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

source:
  url: https://github.com/anaconda/{{ name }}/archive/refs/tags/{{ version }}.tar.gz
  sha256: {{ sha256 }}

build:
  number: 0
  skip: True # [py<=36]
  script_env:
   - NEED_SCRIPTS=no   # [variant=="plugin"]
   - NEED_SCRIPTS=yes  # [variant=="patch"]

requirements:
  host:
    - python
    - setuptools
    - wheel
    - pip
  run:
    - python
  run_constrained:
    - conda >=23.7  # [variant=="plugin"]
    - conda >=4.11,<23.7   # [variant=="patch"]

test:
  requires:
    - conda
    - pytest
    - pytest-cov
  source_files:
    - tests
  imports:
    - anaconda_anon_usage
  commands:
    - export ANACONDA_ANON_USAGE_DEBUG=1  # [unix]
    - export PYTHONUNBUFFERED=1  # [unix]
    - set ANACONDA_ANON_USAGE_DEBUG=1  # [win]
    - set PYTHONUNBUFFERED=1 # [win]
    - conda create -n testchild1 --yes
    - conda create -n testchild2 --yes
    - conda info
    - conda info --envs
    - python -m anaconda_anon_usage.install --status  # [variant=="patch"]
    - pytest -v tests/unit
    - python tests/integration/test_config.py

about:
  home: https://github.com/anaconda/anaconda-anon-usage
  summary: basic anonymous telemetry for conda clients
  license: BSD-3-Clause
  license_family: BSD
  license_file: LICENSE
  dev_url: https://github.com/anaconda/anaconda-anon-usage/
  doc_url: https://github.com/anaconda/anaconda-anon-usage/
  description: |
        This package augments the request header data that conda delivers
        to package servers during index and package requests. Specifically,
        three randomly generated tokens are appended to the "user agent"
        that Conda already sends with each request.
