{% set name = "Twisted" %}
{% set version = "18.7.0" %}
{% set file_ext = "tar.bz2" %}
{% set hash_type = "sha256" %}
{% set hash_value = "95ae985716e8107816d8d0df249d558dbaabb677987cc2ace45272c166b267e4" %}

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

source:
  fn: {{ name }}-{{ version }}.{{ file_ext }}
  url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.{{ file_ext }}
  {{ hash_type }}: {{ hash_value }}
  patches:
    # https://github.com/twisted/twisted/pull/966
    - 966.patch

build:
  number: 1
  entry_points:
    - ckeygen = twisted.conch.scripts.ckeygen:run
    - cftp = twisted.conch.scripts.cftp:run
    - conch = twisted.conch.scripts.conch: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
    - mailmail = twisted.mail.scripts.mailmail:run  # [py2k]
  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 setup.py install --single-version-externally-managed --record=record.txt

requirements:
  host:
    - python
    - setuptools
    - incremental >=16.10.1
    - cython
  build:
    - {{ compiler('c') }}
  run:
    - python
    - appdirs >=1.4.0
    - automat >=0.3.0
    - constantly >=15.1
    - cryptography >=1.5
    - hyperlink >=17.1.1
    - idna >=0.6,!=2.3
    - incremental >=16.10.1
    - pyasn1
    - pyopenssl >=16.0.0
    - pywin32  # [win]
    - service_identity
    - zope.interface >=4.0.2
  # Conda 4.4, where are you?
  run_constrained:
    # Moved all the crypto and tls stuff under 'run'
    - soappy  # [py2k and win]
    - pyserial >=3.0
    - pyobjc-core  # [osx]
    - pyobjc-framework-CFNetwork  # [osx]
    - pyobjc-framework-Cocoa      # [osx]
    - h2 >=3.0,<4.0
    - priority >=1.1.0,<2.0

test:
  imports:
    - twisted
    - twisted._threads
    - twisted._threads.test
    - twisted.application
    - twisted.application.runner
    - twisted.application.runner.test
    - twisted.application.test
    - twisted.application.twist
    - twisted.application.twist.test
    - twisted.conch
    - twisted.conch.client
    - twisted.conch.insults
    - twisted.conch.openssh_compat
    - twisted.conch.scripts
    - twisted.conch.ssh
    - twisted.conch.test
    - twisted.conch.ui
    - twisted.cred
    - twisted.cred.test
    - twisted.enterprise
    - twisted.internet
    - twisted.internet.iocpreactor  # [win]
    - twisted.internet.iocpreactor.iocpsupport  # [win]
    - twisted.internet.test
    - twisted.logger
    - twisted.logger.test
    - twisted.mail
    - twisted.mail.scripts  # [py2k]
    - twisted.mail.test
    - twisted.names
    - twisted.names.test
    - twisted.news          # [py2k]
    - twisted.news.test     # [py2k]
    - twisted.pair
    - twisted.pair.test
    - twisted.persisted
    - twisted.persisted.test
    - twisted.plugins
    - twisted.positioning
    - twisted.positioning.test
    - twisted.protocols
    - twisted.protocols.haproxy
    - twisted.protocols.haproxy.test
    - twisted.protocols.mice  # [py2k]
    - twisted.protocols.test
    - twisted.python
    - twisted.python.test
    - twisted.python.sendmsg  # [unix and py2k]
    - twisted.runner
    - twisted.runner.test
    - twisted.scripts
    - twisted.scripts.test
    - twisted.spread
    - twisted.spread.test
    - twisted.tap
    - twisted.test
    - twisted.test.raiser
    - twisted.trial
    - twisted.trial._dist
    - twisted.trial._dist.test
    - twisted.trial.test
    - twisted.web
    - twisted.web._auth
    - twisted.web.test
    - twisted.words
    - twisted.words.im
    - twisted.words.protocols
    - twisted.words.protocols.jabber
    - twisted.words.test
    - twisted.words.xish
  commands:
    - ckeygen --help
    # https://twistedmatrix.com/trac/ticket/1679
    - cftp --help  # [unix]
    - conch --help  # [unix]
    - 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: event-driven networking engine
  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
