HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: sport3497 (1034)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/setuptools/command/__pycache__/build_ext.cpython-310.pyc
o

��h!H�@s�ddlmZddlZddlZddlZddlZddlmZddlm	Z	ddl
mZddl
mZddlmZddlmZdd	lmZdd
lmZmZddlmZddlmZdd
lmZmZereddlm Z!nzddl"m Z!e#d�Wne$y�ddlm Z!Ynwed�ddlm%Z&dd�Z'dZ(dZ)dZ*ej+dkr�dZ)nej,dkr�z
ddl-Z-e.e-d�Z)Z(Wn	e$y�Ynwdd�Z/Gdd�de!�Z e)s�ej,dkr�										d&d'd"d#�Z0dSd$Z*										d&d'd%d#�Z0dS)(�)�annotationsN)�Iterator��EXTENSION_SUFFIXES)�cache_from_source)�Path)�
TYPE_CHECKING)�Distribution)�	BaseError)�	Extension�Library)�log)�new_compiler)�customize_compiler�get_config_var)�	build_extzCython.Compiler.Main�LDSHARED)�_config_varsc	Csltjdkr0t��}zdtd<dtd<dtd<t|�Wt��t�|�dSt��t�|�wt|�dS)N�darwinz0gcc -Wl,-x -dynamiclib -undefined dynamic_lookuprz -dynamiclib�CCSHAREDz.dylib�SO)�sys�platform�_CONFIG_VARS�copyr�clear�update)�compiler�tmp�r�G/usr/local/lib/python3.10/dist-packages/setuptools/command/build_ext.py�_customize_compiler_for_shlib*s
�
�r!F�sharedrT�nt�RTLD_NOWcCs.tD]}d|vr|S|dkr|SqdS)z;Return the file extension for an abi3-compliant Extension()z.abi3z.pydNr)�suffixrrr �get_abi3_suffixNs�r&c@s�eZdZUded<dZdZdd�Zd<d
d�Zd=d
d�Zd>dd�Z	d?dd�Z
d@dd�Zdd�Zd=dd�Z
dd�Zdd �Zd=d!d"�Zd#d$�ZdAd&d'�ZdBd)d*�ZdAd+d,�ZdCd.d/�Zd0d1�Zd2d3�ZdDd=d4d5�ZdDdEd7d8�ZdFd9d:�Zd;S)Grr	�distributionFcCs2|jd}|_t�|�||_|r|��dSdS)z;Build extensions in build directory, then copy if --inplaceFN)�inplace�
_build_ext�run�copy_extensions_to_source)�self�old_inplacerrr r*]s
�z
build_ext.run�extr�return�tuple[str, str]c
Csj|�|j�}|�|�}|�d�}d�|dd��}|�|�}tj�|tj�|��}tj�|j	|�}	||	fS)N�.���)
�get_ext_fullname�name�get_ext_filename�split�join�get_package_dir�os�path�basename�	build_lib)
r,�build_pyr.�fullname�filename�modpath�package�package_dir�inplace_file�regular_filerrr �_get_inplace_equivalentes


z!build_ext._get_inplace_equivalent�NonecCsp|�d�}|jD]-}|�||�\}}tj�|�s|js$|j|||jd�|j	r5|�
||�}|j||dd�qdS)Nr=)�levelT)�compile)�get_finalized_command�
extensionsrEr9r:�exists�optional�	copy_file�verbose�_needs_stub�_get_equivalent_stub�_write_stub_file)r,r=r.rCrD�inplace_stubrrr r+os

��z#build_ext.copy_extensions_to_source�output_file�strcCs2tj�|�}|j�d�\}}}tj�||��d�S�Nr1�.py)r9r:�dirnamer4�
rpartitionr7)r,r.rS�dir_�_r4rrr rP�szbuild_ext._get_equivalent_stub�Iterator[tuple[str, str]]c
cs��|jsdS|�d�}|�d�jpd}|jD]/}|�||�\}}||fV|jrE|�||�}|�||�}t||d�}t||d�}	|	|fVqdS)Nr=�install_lib�)�optimization)r(rI�optimizerJrErOrP�_compiled_file_name)
r,r=�optr.rCrDrR�regular_stub�
inplace_cache�output_cacherrr �_get_output_mapping�s �



��zbuild_ext._get_output_mappingr>c	Cs�t�d�}|rtjj|�d��|}nt�||�}td�}t|t	�s&t
d��|}||jvro|j|}t�}|j
rE|rE|dt|��|}t|t�rYtj�|�\}}|j�|t�Stro|jrotj�|�\}}tj�|d|�S|S)N�SETUPTOOLS_EXT_SUFFIXr1�
EXT_SUFFIXzwConfiguration variable EXT_SUFFIX not found for this platform and environment variable SETUPTOOLS_EXT_SUFFIX is missingzdl-)r9�getenvr:r7r6r)r5r�
isinstancerT�OSError�ext_mapr&�py_limited_api�lenr�splitext�shlib_compiler�library_filename�libtype�	use_stubs�_links_to_dynamic)	r,r>�so_extr?�
ext_suffixr.�abi3_suffix�fn�drrr r5�s,

�




zbuild_ext.get_ext_filenamecCs&t�|�d|_g|_i|_d|_dS)NF)r)�initialize_optionsro�shlibsrk�
editable_mode�r,rrr ry�s


zbuild_ext.initialize_optionscCs8t�|�|jp	g|_|�|j�dd�|jD�|_|jr!|��|jD]	}|�|j�|_q$|jD]`}|j}||j	|<||j	|�
d�d<|jrM|�|�pNd}|oXtoXt
|t�}||_||_|�|�}|_tj�tj�|j|��}|r�||jvr�|j�|�|r�tr�tj|jvr�|j�tj�q1|jr�d|_dSdS)NcSsg|]	}t|t�r|�qSr)rir��.0r.rrr �
<listcomp>�sz.build_ext.finalize_options.<locals>.<listcomp>r1r2FT)r)�finalize_optionsrJ�check_extensions_listrz�setup_shlib_compilerr3r4�
_full_namerkr6�links_to_dynamicrrrirrsrOr5�
_file_namer9r:rWr7r<�library_dirs�append�curdir�runtime_library_dirsr{r()r,r.r>�ltd�nsr?�libdirrrr r��s4



�
�zbuild_ext.finalize_optionscCs�t|j|j|jd�}|_t|�|jdur|�|j�|jdur/|jD]
\}}|�	||�q$|j
dur?|j
D]}|�|�q7|jdurJ|�
|j�|jdurU|�|j�|jdur`|�|j�|jdurk|�|j�t�|�|_dS)N)r�dry_run�force)rrr�r�ror!�include_dirs�set_include_dirs�define�define_macro�undef�undefine_macro�	libraries�
set_librariesr��set_library_dirs�rpath�set_runtime_library_dirs�link_objects�set_link_objects�link_shared_object�__get__)r,rr4�value�macrorrr r��s*�







zbuild_ext.setup_shlib_compilercCst|t�r|jSt�||�S�N)rir�export_symbolsr)�get_export_symbols�r,r.rrr r��s
zbuild_ext.get_export_symbolscCsl|��|j}z*t|t�r|j|_t�||�|jr,|�d�j	}|�
||�W||_dSW||_dS||_w)Nr=)�_convert_pyx_sources_to_langrrirror)�build_extensionrOrIr<�
write_stub)r,r.�	_compilerr<rrr r��s

�zbuild_ext.build_extensioncsPt�dd�|jD���d�|j�d�dd�dg��t��fdd�|jD��S)	z?Return true if 'ext' links to a dynamic lib in the same packagecSsg|]}|j�qSr)r�)r~�librrr rsz.build_ext.links_to_dynamic.<locals>.<listcomp>r1Nr2r]c3s�|]	}�|�vVqdSr�r)r~�libname��libnames�pkgrr �	<genexpr>��z-build_ext.links_to_dynamic.<locals>.<genexpr>)�dict�fromkeysrzr7r�r6�anyr�r�rr�r r�s zbuild_ext.links_to_dynamic�	list[str]cCsgt�|��|���Sr�)r)�get_source_files�_get_internal_dependsr|rrr r�szbuild_ext.get_source_files�
Iterator[str]c	cs��t|jjptj���}dd�|jD�}ddd	�}|D]O}t|�}|��r+||d
�qd|jvr6||d�qz
||jd
d�}Wnt	yN||d�Yqwz|�
|�Wntyd||d�Yqw|��VqdS)zAYield ``ext.depends`` that are contained by the project directorycss �|]}|jD]}|VqqdSr�)�depends)r~r.�deprrr r�s�z2build_ext._get_internal_depends.<locals>.<genexpr>�	orig_pathrT�reasonr/rFcSst�d||�dS)NzJdependency %s won't be automatically included in the manifest: the path %s)r
�info)r�r�rrr �skips
�z-build_ext._get_internal_depends.<locals>.skipzmust be relativez..zcan't have `..` segmentsT)�strictz
doesn't existzmust be inside the project rootN)r�rTr�rTr/rF)
rr'�src_rootr9r��resolverJ�is_absolute�partsrj�relative_to�
ValueError�as_posix)r,�project_rootr�r�r�r:�resolvedrrr r�s4�




�
��zbuild_ext._get_internal_dependscCs,|jrt|�����Stt�|�|���Sr�)r(�list�get_output_mapping�keys�sortedr)�get_outputs�_build_ext__get_stubs_outputsr|rrr r�>szbuild_ext.get_outputs�dict[str, str]cCs|��}tt|dd�d��S)z1See :class:`setuptools.commands.build.SubCommand`cSs|dS)Nrr)�xrrr �<lambda>Fsz.build_ext.get_output_mapping.<locals>.<lambda>)�key)rer�r�)r,�mappingrrr r�Cszbuild_ext.get_output_mappingcs6�fdd��jD�}t�|����}tdd�|D��S)Nc3s4�|]}|jrtjj�jg|j�d��R�VqdS)r1N)rOr9r:r7r<r�r6r}r|rr r�Js��
�z0build_ext.__get_stubs_outputs.<locals>.<genexpr>css�|]	\}}||VqdSr�r)r~�base�fnextrrr r�Qr�)rJ�	itertools�product�!_build_ext__get_output_extensionsr�)r,�ns_ext_bases�pairsrr|r �__get_stubs_outputsHs

�zbuild_ext.__get_stubs_outputsccs(�dVdV|�d�jrdVdSdS)NrVz.pycr=z.pyo)rIr_r|rrr �__get_output_extensionsSs�
�z!build_ext.__get_output_extensionscCs2tjj|g|j�d��R�d}|�|||�dSrU)r9r:r7r�r6rQ)r,�
output_dirr.rH�	stub_filerrr r�Ys zbuild_ext.write_stubr�cCs�t�d|j|�|rtj�|�rt|d��|jsLt|ddd��$}t	�
dtj�|j��d���
��ddt�}|�|�Wd�n1sGwY|rU|�|�dSdS)	Nz writing stub loader for %s to %sz already exists! Please delete.�wzutf-8)�encodinga7
                    def __bootstrap__():
                       global __bootstrap__, __file__, __loader__
                       import sys, os, importlib.resources as irs, importlib.util
                    #rtld   import dl
                       with irs.files(__name__).joinpath(
                         a) as __file__:
                          del __bootstrap__
                          if '__loader__' in globals():
                              del __loader__
                    #rtld      old_flags = sys.getdlopenflags()
                          old_dir = os.getcwd()
                          try:
                            os.chdir(os.path.dirname(__file__))
                    #rtld        sys.setdlopenflags(dl.RTLD_NOW)
                            spec = importlib.util.spec_from_file_location(
                                       __name__, __file__)
                            mod = importlib.util.module_from_spec(spec)
                            spec.loader.exec_module(mod)
                          finally:
                    #rtld        sys.setdlopenflags(old_flags)
                            os.chdir(old_dir)
                    __bootstrap__()
                    z#rtld)r
r�r�r9r:rKr
r��open�textwrap�dedentr;r��lstrip�replace�	have_rtld�write�_compile_and_remove_stub)r,r�r.rH�f�contentrrr rQ]s ����zbuild_ext._write_stub_filecCspddlm}||gdd|jd�|�d�j}|dkr$||g|d|jd�tj�|�r4|js6t�|�dSdSdS)Nr)�byte_compileT)r_r�r�r\)	�distutils.utilr�r�rIr_r9r:rK�unlink)r,r�r�r_rrr r��s��z"build_ext._compile_and_remove_stubN)r.rr/r0)r/rF)r.rrSrTr/rT)r/r[)r>rTr/rT)r/r�)r/r�)r/r�)F)r�rTr.r)r�rT)�__name__�
__module__�__qualname__�__annotations__r{r(r*rEr+rPrer5ryr�r�r�r�r�r�r�r�r�r�r�r�rQr�rrrr rXs2









	

&
&r�debug�boolr/rFc

Cs(|�|j|||||||||	|
||�
dSr�)�link�SHARED_LIBRARY)
r,�objects�output_libnamer�r�r�r�r�r��
extra_preargs�extra_postargs�
build_temp�target_langrrr r��s�r��staticc
Cs^|dusJ�tj�|�\}}
tj�|
�\}}|�d��d�r$|dd�}|�|||||�dS)Nr�r��)r9r:r6rnrp�
startswith�create_static_lib)r,r�r�r�r�r�r�r�r�r�r�r�r�r?r;�_extrrr r��s)
NNNNNFNNNN)r�r�r/rF)1�
__future__rr�r9rr��collections.abcr�importlib.machineryr�importlib.utilrr`�pathlibr�typingr�setuptools.distr	�setuptools.errorsr
�setuptools.extensionrr�	distutilsr
�distutils.ccompilerr�distutils.sysconfigrr�distutils.command.build_extrr)�Cython.Distutils.build_ext�
__import__�ImportErrorrrr!r�rrrqrr4�dl�hasattrr&r�rrrr �<module>s��

�
=�!�