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: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/setuptools/command/__pycache__/bdist_egg.cpython-310.pyc
o

��h4B�@stUdZddlmZddlZddlZddlZddlZddlZddlm	Z	m
Z
mZddlm
Z
ddlmZmZddlmZddlmZd	d
lmZmZddlmZddlmZmZer_dd
lmZedZde d<dd�Z!dd�Z"dd�Z#d;dd�Z$Gdd�de�Z%e&�'d�(��Z)de d<d d!�Z*d"d#�Z+d;d$d%�Z,d&d'd(�Z-d)d*�Z.d+d,�Z/d<d.d/�Z0gd0�Z1	1	1	2	3d=d>d9d:�Z2dS)?z6setuptools.command.bdist_egg

Build .egg distributions�)�annotationsN)�get_path�get_platform�get_python_version)�CodeType)�
TYPE_CHECKING�Literal)�Command)�Library�)�StrPathT�ensure_directory)�log)�mkpath�remove_tree)�	TypeAlias)�r�w�x�ar�_ZipFileModecCstd�S)N�purelib)r�rr�G/usr/local/lib/python3.10/dist-packages/setuptools/command/bdist_egg.py�_get_purelib�rcCs2d|vrtj�|�d}|�d�r|dd�}|S)N�.r�modulei����)�os�path�splitext�endswith)�filenamerrr�strip_module#s

r#ccs8�t�|�D]\}}}|��|��|||fVqdS)zbDo os.walk in a reproducible way,
    independent of indeterministic filesystem readdir order
    N)r�walk�sort)�dir�base�dirs�filesrrr�sorted_walk+s��r*�return�NonecCsPt�d���}t|ddd��}|�||�Wd�dS1s!wYdS)Na�
        def __bootstrap__():
            global __bootstrap__, __loader__, __file__
            import sys, importlib.resources as irs, importlib.util
            with irs.as_file(irs.files(__name__).joinpath(%r)) as __file__:
                __loader__ = None; del __bootstrap__, __loader__
                spec = importlib.util.spec_from_file_location(__name__,__file__)
                mod = importlib.util.module_from_spec(spec)
                spec.loader.exec_module(mod)
        __bootstrap__()
        r�utf-8��encoding)�textwrap�dedent�lstrip�open�write)�resource�pyfile�_stub_template�frrr�
write_stub5s��
"�r9c@s�eZdZdZgd�Zgd�Zdd�Zddd	�Zdd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
ddd�Zddd�Zdd�ZdS) �	bdist_eggzcreate an "egg" distribution))z
bdist-dir=�bz1temporary directory for creating the distribution)z
plat-name=�pzZplatform name to embed in generated filenames (by default uses `sysconfig.get_platform()`))�exclude-source-filesNz+remove all .py files from the generated egg)�	keep-temp�kzPkeep the pseudo-installation tree around after creating the distribution archive)z	dist-dir=�dz-directory to put final built distributions in)�
skip-buildNz2skip rebuilding everything (for testing/debugging))r>rAr=cCs.d|_d|_d|_d|_d|_d|_d|_dS)NF)�	bdist_dir�	plat_name�	keep_temp�dist_dir�
skip_build�
egg_output�exclude_source_files��selfrrr�initialize_options_s
zbdist_egg.initialize_optionsr+r,cCs�|�d�}|_|j|_|jdur|�d�j}tj�|d�|_|jdur(t	�|_|�
dd�|jdurN|jt
�|j��o>|jd�}tj�|j|d�|_dSdS)N�egg_info�bdist�egg)rErE)�
py_version�platformz.egg)�get_finalized_command�ei_cmdrLrB�
bdist_baserr�joinrCr�set_undefined_optionsrG�_get_egg_basenamer�distribution�has_ext_modulesrE)rJrRrS�basenamerrr�finalize_optionshs


��zbdist_egg.finalize_optionscCs�|j|�d�_tj�tj�t���}|jj	g}|j_	|D]D}t
|t�rZt|�dkrZtj�
|d�rZtj�|d�}tj�|�}||ksL|�|tj�rZ|t|�dd�|df}|jj	�|�qzt�d|j�|jdddd�W||j_	dS||j_	w)	N�installrr�zinstalling package data to %s�install_dataF)�force�root)rBrQ�install_librr�normcase�realpathrrW�
data_files�
isinstance�tuple�len�isabs�
startswith�sep�appendr�info�call_command)rJ�
site_packages�old�itemrb�
normalizedrrr�do_install_data~s"�zbdist_egg.do_install_datacCs|jgS)N)rGrIrrr�get_outputs�rzbdist_egg.get_outputscKsTtD]	}|�||j�q|�d|j�|�d|j�|j|fi|��}|�|�|S)z8Invoke reinitialized command `cmdname` with keyword argsrF�dry_run)�INSTALL_DIRECTORY_ATTRS�
setdefaultrBrFrs�reinitialize_command�run_command)rJ�cmdname�kw�dirname�cmdrrrrl�s
zbdist_egg.call_commandcCs�|�d�t�d|j�|�d�}|j}d|_|j��r$|js$|�d�|j	ddd�}||_|�
�\}}g|_g}t|�D]>\}}t
j�|�\}	}
t
j�|jt|	�d�}|j�|�t�d	|�|jsmtt
j�|�|�|�|�|�t
jd
�||<q=|r�|�|�|jjr�|��|j}t
j�|d�}
|�|
�|jjr�t
j�|
d�}t�d
|�|j	d|dd�|�|
�t
j�|
d�}|r�t�d|�|js�t|�t|ddd��}|� d�|��|� d�Wd�n1s�wYnt
j�!|��r	t�d|�|j�s	t
�"|�t#t
j�|d�|�$��t
j�%t
j�|j&d���r't�'d�|j(�r/|�)�t*|j+||j,|j|�-�d�|j.�sIt/|j|jd�t0|jdg��dt1�|j+f�dS)NrLzinstalling library code to %sr[�
build_clibr`F)�warn_dir�.pyzcreating stub loader for %s�/�EGG-INFO�scriptszinstalling scripts to %s�install_scriptsT)�install_dir�no_epznative_libs.txtz
writing %s�wtr-r.�
zremoving %szdepends.txtzxWARNING: 'depends.txt' will not be used by setuptools 0.6!
Use the install_requires/extras_require setup() args instead.)�verbosers�mode�rs�
dist_filesr:)2rwrrkrBrQr_rW�has_c_librariesrFrl�get_ext_outputs�stubs�	enumeraterrr rTr#rjrsr9rY�replaceri�byte_compilercrqrr��copy_metadata_tor
r3r4�isfile�unlink�write_safety_flag�zip_safe�existsrL�warnrH�zap_pyfiles�make_zipfilerGr��
gen_headerrDr�getattrr)rJ�instcmd�old_rootr{�all_outputs�ext_outputs�
to_compiler<�ext_namer"�_extr6�archive_rootrL�
script_dir�native_libs�	libs_filerrr�run�s�






��
��
�z
bdist_egg.runc

Cs�t�d�t|j�D]a\}}}|D]Y}tj�||�}|�d�r*t�d|�t�	|�|�d�rj|}d}t
�||�}tj�|tj|�
d�d�}	t�d|�d	|	�d
��zt�|	�Wn	tycYnwt�||	�qq
dS)Nz+Removing .py files from temporary directoryr~zDeleting %s�__pycache__z#(?P<name>.+)\.(?P<magic>[^.]+)\.pyc�name�.pyczRenaming file from [z] to [�])rrk�walk_eggrBrrrTr!�debugr��re�match�pardir�group�remove�OSError�rename)
rJr'r(r)r�r�path_old�pattern�m�path_newrrrr��s,



����zbdist_egg.zap_pyfilescCs2t|jdd�}|dur
|St�d�t|j|j�S)Nr�z4zip_safe flag not set; analyzing archive contents...)r�rWrr��analyze_eggrBr�)rJ�saferrrr�s

zbdist_egg.zip_safe�Literal['w']cCsdS)NrrrIrrrr�szbdist_egg.gen_headercCshtj�|j�}tj�|d�}|jjjD]}|�|�r1tj�||t	|�d��}t
|�|�||�qdS)z*Copy metadata (egg info) to the target_dir�N)rr�normpathrLrTrR�filelistr)rhrfr
�	copy_file)rJ�
target_dir�
norm_egg_info�prefixr�targetrrrr�s
��zbdist_egg.copy_metadata_toc	s�g}g}|jdi�t|j�D]&\�}}|���fdd�|D��|D]}��|d�tj��|�<q"q|j��rp|�d�}|j	D]-}t
|t�rJqB|�|j
�}|�|�}tj�|��d�sotj�tj�|j|��ro|�|�qB||fS)zAGet a list of relative paths to C extensions in the output distror�c3s4�|]}tj�|�d��tvr��|VqdS)r\N)rrr �lower�NATIVE_EXTENSIONS)�.0r"�r'�pathsrr�	<genexpr>-s�
��z,bdist_egg.get_ext_outputs.<locals>.<genexpr>r�	build_extzdl-)rBr*�extendrrrTrWrXrQ�
extensionsrdr
�get_ext_fullnamer��get_ext_filenamerYrhr�rj)	rJr�r�r(r)r"�	build_cmd�ext�fullnamerr�rr�%s,
� �





�zbdist_egg.get_ext_outputsN�r+r,)r+r�)�__name__�
__module__�__qualname__�description�user_options�boolean_optionsrKrZrqrrrlr�r�r�r�r�r�rrrrr:Gs
	

T

r:z.dll .so .dylib .pydzdict[str, None]r�ccsD�t|�}t|�\}}}d|vr|�d�|||fV|EdHdS)z@Walk an unpacked egg's contents, skipping the metadata directoryr�N)r*�nextr�)�egg_dir�walkerr'r(r)rrrr�Fs�
r�c	Cs�t��D]\}}tj�tj�|d|��r|Sqt�sdSd}t|�D](\}}}|D] }|�d�s7|�d�r8q+|�d�sB|�d�rKt	||||�oJ|}q+q$|S)Nr�FTr~z.pywr�z.pyo)
�safety_flags�itemsrrr�rT�can_scanr�r!�scan_module)	r�r��flag�fnr�r'r(r)r�rrrr�Ps ���r�c	Cs�t��D]G\}}tj�||�}tj�|�r%|dust|�|kr$t�|�q|durKt|�|krKt|ddd��
}|�	d�Wd�n1sFwYqdS)Nr�r-r.r�)
r�r�rrrTr��boolr�r3r4)r�r�r�r�r8rrrr�bs
����r�zzip-safeznot-zip-safe)TFc
Cs�tj�||�}|dd�|vrdS|t|�dd��tjd�}||r%dp&dtj�|�d}d}t|d	�}|�|�t	�
|�}	|��d}
t�
t|	��}d
D]}||vr_t�d||�d}
qPd
|vrvdD]}||vrut�d||�d}
qf|
S)z;Check whether module possibly uses unsafe-for-zipfile stuffN���Tr\rr�r��rb)�__file__�__path__z%s: module references %sF�inspect)�	getsource�
getabsfile�getfile�
getsourcefile�getsourcelines�
findsource�getcomments�getframeinfo�getinnerframes�getouterframes�stack�tracez"%s: module MAY be using inspect.%s)rrrTrfr�rir r3�read�marshal�load�close�dict�fromkeys�iter_symbolsrr�)
r�r'r�r�r"�pkgr�skipr8�coder��symbols�badrrrr�ts0 


��r�ccsH�|jEdH|jD]}t|t�r|Vq
t|t�r!t|�EdHq
dS)zBYield names and strings used by `code` and its nested code objectsN)�co_names�	co_constsrd�strrr�)r��constrrrr��s�


��r�r�cCs2tj�d�s
tjdkr
dSt�d�t�d�dS)N�java�cliTz1Unable to analyze compiled code on this platform.zfPlease ask the author to include a 'zip_safe' setting (either True or False) in the package's setup.pyF)�sysrPrhrr�rrrrr��s
�r�)r`r�r]�install_baseFTr�zip_filenamerr�rsr�c
s�ddl}ttj�|��d�t�d|����fdd�}|r!|jn|j}�sD|j	|||d�}	t
��D]\}
}}||	|
|�q2|	��|St
��D]\}
}}|d|
|�qH|S)aqCreate a zip file from all the files under 'base_dir'.  The output
    zip file will be named 'base_dir' + ".zip".  Uses either the "zipfile"
    Python module (if available) or the InfoZIP "zip" utility (if installed
    and found on the default search path).  If neither tool is available,
    raises DistutilsExecError.  Returns the name of the output zip file.
    rNr�z#creating '%s' and adding '%s' to itcs`|D]+}tj�tj�||��}tj�|�r-|t��dd�}�s'|�||�t�d|�qdS)Nr\zadding '%s')	rrr�rTr�rfr4rr�)�zrz�namesr�rr<��base_dirrsrr�visit�s��zmake_zipfile.<locals>.visit)�compression)�zipfilerrrrzrrk�ZIP_DEFLATED�
ZIP_STORED�ZipFiler*r�)
r	r
r�rs�compressr�rrrr
rzr(r)rrrr��s	�r�r�)r+r�)FFTr)
r	rr�r�rsr�r�rr+r)3�__doc__�
__future__rr�rr�rr0�	sysconfigrrr�typesr�typingrr�
setuptoolsr	�setuptools.extensionr
�_pathrr
�	distutilsr�distutils.dir_utilrr�typing_extensionsrr�__annotations__rr#r*r9r:r�r��splitr�r�r�r�r�r�r�r�rtr�rrrr�<module>sP

}


�(

�