o
    wi                     @   s   d dl Z d dlZe jdZedu r>zd dlm  mZ W n  ey=   zd dl	m  mZ W n ey:   edw Y nw e
eddZedu rNe
eddZedu rXd dlmZ G dd deZeZdS )    Nzsetuptools.command.build_extz:'distutils' cannot be imported. Please install setuptools._du_build_ext	build_ext)r   c                
       st   e Zd Zejddddddej fddd	d
dg	 Zejg d Z fddZ fddZdddZ	 fddZ
  ZS )r   )cython-cplusNzgenerate C++ source files)cython-create-listingNzwrite errors to a listing file)cython-line-directivesNzemit source line directiveszcython-include-dirs=Nz path to the Cython include files)cython-c-in-tempNz'put generated C files in temp directory)zcython-gen-pxiNz*generate .pxi file for public declarations)zcython-directives=Nzcompiler directive overrides)
cython-gdbNz$generate debug information for cygdb)zcython-compile-time-envNzcython compile time environment)r   r   r   r   r   c                    sJ   t    d| _d| _d| _d | _d | _d| _d| _d| _	d | _
d | _d S )Nr   F)superinitialize_optionscython_cpluscython_create_listingcython_line_directivescython_include_dirscython_directivescython_c_in_tempcython_gen_pxi
cython_gdbcython_compile_time_envshared_utility_qualified_nameself	__class__ W/home/ubuntu/sommelier/.venv/lib/python3.10/site-packages/Cython/Distutils/build_ext.pyr
   9   s   

zbuild_ext.initialize_optionsc                    sP   t    | jd u rg | _nt| jtr| jtj| _| jd u r&i | _d S d S N)	r	   finalize_optionsr   
isinstancestrsplitospathsepr   r   r   r   r   r   F   s   



zbuild_ext.finalize_optionsFc                 C   s   t | |p
t |||S r   )getattr)r   	extensionoption_namedefaultr   r   r   get_extension_attrP   s   zbuild_ext.get_extension_attrc           	         sV  ddl m} t| j}t|dg D ]}||vr|| qt|j|_|jt| j D ]}||vr6|| q+t| j}t	|drG|
|j | |drPd|_t	|drZ|j }nd }| |d| |d	||| |d
rq| jnd | |d| |d|| j|dd d| j|dd dd
}||f| j| jdkd|d }|j|_t | d S )Nr   )	cythonizer   r   r   zc++no_c_in_tracebackr   r   r   r   r   r   )r%   r   )
use_listing_fileemit_linenumsinclude_pathcompiler_directives	build_dirgenerate_pxi	gdb_debugc_line_in_tracebackcompile_time_envr   )forcequiet)Cython.Build.Dependenciesr'   listr   r"   appendinclude_dirsdictr   hasattrupdater&   languager(   
build_tempr2   verbosesourcesr	   build_extension)	r   extr'   includesinclude_dir
directivesr0   optionsnew_extr   r   r   r?   S   sR   










zbuild_ext.build_extension)F)__name__
__module____qualname__
_build_extuser_optionssep_byboolean_optionsr
   r   r&   r?   __classcell__r   r   r   r   r      s&    

)sysr    modulesget_build_ext_moduledistutils.command.build_extcommandr   ImportErrorsetuptools.command.build_extr"   rI   new_build_extr   r   r   r   <module>   s*    	n