o
    fL                     @   s   d dl Z d dlZzd dlmZ W n ey   eZY nw e jdZedu rRzd dl	m
  mZ W n  eyQ   zd dlm
  mZ W n eyN   edw Y nw eeddZedu rbeeddZedu rld dl	mZ G dd deeZeZdS )	    N)
basestringz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                    sH   t t|   d| _d| _d| _d | _d | _d| _d| _	d| _
d | _d S )Nr   F)superr   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self	__class__ V/var/www/html/mig_web/myenv/lib/python3.10/site-packages/Cython/Distutils/build_ext.pyr   >   s   
zbuild_ext.initialize_optionsc                    sT   t 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
   r   finalize_optionsr   
isinstancer   splitospathsepr   r   r   r   r   r   J   s   


zbuild_ext.finalize_optionsFc                 C   s   t | |p
t |||S r   )getattr)r   	extensionoption_namedefaultr   r   r   get_extension_attrT   s   zbuild_ext.get_extension_attrc                    s>  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|_| |d| |d||| |d	re| jnd | |d
| |dt|dd | j|dd dd	}||f| j| jdkd|d }|j|_tt| | d S )Nr   )	cythonizer   r   r   zc++r   r   r   r   r   no_c_in_tracebackr   )r$   )	use_listing_fileemit_linenumsinclude_pathcompiler_directives	build_dirgenerate_pxi	gdb_debugc_line_in_tracebackcompile_time_env)forcequiet)Cython.Build.Dependenciesr&   listr   r!   appendinclude_dirsdictr   hasattrupdater%   language
build_tempr1   verbosesourcesr
   r   build_extension)r   extr&   includesinclude_dir
directivesoptionsnew_extr   r   r   r>   W   sJ   








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   __builtin__r   ImportErrorstrmodulesget_build_ext_moduledistutils.command.build_extcommandr   setuptools.command.build_extr!   rH   objectnew_build_extr   r   r   r   <module>   s4    	h