{% set version = "5.4.1" %}

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

source:
  url: https://pypi.io/packages/source/P/PyYAML/PyYAML-{{ version }}.tar.gz
  sha256: 607774cbba28732bfa802b54baa7484215f530991055bb562efbed5b2f20a45e
  patches:
    - 0001-Ensure-we-do-not-end-up-wih-CRLF-line-endings-on-tes.patch

build:
  number: 0
  script:
    - python setup.py --with-libyaml build_ext --include-dirs="${PREFIX}/include" --library-dirs="${PREFIX}/lib"  # [unix]
    - python setup.py --with-libyaml build_ext --include-dirs="%LIBRARY_INC%" --library-dirs="%LIBRARY_LIB%"      # [win]
    - python setup.py install
    - python setup.py test

requirements:
  build:
    - python                                 # [build_platform != target_platform]
    - cross-python_{{ target_platform }}     # [build_platform != target_platform]
    - cython                                 # [build_platform != target_platform]
    - {{ compiler('c') }}
  host:
    - python
    - cython
    - setuptools
    - yaml
  run:
    - python
    - yaml

test:
  imports:
    - yaml
    - _yaml   # [python_impl == "cpython"]
  commands:
    - pip check
  requires:
    - pip

about:
  home: http://pyyaml.org/wiki/PyYAML
  license_file: LICENSE
  license: MIT
  license_family: MIT
  summary: YAML parser and emitter for Python
  dev_url: https://github.com/yaml/pyyaml
  doc_url: http://pyyaml.org/wiki/PyYAML

extra:
  recipe-maintainers:
    - jakirkham
    - msarahan
    - pelson
    - ocefpaf
