o
    f}”e”  ã                   @   sp   d dl Z d dlZd dlZd dlZd dlZddlmZ dd„ ZeZ	eej
jƒZG dd„ deƒZG dd	„ d	eƒZdS )
é    Né   )Úget_unpatchedc                  C   s0   d} zt | dgd�j W dS  ty   Y dS w )z0
    Return True if Cython can be imported.
    zCython.Distutils.build_extÚ	build_ext)ÚfromlistTF)Ú
__import__r   Ú	Exception)Zcython_impl© r   ú]/Users/abhinavbhinder/Documents/map/venv/lib/python3.10/site-packages/setuptools/extension.pyÚ_have_cython
   s   þr
   c                   @   s    e Zd ZdZdd„ Zdd„ ZdS )Ú	Extensionz7Extension that uses '.c' files in place of '.pyx' filesc                 O   s.   |  dd¡| _tj| ||g|¢R i |¤Ž d S )NÚpy_limited_apiF)Úpopr   Ú
_ExtensionÚ__init__)ÚselfÚnameÚsourcesÚargsÚkwr   r   r	   r   !   s    zExtension.__init__c                 C   sN   t ƒ rdS | jp	d}| ¡ dkrdnd}t tjd|¡}tt|| j	ƒƒ| _	dS )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.
        NÚ zc++z.cppz.cz.pyx$)
r
   ÚlanguageÚlowerÚ	functoolsÚpartialÚreÚsubÚlistÚmapr   )r   ÚlangZ
target_extr   r   r   r	   Ú_convert_pyx_sources_to_lang'   s   
z&Extension._convert_pyx_sources_to_langN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r	   r      s    r   c                   @   s   e Zd ZdZdS )ÚLibraryz=Just like a regular Extension, but built as a library insteadN)r    r!   r"   r#   r   r   r   r	   r$   6   s    r$   )r   r   Údistutils.coreÚ	distutilsÚdistutils.errorsÚdistutils.extensionÚmonkeyr   r
   Z
have_pyrexÚcorer   r   r$   r   r   r   r	   Ú<module>   s    