U
    u0[2                  #   @   sV  d Z ddlZddlZddlZddlmZ ddlmZ ddlm	Z	m
Z
 ddlmZ ejdk r`dZnd	Zed
ddddddddddddddgd
ZdddddgZesedd g7 Zeed!d"d#gd$d%d&gd'gd(gd)d*d+gd,gd-d.gd/Zed0 ed1  ed2  ed3  ed4  Zed5 ed0 ed1 ed2 ed3 ed4 eed6 e ed7 e d8	Zed9 ed:< d;d<d=d>d?d@dAdBdCg	ZG dDdE dEe	eZedFdGgdHdI dJedKdLdMgdNgdOdI dPedQdRgdSdI dJgZdTdU ZefdVdWZG dXdY dYeeZG dZd[ d[ejeZeefd\d]Ze Zd^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~ddg#ZdS )a:  
Setuptools convenience functionality.

This file must not import anything from Twisted, as it is loaded by C{exec} in
C{setup.py}. If you need compatibility functions for this code, duplicate them
here.

@var _EXTRA_OPTIONS: These are the actual package names and versions that will
    be used by C{extras_require}.  This is not passed to setup directly so that
    combinations of the packages can be created without the need to copy
    package names multiple times.

@var _EXTRAS_REQUIRE: C{extras_require} is a dictionary of items that can be
    passed to setup.py to install optional dependencies.  For example, to
    install the optional dev dependencies one would type::

        pip install -e ".[dev]"

    This has been supported by setuptools since 0.5a4.

@var _PLATFORM_INDEPENDENT: A list of all optional cross-platform dependencies,
    as setuptools version specifiers, used to populate L{_EXTRAS_REQUIRE}.

@var _EXTENSIONS: The list of L{ConditionalExtension} used by the setup
    process.

@var notPortedModules: Modules that are not yet ported to Python 3.
    N)	build_ext)CompileError)	Extensionfind_packages)build_py   r   FTZTwistedz6An asynchronous networking framework written in PythonzTwisted Matrix Laboratoriesz twisted-python@twistedmatrix.comzGlyph Lefkowitzzglyph@twistedmatrix.comzhttp://twistedmatrix.com/ZMITzAn extensible framework for Python programming, with special focus
on event-based network programming and multiprotocol integration.
z%Programming Language :: Python :: 2.7z#Programming Language :: Python :: 3z%Programming Language :: Python :: 3.4z%Programming Language :: Python :: 3.5z%Programming Language :: Python :: 3.6z%Programming Language :: Python :: 3.7)
nameZdescriptionZauthorZauthor_emailZ
maintainerZmaintainer_emailZurllicenseZlong_descriptionZclassifierszpyflakes >= 1.0.0ztwisted-dev-tools >= 0.0.2zpython-subunitzsphinx >= 1.3.1ztowncrier >= 17.4.0ztwistedchecker >= 0.4.0zpydoctor >= 16.2.0zpyopenssl >= 16.0.0Zservice_identityzidna >= 0.6, != 2.3Zpyasn1zcryptography >= 1.5zappdirs >= 1.4.0Zsoappyzpyserial >= 3.0zpyobjc-corezpyobjc-framework-CFNetworkzpyobjc-framework-CocoaZpywin32zh2 >= 3.0, < 4.0zpriority >= 1.1.0, < 2.0)devtlsconchsoapserialmacoswindowshttp2r   r   r   r   r   r   r   r   )	r   r   r   r   r   r   Zall_non_platformmacos_platformZwindows_platformr   Zosx_platformz+ckeygen = twisted.conch.scripts.ckeygen:runz%cftp = twisted.conch.scripts.cftp:runz'conch = twisted.conch.scripts.conch:runz,mailmail = twisted.mail.scripts.mailmail:runz)pyhtmlizer = twisted.scripts.htmlizer:runz+tkconch = twisted.conch.scripts.tkconch:runz!trial = twisted.scripts.trial:runz3twist = twisted.application.twist._twist:Twist.mainz#twistd = twisted.scripts.twistd:runc                   @   s   e Zd ZdZdd ZdS )ConditionalExtensionaj  
    An extension module that will only be compiled if certain conditions are
    met.

    @param condition: A callable of one argument which returns True or False to
        indicate whether the extension should be built. The argument is an
        instance of L{build_ext_twisted}, which has useful methods for checking
        things about the platform.
    c                 O   s(   | ddd | _tj| f|| d S )N	conditionc                 S   s   dS )NT )Zbuilderr   r   7/usr/lib/python3/dist-packages/twisted/python/_setup.py<lambda>       z/ConditionalExtension.__init__.<locals>.<lambda>)popr   r   __init__)selfargskwargsr   r   r   r      s    zConditionalExtension.__init__N)__name__
__module____qualname____doc__r   r   r   r   r   r      s   	r   ztwisted.test.raiserzsrc/twisted/test/raiser.cc                 C   s   t S )N)
_isCPython_r   r   r   r      r   r   )sourcesr   z(twisted.internet.iocpreactor.iocpsupportz:src/twisted/internet/iocpreactor/iocpsupport/iocpsupport.cz?src/twisted/internet/iocpreactor/iocpsupport/winsock_pointers.cZws2_32c                 C   s   t otjdkS NZwin32)r#   sysplatformr$   r   r   r   r      r   )r&   Z	librariesr   ztwisted.python._sendmsgzsrc/twisted/python/_sendmsg.cc                 C   s   t  otjdkS r'   )_PY3r(   r)   r$   r   r   r   r      r   c                  C   s:   t tdd} | dk rtdn| dkr6| dk r6tddS )	zA
    Fail if we detect a version of Python we don't support.
    version_info)r   )      z%Twisted requires Python 2.7 or later.r   )r      z1Twisted on Python 3 requires Python 3.4 or later.N)getattrr(   ImportError)versionr   r   r   _checkPythonVersion   s
    
r2   c                    s   t   t } |d< G  fdddt}d|i}tjd dkrHt|d< dd	d
ddddg}|tt	ddd
g|dt
i|dddddddgidtddid |S )z^

    @return: The keyword arguments to be used the the setup method.
    @rtype: L{dict}
    Zext_modulesc                       s   e Zd Z ZdS )z"getSetupArgs.<locals>.my_build_extN)r   r    r!   conditionalExtensionsr   
extensionsr   r   my_build_ext   s   r6   r   r   r   r   zzope.interface >= 4.4.2zconstantly >= 15.1zincremental >= 16.10.1zAutomat >= 0.3.0zhyperlink >= 17.1.1zPyHamcrest >= 1.9.0zattrs >= 17.4.0srcTZconsole_scripts z*.cz*.hz*.pxiz*.pyxz	build.batF)ZpackagesZuse_incrementalZsetup_requiresZinstall_requiresZentry_pointsZcmdclassZinclude_package_dataZexclude_package_dataZzip_safeZextras_requirepackage_dir)r2   STATIC_PACKAGE_METADATAcopybuild_ext_twistedr(   r+   BuildPy3updatedictr   _CONSOLE_SCRIPTS_EXTRAS_REQUIRE)r5   Z	argumentsr6   Zcommand_classesZrequirementsr   r4   r   getSetupArgs   sF    
 
  rB   c                   @   s   e Zd ZdZdd ZdS )r=   zh
    A version of build_py that doesn't install the modules that aren't yet
    ported to Python 3.
    c                 C   s   dd t | ||D }|S )Nc                 S   s*   g | ]"}d  |d |d gtkr|qS ).r      )joinnotPortedModules).0moduler   r   r   
<listcomp>  s   z1BuildPy3.find_package_modules.<locals>.<listcomp>)r   find_package_modules)r   packager9   modulesr   r   r   rJ     s    zBuildPy3.find_package_modulesN)r   r    r!   r"   rJ   r   r   r   r   r=     s   r=   c                   @   s8   e Zd ZdZdd Zdd Zdd Zdd	 Zd
d ZdS )r<   zb
    Allow subclasses to easily detect and customize Extensions to
    build at install-time.
    c                    sr   t jdkrdg _ng  _tjdr> jd  jd  fdd jD  _ jD ]}|j	 j qZdS )	a  
        Prepare the C{self.extensions} attribute (used by
        L{build_ext.build_ext}) by checking which extensions in
        I{conditionalExtensions} should be built.  In addition, if we are
        building on NT, define the WIN32 macro to 1.
        nt)ZWIN32rD   Zsunos)Z_XOPEN_SOURCErD   )Z_XOPEN_SOURCE_EXTENDEDrD   c                    s   g | ]}|  r|qS r   )r   )rG   xr   r   r   rI   :  s    
 z8build_ext_twisted.prepare_extensions.<locals>.<listcomp>N)
osr	   Zdefine_macrosr(   r)   
startswithappendr3   r5   extend)r   Zextr   rO   r   prepare_extensions#  s    



z$build_ext_twisted.prepare_extensionsc                 C   s   |    tj|  dS )zT
        Check to see which extension modules to build and then build them.
        N)rT   r   build_extensionsrO   r   r   r   rU   B  s    z"build_ext_twisted.build_extensionsc              	   C   s2   dD ](}zt | W q tk
r*   Y qX qd S )N)
conftest.cz
conftest.ozconftest.obj)rP   unlinkEnvironmentError)r   filenamer   r   r   _remove_conftestJ  s
    z"build_ext_twisted._remove_conftestc              	   C   sn   t dd}zT| || W 5 Q R X z| jjdgdd W n tk
rV   Y W dS X W dS |   X d S )NrV   wr8   )Z
output_dirFT)openrZ   writecompilercompiler   )r   ZcontentZconftestr   r   r   _compile_helperR  s    
z!build_ext_twisted._compile_helperc                 C   s$   | j d|d | d|S )z
        Check if the given header can be included by trying to compile a file
        that contains only an #include line.
        zchecking for {} ...r   z#include <{}>
)r^   Zannounceformatr`   )r   Zheader_namer   r   r   _check_headera  s    zbuild_ext_twisted._check_headerN)	r   r    r!   r"   rT   rU   rZ   r`   rb   r   r   r   r   r<     s   r<   c                 C   s   |  dkS )aj  
    Checks if this implementation is CPython.

    This uses C{platform.python_implementation}.

    This takes C{sys} and C{platform} kwargs that by default use the real
    modules. You shouldn't care about these -- they are for testing purposes
    only.

    @return: C{False} if the implementation is definitely not CPython, C{True}
        otherwise.
    ZCPython)Zpython_implementation)r(   r)   r   r   r   _checkCPythonk  s    rc   ztwisted.mail.aliasztwisted.mail.bounceztwisted.mail.mailztwisted.mail.maildirztwisted.mail.pbztwisted.mail.relaymanagerztwisted.mail.scripts.__init__ztwisted.mail.tapztwisted.mail.test.test_bounceztwisted.mail.test.test_mailztwisted.mail.test.test_optionsztwisted.mail.test.test_scriptsztwisted.news.__init__ztwisted.news.databaseztwisted.news.newsztwisted.news.nntpztwisted.news.tapztwisted.news.test.__init__ztwisted.news.test.test_databaseztwisted.news.test.test_newsztwisted.news.test.test_nntpztwisted.plugins.twisted_mailztwisted.plugins.twisted_newsztwisted.protocols.mice.__init__ztwisted.protocols.mice.mousemanztwisted.protocols.shoutcastztwisted.python._pydoctorztwisted.python.finalizeztwisted.python.hookz#twisted.python.test.cmodulepullpipez!twisted.python.test.test_pydoctorztwisted.python.test.test_win32ztwisted.test.test_hookztwisted.web.soapztwisted.web.test.test_soap) r"   rP   r)   r(   Zdistutils.commandr   Zdistutils.errorsr   Z
setuptoolsr   r   Zsetuptools.command.build_pyr   r+   r*   r?   r:   Z_devZ_EXTRA_OPTIONSZ_PLATFORM_INDEPENDENTrA   r@   objectr   Z_EXTENSIONSr2   rB   r=   r<   rc   r#   rF   r   r   r   r   <module>   s2  
	

	=N