{% set name = "sniffio" %}
{% set version = "1.3.1" %}

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

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

build:
  number: 0
  skip: true  # [py<37]
  script: {{ PYTHON }} -m pip install . --no-deps --no-build-isolation --ignore-installed --no-cache-dir -vv

requirements:
  host:
    - pip
    - python
    - setuptools >=64
    - setuptools-scm >=6.4
  run:
    - python

{% set deselect_tests = "" %}
# E       OSError: [WinError 10022] An invalid argument was supplied
{% set deselect_tests = deselect_tests + " --deselect=test_sniffio.py::test_curio" %}  # [win and py<312]

test:
  imports:
    - sniffio
    - sniffio._tests
  requires:
    - pip
    - pytest
    - curio
  commands:
    - pip check
    - python -c "from importlib.metadata import version; assert(version('{{ name }}')=='{{ version }}')"
    - pytest --pyargs sniffio._tests {{ deselect_tests }}

about:
  home: https://github.com/python-trio/sniffio
  license: MIT OR Apache-2.0
  license_file:
    - LICENSE.APACHE2
    - LICENSE.MIT
    - LICENSE
  license_family: Other
  summary: Sniff out which async library your code is running under
  doc_url: https://sniffio.readthedocs.io
  dev_url: https://github.com/python-trio/sniffio

extra:
  recipe-maintainers:
    - nicoddemus
