3 M(Y@s|ddlZddlZddlZddlZddlZddlmZddlm Z ddZ e Z e ej j ZGdddeZ Gd d d e ZdS) N)map) get_unpatchedc Cs2d}yt|dgdjdStk r,YnXdS)z0 Return True if Cython can be imported. zCython.Distutils.build_ext build_ext)fromlistTF) __import__r Exception)Z cython_implr B/private/tmp/pip-build-nl73fm5q/setuptools/setuptools/extension.py _have_cython sr c@s eZdZdZddZddZdS) Extensionz7Extension that uses '.c' files in place of '.pyx' filescOs(|jdd|_tj|||f||dS)Npy_limited_apiF)popr _Extension__init__)selfnamesourcesargskwr r r r#szExtension.__init__cCsNtr dS|jpd}|jdkr$dnd}tjtjd|}tt||j |_ dS)z Replace sources with .pyx extensions to sources with the target language extension. This mechanism allows language authors to supply pre-converted sources but to prefer the .pyx sources. Nzc++z.cppz.cz.pyx$) r languagelower functoolspartialresublistrr)rlangZ target_extrr r r _convert_pyx_sources_to_lang)s  z&Extension._convert_pyx_sources_to_langN)__name__ __module__ __qualname____doc__rrr r r r r sr c@seZdZdZdS)Libraryz=Just like a regular Extension, but built as a library insteadN)r r!r"r#r r r r r$8sr$)rrdistutils.core distutilsZdistutils.errorsdistutils.extensionZsetuptools.extern.six.movesrZmonkeyrr Z have_pyrexcorer rr$r r r r s