{% set version = "3.2.1" %}
{% set cross = False %}
{% if build_platform != target_platform and not build_platform.startswith('win') %}
{% set cross = True %}
{% endif %}

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

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

build:
  number: 1
  script: {{ PYTHON }} -m pip install . -vv

requirements:
  build:
{% if cross %}
    - python
    - cross-python_{{ target_platform }}
    - cffi                                   # [python_impl != "pypy"]
{% endif %}
    - {{ compiler('c') }}
  host:
    - python
    - pip
    - openssl
    - cffi !=1.11.3,>=1.8   # [python_impl != "pypy"]
  run:
    - python
    - openssl
    - cffi !=1.11.3,>=1.8   # [python_impl != "pypy"]
    - enum34                # [py2k]
    - ipaddress             # [py2k]
    - six >=1.4.1

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
    - 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
  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
    - jjhelmus
    - ocefpaf
