HEX
Server: Apache
System: Linux p3plzcpnl506847.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: slfopp7cb1df (5698090)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/python38/lib/python3.8/site-packages/setuptools/command/__pycache__/bdist_egg.cpython-38.pyc
U

�i�_�G�@s�dZddlmZddlmZmZddlmZddlm	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlmZddlmZmZmZdd	lmZdd
lmZddlmZmZzddlmZmZd
d�ZWn,e k
r�ddl!m"Z"mZdd�ZYnXdd�Z#dd�Z$dd�Z%Gdd�de�Z&e'�(d�)��Z*dd�Z+dd�Z,dd�Z-d d!d"�Z.d#d$�Z/d%d&�Z0d'd(�Z1d)d*d+d,gZ2d1d/d0�Z3dS)2z6setuptools.command.bdist_egg

Build .egg distributions�)�DistutilsSetupError)�remove_tree�mkpath)�log)�CodeTypeN)�six)�get_build_platform�Distribution�ensure_directory)�
EntryPoint)�Library)�Command�SetuptoolsDeprecationWarning)�get_path�get_python_versioncCstd�S)N�purelib)r�rr�@/tmp/pip-unpacked-wheel-tlqm5ymo/setuptools/command/bdist_egg.py�_get_purelibsr)�get_python_librcCstd�S)NF)rrrrrr scCs2d|krtj�|�d}|�d�r.|dd�}|S)N�.r�modulei����)�os�path�splitext�endswith)�filenamerrr�strip_module$s

rccs6t�|�D]&\}}}|��|��|||fVq
dS)zbDo os.walk in a reproducible way,
    independent of indeterministic filesystem readdir order
    N)r�walk�sort)�dir�base�dirs�filesrrr�sorted_walk,sr$c	Cs6t�d���}t|d��}|�||�W5QRXdS)NaR
        def __bootstrap__():
            global __bootstrap__, __loader__, __file__
            import sys, pkg_resources, imp
            __file__ = pkg_resources.resource_filename(__name__, %r)
            __loader__ = None; del __bootstrap__, __loader__
            imp.load_dynamic(__name__,__file__)
        __bootstrap__()
        �w)�textwrap�dedent�lstrip�open�write)�resource�pyfileZ_stub_template�frrr�
write_stub6s	r.c@s�eZdZdZdddde�fdddd	gZd
ddgZd
d�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd �Zd!d"�Zd#S)$�	bdist_eggzcreate an "egg" distribution)z
bdist-dir=�bz1temporary directory for creating the distributionz
plat-name=�pz;platform name to embed in generated filenames (default: %s))�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)r3r6r2cCs.d|_d|_d|_d|_d|_d|_d|_dS)Nr)�	bdist_dir�	plat_name�	keep_temp�dist_dir�
skip_build�
egg_output�exclude_source_files��selfrrr�initialize_options[szbdist_egg.initialize_optionscCs�|�d�}|_|j|_|jdkr>|�d�j}tj�|d�|_|jdkrPt	�|_|�
dd�|jdkr�tdd|j
|jt�|j��o�|j��
�}tj�|j|d�|_dS)N�egg_info�bdistZegg)r:r:z.egg)�get_finalized_command�ei_cmdrAr7�
bdist_baserr�joinr8r�set_undefined_optionsr<r	�egg_nameZegg_versionr�distribution�has_ext_modulesr:)r?rDrE�basenamerrr�finalize_optionsds$


�zbdist_egg.finalize_optionscCs�|j|�d�_tj�tj�t���}|jj	g}|j_	|D]�}t
|t�r�t|�dkr�tj�
|d�r�tj�|d�}tj�|�}||ks�|�|tj�r�|t|�dd�|df}|jj	�|�q:z"t�d|j�|jdddd�W5||j_	XdS)N�install�r�zinstalling package data to %s�install_data)�force�root)r7rC�install_librr�normcase�realpathrrI�
data_files�
isinstance�tuple�len�isabs�
startswith�sep�appendr�info�call_command)r?�
site_packages�old�itemrU�
normalizedrrr�do_install_data|s"�zbdist_egg.do_install_datacCs|jgS)N)r<r>rrr�get_outputs�szbdist_egg.get_outputscKsPtD]}|�||j�q|�d|j�|�d|j�|j|f|�}|�|�|S)z8Invoke reinitialized command `cmdname` with keyword argsr;�dry_run)�INSTALL_DIRECTORY_ATTRS�
setdefaultr7r;rf�reinitialize_command�run_command)r?Zcmdname�kw�dirname�cmdrrrr_�s
zbdist_egg.call_commandcCs�|�d�t�d|j�|�d�}|j}d|_|j��rH|jsH|�d�|j	ddd�}||_|�
�\}}g|_g}t|�D]|\}}t
j�|�\}	}
t
j�|jt|	�d�}|j�|�t�d	|�|js�tt
j�|�|�|�|�|�t
jd
�||<qz|�r|�|�|jj�r|��|j}t
j�|d�}
|�|
�|jj�rlt
j�|
d�}t�d
|�|j	d|dd�|�|
�t
j�|
d�}|�r�t�d|�|j�st|�t|d�}|� d�|��|� d�|�!�n,t
j�"|��rt�d|�|j�st
�#|�t$t
j�|d�|�%��t
j�&t
j�|j'd���r<t�(d�|j)�rL|�*�t+|j,||j-|j|�.�d�|j/�s�t0|j|jd�t1|jdg��dt2�|j,f�dS)NrAzinstalling library code to %srM�
build_clibrSr)�warn_dir�.pyzcreating stub loader for %s�/�EGG-INFO�scriptszinstalling scripts to %s�install_scriptsrO)�install_dirZno_epznative_libs.txtz
writing %s�wt�
zremoving %szdepends.txtzxWARNING: 'depends.txt' will not be used by setuptools 0.6!
Use the install_requires/extras_require setup() args instead.)�verboserf�mode�rf�
dist_filesr/)3rjrr^r7rCrRrI�has_c_librariesr;r_�get_ext_outputs�stubs�	enumeraterrrrFrr]rfr.rK�replacer\�byte_compilerVrdrrs�copy_metadata_tor
r)r*�close�isfile�unlink�write_safety_flag�zip_safe�existsrA�warnr=�zap_pyfiles�make_zipfiler<rx�
gen_headerr9r�getattrr)r?ZinstcmdZold_rootrm�all_outputs�ext_outputsZ
to_compiler1Zext_namer�extr,Zarchive_rootrAZ
script_dirZnative_libsZ	libs_filerrr�run�s�


�




�




����z
bdist_egg.runc

Cs�t�d�t|j�D]�\}}}|D]�}tj�||�}|�d�rTt�d|�t�	|�|�d�r"|}d}t
�||�}tj�|tj|�
d�d�}	t�d||	f�zt�|	�Wntk
r�YnXt�||	�q"qdS)	Nz+Removing .py files from temporary directoryrpzDeleting %s�__pycache__z#(?P<name>.+)\.(?P<magic>[^.]+)\.pyc�name�.pyczRenaming file from [%s] to [%s])rr^�walk_eggr7rrrFr�debugr��re�match�pardir�group�remove�OSError�rename)
r?r!r"r#r�rZpath_old�pattern�mZpath_newrrrr��s4



���zbdist_egg.zap_pyfilescCs2t|jdd�}|dk	r|St�d�t|j|j�S)Nr�z4zip_safe flag not set; analyzing archive contents...)r�rIrr��analyze_eggr7r~)r?�saferrrr�
s

zbdist_egg.zip_safec
Cs�t�|jjpd�}|�di��d�}|dkr0dSt�dt�|jrH|j	rVt
d|f��djtj
�}|j}d�|j�}|jd	}tj�|j�}d
t�}|js�ttj�|j�|jd�t|jd�}	|	�|�|	��dS)
N�zsetuptools.installationZeggsecutabler%zEEggsecutables are deprecated and will be removed in a future version.zGeggsecutable entry point (%r) cannot have 'extras' or refer to a modulez{}.{}rraH#!/bin/sh
if [ `basename $0` = "%(basename)s" ]
then exec python%(pyver)s -c "import sys, os; sys.path.insert(0, os.path.abspath('$0')); from %(pkg)s import %(base)s; sys.exit(%(full)s())" "$@"
else
  echo $0 is not the correct name for this egg file.
  echo Please rename it back to %(basename)s and try again.
  exec false
fi
rz�a)r�	parse_maprI�entry_points�get�warningsr�r�attrs�extrasr�format�sys�version_info�module_namerFrrrKr<�localsrfrrlr)r*r�)
r?Zepm�ep�pyver�pkg�fullr!rK�headerr-rrrr�s8���
�
zbdist_egg.gen_headercCshtj�|j�}tj�|d�}|jjjD]<}|�|�r&tj�||t	|�d��}t
|�|�||�q&dS)z*Copy metadata (egg info) to the target_dirr�N)rr�normpathrArFrD�filelistr#r[rYr
�	copy_file)r?�
target_dirZ
norm_egg_info�prefixr�targetrrrr�As
zbdist_egg.copy_metadata_tocCsg}g}|jdi}t|j�D]f\}}}|D].}tj�|�d��tkr*|�|||�q*|D]"}|||d|tj�||�<q^q|j	�
�r�|�d�}|jD]Z}	t
|	t�r�q�|�|	j�}
|�|
�}tj�|��d�s�tj�tj�|j|��r�|�|�q�||fS)zAGet a list of relative paths to C extensions in the output distror�rOrq�	build_extzdl-)r7r$rrr�lower�NATIVE_EXTENSIONSr]rFrIrJrC�
extensionsrWrZget_ext_fullnamer�Zget_ext_filenamerKr[r�)r?r�r��pathsr!r"r#rZ	build_cmdr��fullnamerrrr}Ms0
��




zbdist_egg.get_ext_outputsN)�__name__�
__module__�__qualname__�descriptionr�user_options�boolean_optionsr@rLrdrer_r�r�r�r�r�r}rrrrr/Ds2���	
Q-r/z.dll .so .dylib .pydccsHt|�}t|�\}}}d|kr(|�d�|||fV|D]
}|Vq8dS)z@Walk an unpacked egg's contents, skipping the metadata directoryrrN)r$�nextr�)�egg_dir�walkerr!r"r#Zbdfrrrr�ms
r�c	Cs�t��D](\}}tj�tj�|d|��r|Sqt�s<dSd}t|�D]R\}}}|D]B}|�d�sV|�d�rrqVqV|�d�s�|�d�rVt	||||�o�|}qVqH|S)NrrFTrpz.pywr�z.pyo)
�safety_flags�itemsrrr�rF�can_scanr�r�scan_module)	r�r~�flag�fnr�r!r"r#r�rrrr�xs
r�cCs�t��D]r\}}tj�||�}tj�|�rJ|dks>t|�|krzt�|�q|dk	rt|�|krt|d�}|�	d�|�
�qdS)Nrvrw)r�r�rrrFr��boolr�r)r*r�)r�r�r�r�r-rrrr��s

r�zzip-safeznot-zip-safe)TFc
Cstj�||�}|dd�|kr"dS|t|�dd��tjd�}||rJdpLdtj�|�d}tjrld}nt	j
d	kr|d
}nd}t|d�}|�|�t
�|�}	|��d}
t�t|	��}d
D]}||kr�t�d||�d}
q�d|k�r
dD]}||kr�t�d||�d}
q�|
S)z;Check whether module possibly uses unsafe-for-zipfile stuffN���TrOrr�r�)�����rb)�__file__�__path__z%s: module references %sF�inspect)�	getsource�
getabsfile�
getsourcefileZgetfilegetsourcelines�
findsource�getcomments�getframeinfo�getinnerframes�getouterframes�stack�tracez"%s: module MAY be using inspect.%s)rrrFrYr�r\rr�PY2r�r�r)�read�marshal�loadr��dict�fromkeys�iter_symbolsrr�)
r�r!r�r~rr�r�skipr-�coder��symbols�badrrrr��s4 




r�ccsT|jD]
}|Vq|jD]6}t|tj�r0|Vqt|t�rt|�D]
}|VqBqdS)zBYield names and strings used by `code` and its nested code objectsN)�co_names�	co_constsrWr�string_typesrr�)r�r��constrrrr��s


r�cCs2tj�d�stjdkrdSt�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.py)r��platformr[rr�rrrrr��s
r�rSrurP�install_baseTr%c
s�ddl}ttj�|��d�t�d|����fdd�}|rB|jn|j}�s�|j	|||d�}	t
��D]\}
}}||	|
|�qd|	��n t
��D]\}
}}|d|
|�q�|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.
    rNrzz#creating '%s' and adding '%s' to itcs`|D]V}tj�tj�||��}tj�|�r|t��dd�}�sN|�||�t�d|�qdS)NrOzadding '%s')	rrr�rFr�rYr*rr�)�zrl�namesr�rr1��base_dirrfrr�visit�szmake_zipfile.<locals>.visit)�compression)�zipfilerrrrlrr^�ZIP_DEFLATED�
ZIP_STORED�ZipFiler$r�)
�zip_filenamer�rxrf�compressryr�r�r�r�rlr"r#rr�rr��s	
r�)rrTr%)4�__doc__�distutils.errorsr�distutils.dir_utilrr�	distutilsr�typesrr�rr�r&r�r�Zsetuptools.externr�
pkg_resourcesrr	r
rZsetuptools.extensionr�
setuptoolsr
r�	sysconfigrrr�ImportError�distutils.sysconfigrrr$r.r/r�r��splitr�r�r�r�r�r�r�r�rgr�rrrr�<module>sZ
(�$
��