Current File : //usr/lib/python3/dist-packages/setuptools/command/__pycache__/bdist_egg.cpython-312.pyc
�


_�d�@��6�dZddlmZmZddlmZddlmZddlZddl	Z	ddl
Z
ddlZddlZddl
mZddlmZdd	lmZdd
lmZmZd�Zd�Zd
�Zd�ZGd�de�Zej9dj;��Zd�Zd�Z d�Z!ddd�Z"d�Z#d�Z$d�Z%gd�Z&dd�Z'y)z6setuptools.command.bdist_egg

Build .egg distributions�)�remove_tree�mkpath)�log)�CodeTypeN)�Library)�Command�)�ensure_directory)�get_path�get_python_versionc��td�S)N�purelib)r���>/usr/lib/python3/dist-packages/setuptools/command/bdist_egg.py�_get_purelibrs
���I��rc�~�d|vr"tjj|�d}|jd�r|dd}|S)N�.r�modulei����)�os�path�splitext�endswith)�filenames r�strip_modulers@��
�h���7�7�#�#�H�-�a�0������"��C�R�=���Orc#�K�tj|�D]-\}}}|j�|j�|||f���/y�w)zbDo os.walk in a reproducible way,
    independent of indeterministic filesystem readdir order
    N)r�walk�sort)�dir�base�dirs�filess    r�sorted_walkr#!sE���� �W�W�S�\� ���d�E��	�	��
�
�
���D�%��� �s�AA	c��tjd�j�}t|d�5}|j	||z�ddd�y#1swYyxYw)Na�
        def __bootstrap__():
            global __bootstrap__, __loader__, __file__
            import sys, pkg_resources, importlib.util
            __file__ = pkg_resources.resource_filename(__name__, %r)
            __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__()
        �w)�textwrap�dedent�lstrip�open�write)�resource�pyfile�_stub_template�fs    r�
write_stubr/+sU���_�_�
	��
�f�h��
�f�c�	�+�a�	�����)�*�+�+�+�s�A�Ac�b�eZdZdZgd�Zgd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zy)�	bdist_eggzcreate an "egg" distribution))z
bdist-dir=�bz1temporary directory for creating the distribution)z
plat-name=�pzdplatform name to embed in generated filenames (by default uses `pkg_resources.get_build_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))r5r8r4c�f�d|_d|_d|_d|_d|_d|_d|_y)Nr)�	bdist_dir�	plat_name�	keep_temp�dist_dir�
skip_build�
egg_output�exclude_source_files��selfs r�initialize_optionszbdist_egg.initialize_optionsUs4�������������
�������$(��!rc�N�|jd�x}|_|j|_|j�@|jd�j}t
jj|d�|_|j�ddl	m
}|�|_|jdd�|j�t|jt�|jj!�xr|j��}t
jj|j"|dz�|_yy)	N�egg_info�bdist�eggr)�get_build_platform)r=r=)�
py_version�platformz.egg)�get_finalized_command�ei_cmdrEr:�
bdist_baserr�joinr;�
pkg_resourcesrH�set_undefined_optionsr?�_get_egg_basenamer�distribution�has_ext_modulesr=)rBrLrMrH�basenames     r�finalize_optionszbdist_egg.finalize_options^s���#�9�9�*�E�E��������
��>�>�!��3�3�G�<�G�G�J��W�W�\�\�*�e�<�D�N��>�>�!�8�/�1�D�N��"�"�7�,D�E��?�?�"��/�/�-�/��*�*�:�:�<�O����0��H�
!�g�g�l�l�4�=�=�(�V�:K�L�D�O�#rc��|j|jd�_tjjtjj
t���}|jjgc}|j_	|D]�}t|t�r�t|�dk(r�tjj|d�r~tjj
|d�}tjj|�}||k(s"|j|tjz�r|t|�dzd|df}|jjj!|���	t#j$d|j�|j'ddd��||j_	y#||j_	wxYw)N�installr	r�zinstalling package data to %s�install_data)�force�root)r:rK�install_librr�normcase�realpathrrR�
data_files�
isinstance�tuple�len�isabs�
startswith�sep�appendr�info�call_command)rB�
site_packages�old�itemr^�
normalizeds      r�do_install_datazbdist_egg.do_install_datavsi��<@�N�N��"�"�9�-�9����(�(����)9�)9�,�.�)I�J�
�,0�,=�,=�,H�,H�"�)��T�
�
�
)��
	6�D��$��&�3�t�9��>��7�7�=�=��a��)�!�w�w�/�/��Q��8�H�!#���!1�!1�(�!;�J�!�]�2�j�6K�6K�%����.�7� (��M�(:�Q�(>�(@�A�4��7�J�����(�(�/�/��5�
	6�	/��H�H�4�d�n�n�E����n�A�D��A�+.�D���(��3�D���(�s�84F>�>Gc��|jgS)N)r?rAs r�get_outputszbdist_egg.get_outputs�s����� � rc��tD]}|j||j�� |jd|j�|jd|j�|j
|fi|��}|j
|�|S)z8Invoke reinitialized command `cmdname` with keyword argsr>�dry_run)�INSTALL_DIRECTORY_ATTRS�
setdefaultr:r>rq�reinitialize_command�run_command)rB�cmdname�kw�dirname�cmds     rrhzbdist_egg.call_command�sq��.�	3�G��M�M�'�4�>�>�2�	3�
�
�
�l�D�O�O�4�
�
�
�i����.�'�d�'�'��6�2�6������!��
rc��	�|jd�tjd|j�|j	d�}|j
}d|_|jj�r|js|jd�|jdd��}||_|j�\}}g|_g}t|�D]�\}}tjj|�\}	}
tjj!|jt#|	�dz�}|jj%|�tjd	|�|j&s)t)tjj+|�|�|j%|�|j-tj.d
�||<��|r|j1|�|jj2r|j5�|j}tjj!|d�}
|j7|
�|jj8rJtjj!|
d�}tjd
|�|jd|d��|j;|
�tjj!|
d�}|r{tjd|�|j&s�t=|�t?|d�}|jAdj!|��|jAd�|jC�nVtjjE|�r7tjd|�|j&stjF|�tItjj!|d�|jK��tjjMtjj!|jNd��rtjPd�|jRr|jU�tW|jX||jZ|j&|j]���|j^s!ta|j|j&��tc|jdg�j%dte�|jXf�y)NrEzinstalling library code to %srW�
build_clibr\r)�warn_dir�.pyzcreating stub loader for %s�/�EGG-INFO�scriptszinstalling scripts to %s�install_scriptsrX)�install_dir�no_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.)�verboserq�mode�rq�
dist_filesr1)3rurrgr:rKr[rR�has_c_librariesr>rh�get_ext_outputs�stubs�	enumeraterrrrNrrfrqr/rT�replacere�byte_compiler_rmrr��copy_metadata_tor
r)r*�close�isfile�unlink�write_safety_flag�zip_safe�existsrE�warnr@�zap_pyfiles�make_zipfiler?r��
gen_headerr<r�getattrr)rB�instcmd�old_rootry�all_outputs�ext_outputs�
to_compiler3�ext_namer�extr,�archive_rootrE�
script_dir�native_libs�	libs_files                 r�runz
bdist_egg.run�s�������$�	���0�$�.�.�A��,�,�Y�7���<�<��������,�,�.�t������\�*����
���:�����#'�#7�#7�#9� ��[���
��
�$�[�1�	;�K�A�x��G�G�,�,�X�6�M�H�c��W�W�\�\�$�.�.�,�x�2H�5�2P�Q�F��J�J���f�%��H�H�2�H�=��<�<��2�7�7�+�+�H�5�v�>����f�%�%�-�-�b�f�f�c�:�K��N�	;�����Z�(����'�'�� � �"��~�~���7�7�<�<��j�9�����H�����$�$������h�	�:�J��H�H�/��<����/�Z�q��Q����h�'��g�g�l�l�8�->�?����H�H�\�;�/��<�<� ��-� ��d�3�	�����	�	�+� 6�7�����%����!�
�W�W�^�^�K�
(��H�H�]�K�0��<�<��	�	�+�&��"�'�'�,�,�|�Z�@�$�-�-�/�R�
�7�7�>�>�"�'�'�,�,�t�}�}�m�D�E��H�H�P�
�
�$�$�����	��O�O���L�L��L�L����"�	
��~�~��������=�	��!�!�<��4�;�;�
�,�.����@�	
rc	��tjd�t|j�D�]!\}}}|D�]}tj
j
||�}|jd�r+tjd|�t	j|�|jd�s�r|}d}tj||�}tj
j
|tj|jd�dz�}	tjd|�d	|	�d
��	t	j|	�t	j ||	�����$y#t$rY�(wxYw)Nz+Removing .py files from temporary directoryr}zDeleting %s�__pycache__z#(?P<name>.+)\.(?P<magic>[^.]+)\.pyc�name�.pyczRenaming file from [z] to [�])rrg�walk_eggr:rrrNr�debugr��re�match�pardir�group�remove�OSError�rename)
rBr r!r"r�r�path_old�pattern�m�path_news
          rr�zbdist_egg.zap_pyfiles�s	�����>�?�!)�$�.�.�!9�	2��D�$���
2���w�w�|�|�D�$�/���=�=��'��I�I�m�T�2��I�I�d�O��=�=��/�#�H�D�G�����$�/�A�!�w�w�|�|�D�"�)�)�Q�W�W�V�_�v�=U�V�H��H�H�(�H�U�V���	�	�(�+��I�I�h��1�%
2�	2��"#����s�E�	E�Ec��t|jdd�}|�|Stjd�t	|j
|j�S)Nr�z4zip_safe flag not set; analyzing archive contents...)r�rRrr��analyze_eggr:r�)rB�safes  rr�zbdist_egg.zip_safesC���t�(�(�*�d�;�����K����G�H��4�>�>�4�:�:�6�6rc��y)Nr%rrAs rr�zbdist_egg.gen_header
s��rc��tjj|j�}tjj	|d�}|j
jjD]]}|j|�s�tjj	||t|�d�}t|�|j||��_y)z*Copy metadata (egg info) to the target_dir�N)rr�normpathrErNrL�filelistr"rdrbr
�	copy_file)rB�
target_dir�
norm_egg_info�prefixr�targets      rr�zbdist_egg.copy_metadata_tos������(�(����7�
������m�R�0���K�K�(�(�.�.�	-�D����v�&������j�$�s�6�{�}�2E�F�� ��(����t�V�,�		-rc�|�g}g}|jdi}t|j�D]�\}}}|D]P}tjj	|�dj�tvs�:|j|||z��R|D].}|||zdz|tjj||�<�0��|jj�r�|jd�}|jD]�}	t|	t�r�|j|	j �}
|j#|
�}tjj%|�j'd�r�otjj)tjj|j|��s��|j|���||fS)zAGet a list of relative paths to C extensions in the output distror�rXr~�	build_extzdl-)r:r#rrr�lower�NATIVE_EXTENSIONSrfrNrRrSrK�
extensionsr`r�get_ext_fullnamer��get_ext_filenamerTrdr�)rBr�r��pathsr r!r"r�	build_cmdr��fullnames           rr�zbdist_egg.get_ext_outputss�����������$��!,�T�^�^�!<�	S��D�$��!�
?���7�7�#�#�H�-�a�0�6�6�8�<M�M��&�&�u�T�{�X�'=�>�
?�!�
S��6;�D�k�H�6L�s�6R��b�g�g�l�l�4��2�3�
S�		S����,�,�.��2�2�;�?�I� �+�+�
5���c�7�+��$�5�5�c�h�h�?��$�5�5�h�?���w�w�'�'��1�<�<�U�C��w�w�~�~�b�g�g�l�l�4�>�>�8�&L�M�#�*�*�8�4�
5��K�'�'rN)�__name__�
__module__�__qualname__�description�user_options�boolean_optionsrCrUrmrorhr�r�r�r�r�r�rrrr1r1=sP��2�K��L�&J�O�)�M�0/�2!��Q
�f2�.7��
-�(rr1z.dll .so .dylib .pydc#�K�t|�}t|�\}}}d|vr|jd�|||f��|D]}|���y�w)z@Walk an unpacked egg's contents, skipping the metadata directoryrN)r#�nextr�)�egg_dir�walkerr r!r"�bdfs      rr�r�;sU����
��
!�F��V���D�$���T�����J��
��e�
������	��s�AAc���tj�D]G\}}tjj	tjj|d|��s�E|cSt
�syd}t|�D]e\}}}|D]Z}|jd�s|jd�r�&|jd�s|jd�s�It||||�xr|}�\�g|S)NrFTr}z.pywr�z.pyo)
�safety_flags�itemsrrr�rN�can_scanr�r�scan_module)	r�r��flag�fnr�r r!r"r�s	         rr�r�Fs��� �&�&�(����b�
�7�7�>�>�"�'�'�,�,�w�
�B�?�@��K���:���D�%�g�.�H���d�E��	H�D��}�}�U�#�t�}�}�V�'<�����v�&�$�-�-��*?�"�7�D�$��>�G�4��	H�H��Krc��tj�D]�\}}tjj	||�}tjj|�r'|�t
|�|k7s�Vtj|��l|��ot
|�|k(s�~t|d�}|jd�|j���y)Nr�r�)r�r�rrrNr��boolr�r)r*r�)r�r�r�r�r.s     rr�r�Xs��� �&�&�(����b�
�W�W�\�\�'�2�
&��
�7�7�>�>�"���|�t�D�z�T�1��	�	�"�
�
�
�$�t�*��"4��R���A�
�G�G�D�M�
�G�G�I�rzzip-safeznot-zip-safe)TFc��tjj||�}|dd|vry|t|�dzdj	tj
d�}||xrdxsdztjj
|�dz}tjdkrd	}nd
}t|d�}|j|�tj|�}	|j�d}
tjt!|	��}dD] }||vs�t#j$d
||�d}
�"d|vr%dD] }||vs�t#j$d||�d}
�"|
S)z;Check whether module possibly uses unsafe-for-zipfile stuffN���TrXrr�r)�����rb)�__file__�__path__z%s: module references %sF�inspect)�	getsource�
getabsfile�
getsourcefile�getfilegetsourcelines�
findsource�getcomments�getframeinfo�getinnerframes�getouterframes�stack�tracez"%s: module MAY be using inspect.%s)rrrNrbr�rer�sys�version_infor)�read�marshal�loadr��dict�fromkeys�iter_symbolsrr�)
r�r r�r�r�pkgr�skipr.�coder��symbols�bads
             rr�r�ksF���w�w�|�|�D�$�'�H����}����
�s�7�|�a��!�
"�
*�
*�2�6�6�3�
7�C�
�C�K�C�%�2�
&����)9�)9�$�)?��)B�
B�F�
���&� ������X�t��A��F�F�4�L��<�<��?�D��G�G�I��D��m�m�L��.�/�G�'����'�>��H�H�/���=��D���G��
�	�C��g�~����=�v�s�K���	� �Krc#��K�|jD]}|���|jD]<}t|t�r|���t|t�s�)t|�D]}|����>y�w)zBYield names and strings used by `code` and its nested code objectsN)�co_names�	co_constsr`�strrr)rr��consts   rrr�sc�����
�
����
��������e�S�!��K�
��x�
(�$�U�+�
���
�
�	�s�A
A$�
A$c��tjjd�stjdk7rytjd�tjd�y)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�rJrdrr�rrrr�r��sA���<�<�"�"�6�*�s�|�|�u�/D���H�H�
@�A��H�H�	D�r)r\r�rY�install_basec����ddl}ttjj	|����tjd|����fd�}|r|jn|j}�sD|j|||��}	t��D]\}
}}||	|
|��|	j�|St��D]\}
}}|d|
|��|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 itc�D��|D]�}tjjtjj||��}tjj	|�s�`|t��dzd}�s|j
||�tjd|���y)NrXzadding '%s')	rrr�rNr�rbr*rr�)�zrx�namesr�rr3�base_dirrqs      ��r�visitzmake_zipfile.<locals>.visit�sz����	,�D��7�7�#�#�B�G�G�L�L��$�$?�@�D��w�w�~�~�d�#���X���*�,�-����G�G�D�!�$��	�	�-��+�
	,r)�compression)�zipfilerrrrxrrg�ZIP_DEFLATED�
ZIP_STORED�ZipFiler#r�)
�zip_filenamerr�rq�compressr�rrrrrxr!r"s
 ` `         rr�r��s�����
�2�7�7�?�?�<�(�'�:��H�H�
2�L�(�K�,�+3�'�&�&��8J�8J�K���O�O�L�$�K�O�H��$/��$9�	%� �G�T�5��!�W�e�$�	%�	���	���%0��$9�	(� �G�T�5��$���'�	(��r)rrTr%)(�__doc__�distutils.dir_utilrr�	distutilsr�typesrr�rr�r&r��setuptools.extensionr�
setuptoolsr�_pathr
�	sysconfigrrrrr#r/r1r�r�splitr�r�r�r�r�r�rr�rrr�rrr�<module>r&s����3���
�	�	���(��$�2��� �+�$x(��x(�v�M�M�"8�">�">�"@�A����$
�����'�T	��Y��r