{% set version = "20.3.0" %}

package:
  name: twisted
  version: {{ version }}

source:
  url: https://pypi.io/packages/source/T/Twisted/Twisted-{{ version }}.tar.bz2
  sha256: d72c55b5d56e176563b91d11952d13b01af8725c623e498db5507b6614fc1e10

build:
  number: 0
  entry_points:
    - ckeygen = twisted.conch.scripts.ckeygen:run
    - cftp = twisted.conch.scripts.cftp:run
    - conch = twisted.conch.scripts.conch:run
    - mailmail = twisted.mail.scripts.mailmail:run
    - pyhtmlizer = twisted.scripts.htmlizer:run
    - tkconch = twisted.conch.scripts.tkconch:run
    - trial = twisted.scripts.trial:run
    - twist = twisted.application.twist._twist:Twist.main
    - twistd = twisted.scripts.twistd:run
  script:
    - del src\twisted\internet\iocpreactor\iocpsupport\iocpsupport.c  # [win]
    - pushd src\twisted\internet\iocpreactor\iocpsupport  # [win]
    - cythonize -a -i iocpsupport.pyx  # [win]
    - popd  # [win]
    - {{ PYTHON }} -m pip install . --no-deps -vv

requirements:
  build:
    - {{ compiler('c') }}
  host:
    - python
    - pip
    - cython
    - incremental >=16.10.1
  run:
    - python
    - pip
    - attrs >=17.4.0
    - automat >=0.3.0
    - constantly >=15.1
    - hyperlink >=17.1.1
    - incremental >=16.10.1
    - pyhamcrest >=1.9.0
    - zope.interface >=4.4.2
    - pywin32  # [win]
    # conch deps
    - bcrypt
    - cryptography >=1.5
    - pyasn1
    # tls deps
    - idna >=0.6,!=2.3
    - pyopenssl >=16.0.0
    - service_identity >=18.1.0
  run_constrained:
    # Moved all the crypto and tls stuff under 'run'
    - soappy  # [py2k and win]
    - pyserial >=3.0
    - pyobjc-core  # [osx]
    - pyobjc-framework-cocoa  # [osx]
    # - pyobjc-framework-CFNetwork  # [osx]
    - h2 >=3.0,<4.0
    - priority >=1.1.0,<2.0

test:
  imports:
    - twisted
    - twisted._threads
    - twisted.application
    - twisted.application.runner
    - twisted.application.twist
    - twisted.conch
    - twisted.conch.client
    - twisted.conch.insults
    - twisted.conch.openssh_compat
    - twisted.conch.scripts
    - twisted.conch.ssh
    - twisted.conch.ui
    - twisted.cred
    - twisted.enterprise
    - twisted.internet
    - twisted.internet.iocpreactor  # [win]
    - twisted.logger
    - twisted.mail
    - twisted.mail.scripts
    - twisted.names
    - twisted.news  # [py2k]
    - twisted.pair
    - twisted.persisted
    - twisted.plugins
    - twisted.positioning
    - twisted.protocols
    - twisted.protocols.haproxy
    - twisted.python
    - twisted.runner
    - twisted.scripts
    - twisted.spread
    - twisted.tap
    - twisted.trial
    - twisted.trial._dist
    - twisted.web
    - twisted.web._auth
    - twisted.words
    - twisted.words.im
    - twisted.words.protocols
    - twisted.words.protocols.jabber
    - twisted.words.xish
  commands:
    - ckeygen --help
    # https://twistedmatrix.com/trac/ticket/1679
    - cftp --help  # [not win]
    - conch --help  # [not win]
    # not sure how to test this one
    # - mailmail --help
    - pyhtmlizer --help
    # Requires $DISPLAY (xvfb-run?)
    - tkconch --help  # [win]
    - trial --help
    - twist --help
    - twistd --help

about:
  home: http://twistedmatrix.com/
  license: MIT
  license_file: LICENSE
  license_family: MIT
  summary: An asynchronous networking framework written in Python
  description: |
    Twisted is an event-driven networking engine written in Python.
    It runs on Python 2 and an ever growing subset also works with Python 3.
  doc_url: http://twistedmatrix.com/documents/current/
  doc_source_url: https://github.com/twisted/twisted/blob/trunk/docs/index.rst
  dev_url: https://github.com/twisted/twisted

extra:
  recipe-maintainers:
    - nehaljwani
    - ocefpaf
