{% set version = "3.4.7" %}

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

source:
  url: https://pypi.io/packages/source/c/cryptography/cryptography-{{ version }}.tar.gz
  sha256: 3d10de8116d25649631977cb37da6cbdd2d6fa0e0281d014a5b7d337255ca713

build:
  number: 0
  skip: true  # [py<36]
  script:
    - export PYO3_CROSS_INCLUDE_DIR=$PREFIX/include    # [build_platform != target_platform]
    - export PYO3_CROSS_LIB_DIR=$SP_DIR/../            # [build_platform != target_platform]
    - export PYO3_CROSS_PYTHON_VERSION=$python         # [build_platform != target_platform]
    - ls $PYO3_CROSS_LIB_DIR         # [build_platform != target_platform]
    - find $PYO3_CROSS_LIB_DIR -name "_sysconfigdata*.py" -not -name "${_CONDA_PYTHON_SYSCONFIGDATA_NAME_BACKUP}.py" -type f -exec rm -f {} +  # [build_platform != target_platform]
    - ls $PYO3_CROSS_LIB_DIR         # [build_platform != target_platform]
    - {{ PYTHON }} -m pip install . -vv

requirements:
  build:
    - python                                 # [build_platform != target_platform]
    - cross-python_{{ target_platform }}     # [build_platform != target_platform]
    - cffi >=1.12                            # [python_impl != "pypy" and build_platform != target_platform]
    - {{ compiler('rust') }}
  host:
    - python
    - setuptools >=40.6.0
    - pip
    - setuptools-rust >=0.11.4
    - openssl
    - cffi  >=1.12   # [python_impl != "pypy"]
  run:
    - python
    - openssl
    - cffi >=1.12   # [python_impl != "pypy"]

test:
  imports:
    - cryptography
    - cryptography.fernet
    - cryptography.hazmat
    - cryptography.hazmat.backends
    - cryptography.hazmat.backends.openssl
    - cryptography.hazmat.bindings
    - cryptography.hazmat.bindings.openssl
    - cryptography.hazmat.primitives
    - cryptography.hazmat.primitives.asymmetric
    - cryptography.hazmat.primitives.ciphers
    - cryptography.hazmat.primitives.kdf
    - cryptography.hazmat.primitives.twofactor
    - cryptography.x509
  requires:
    - cryptography-vectors {{ version }}
    - hypothesis
    - iso8601
    - pretend
    - pytest
    - pytest-subtests
    - pytz
  source_files:
    - tests
  commands:
    # run_test.py will check that the correct openssl version is linked
    - pytest

about:
  home: https://github.com/pyca/cryptography
  license: Apache-2.0 AND BSD-3-Clause AND PSF-2.0 AND MIT
  license_family: BSD
  license_file: LICENSE
  summary: Provides cryptographic recipes and primitives to Python developers
  description: |
    Cryptography is a package which provides cryptographic recipes and
    primitives to Python developers. Our goal is for it to be your
    "cryptographic standard library". It supports Python 2.6-2.7, Python 3.3+,
    and PyPy 2.6+. Cryptography includes both high level recipes, and low level
    interfaces to common cryptographic algorithms such as symmetric ciphers,
    message digests and key derivation functions.
  doc_url: http://cryptography.readthedocs.io/
  doc_source_url: https://github.com/pyca/cryptography/blob/master/docs/index.rst
  dev_url: https://github.com/pyca/cryptography

extra:
  recipe-maintainers:
    - jakirkham
    - ocefpaf
