{% set name = "anyio" %}
{% set version = "3.5.0" %}

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

source:
  - folder: dist
    url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz
    sha256: a0aeffe2fb1fdf374a8e4b471444f0f3ac4fb9f5a5b542b48824475e0042a5a6
  - folder: src
    url: https://github.com/agronholm/{{ name }}/archive/{{ version }}.tar.gz
    sha256: 55a37ea9eb2092d435af148b42a10005ee62ec7eb7d7a12d73c88e2b8aca5e38

build:
  number: 0
  # trigger: 0
  script: cd dist && {{ PYTHON }} -m pip install . -vv --no-deps
  skip: true  # [py<36]

requirements:
  build:
    - m2-patch                               # [win]
    - patch                                  # [not win]
  host:
    - pip
    - python
    - setuptools-scm >=3.4
    - setuptools >=42
    - toml
    - wheel >=0.29.0
  run:
    - contextvars  # [py<37]
    - dataclasses  # [py<37]
    - idna >=2.8
    - python >=3.6.2
    - sniffio >=1.1
    - typing_extensions  # [py<38]
  run_constrained:
    - trio >=0.16

test:
  source_files:
    - src/tests
  requires:
    - contextlib2  # [py<37]
    - coverage >=4.5
    - trio
    - hypothesis >=4.0
    - mock >=4
    - pip
    - pytest >=6.0
    - pytest-cov
    - pytest-mock >=3.6.1
    - toml
    - trustme
    # won't be available on pypy, or windows, any time soon
    - uvloop  # [unix and python_impl == 'cpython']
    - ruamel_yaml  # [win]
  imports:
    - anyio
  commands:
    - pip check || 1     # [win]
    - pip check || true  # [unix]
  # To check if downstream packages run without errors
  downstreams:
    # Testing jupyter_server sometimes fails in win platforms
    - jupyter_server  # [unix]

about:
  home: https://github.com/agronholm/anyio
  license: MIT
  license_family: MIT
  license_file: dist/LICENSE
  summary: High level compatibility layer for multiple asynchronous event loop implementations on Python
  dev_url: https://github.com/agronholm/anyio
  doc_url: https://anyio.readthedocs.io
  doc_source_url: https://github.com/agronholm/anyio/tree/{{ version }}/docs

extra:
  recipe-maintainers:
    - CJ-Wright
    - bollwyvl
