%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/setuptools/command/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/setuptools/command/__pycache__/build_py.cpython-312.pyc

�


_�d�:���ddlmZddlmZddlmZddlmcmZddl	Z	ddl
Z
ddlZddlZddl
ZddlZddlZddlmZddlmZmZmZmZmZmZddlmZdd	lmZd
�ZGd�dej�Zd
�ZGd�d�Z y)�)�partial)�glob)�convert_pathN)�Path)�Dict�Iterable�Iterator�List�Optional�Tuple�)�unique_everseen)�SetuptoolsDeprecationWarningc��tj|tj|�jtjz�y�N)�os�chmod�stat�st_mode�S_IWRITE)�targets �=/usr/lib/python3/dist-packages/setuptools/command/build_py.py�
make_writablers'���H�H�V�R�W�W�V�_�,�,�t�}�}�<�=�c�:��eZdZUdZdZeed<dZee	ed<d�Z
	d�fd�	Zd�Zd	�Z
d
�Zd�Zd�Zd
�Zd�Zd dee	f�fd�
Zdee	e	ffd�Zdeee	e	ffd�Zdeee	e	ffd�Zd�Zd�Zdee	de	dee	fd�Zd�Zd�Z d�Z!d�Z"d�Z#e$d��Z%�xZ&S)!�build_pyaXEnhanced 'build_py' command that includes data files with packages

    The data files are specified via a 'package_data' argument to 'setup()'.
    See 'setuptools.dist.Distribution' for more details.

    Also, this version of the 'build_py' command allows you to specify both
    'py_modules' and 'packages' in the same setup operation.
    F�
editable_modeN�existing_egg_info_dirc��tjj|�|jj|_|jj
xsi|_d|jvr
|jd=g|_y)N�
data_files)�origr�finalize_options�distribution�package_data�exclude_package_data�__dict__�_build_py__updated_files��selfs rr"zbuild_py.finalize_options$sa���
�
�&�&�t�,� �-�-�:�:���$(�$5�$5�$J�$J�$P�b��!��4�=�=�(��
�
�l�+�!��rc���|rDtt|�j��}tt|�j��}t�|�||||||�Sr)�strr�resolve�super�	copy_file)r)�infile�outfile�
preserve_mode�preserve_times�link�level�	__class__s       �rr.zbuild_py.copy_file,sU������f��-�-�/�0�F��$�w�-�/�/�1�2�G��w� ��G�]�N�D�%�
�	
rc�>�|js|jr|jry|jr|j�|jr |j	�|j�|j
tjj|d���y)z?Build modules, packages, and copy data files to build directoryNr)�include_bytecode)
�
py_modules�packagesr�
build_modules�build_packages�build_package_data�byte_compiler!r�get_outputsr(s r�runzbuild_py.run7sp�����4�=�=�T�5G�5G���?�?���� ��=�=����!��#�#�%�	
���$�-�-�3�3�D�1�3�M�Nrc��|dk(r!|j�|_|jStjj	||�S)zlazily compute data filesr )�_get_data_filesr r!r�__getattr__)r)�attrs  rrBzbuild_py.__getattr__Gs;���<��"�2�2�4�D�O��?�?�"��}�}�(�(��t�4�4rc��tjj||||�\}}|r|jj	|�||fSr)r!r�build_moduler'�append)r)�module�module_file�packager0�copieds      rrEzbuild_py.build_moduleNsB���-�-�4�4�T�6�;�PW�X������ � �'�'��0����rc�|�|j�tt|j|jxsd��S)z?Generate list of '(package,src_dir,build_dir,filenames)' tuples�)�analyze_manifest�list�map�_get_pkg_data_filesr9r(s rrAzbuild_py._get_data_filesTs/�������C��0�0�$�-�-�2E�2�F�G�Grc��|jjdi�tt|j|j
xsd��S)z�
        Generate list of ``(package,src_dir,build_dir,filenames)`` tuples,
        but without triggering any attempt to analyze or build the manifest.
        �manifest_filesrL)r&�
setdefaultrNrOrPr9r(s r�get_data_files_without_manifestz(build_py.get_data_files_without_manifestYs:��	
�
�
� � �!1�2�6��C��0�0�$�-�-�2E�2�F�G�Grc�&�|j|�}tjj|jg|jd�z�}|j
||�D�cgc]"}tjj||���$}}||||fScc}w�N�.)�get_package_dirr�path�join�	build_lib�split�find_data_files�relpath)r)rI�src_dir�	build_dir�file�	filenamess      rrPzbuild_py._get_pkg_data_filescs����&�&�w�/���G�G�L�L�D�N�N�#3�g�m�m�C�6H�#H�J�	�
�,�,�W�g�>�
��
�G�G�O�O�D�'�*�
�	�
����I�5�5��	
s�'Bc�~�|j|j||�}tttd��|�}t
jj|�}ttjj|�}tj|jj|g�|�}|j|||�S)z6Return filenames for package's data files in 'src_dir'T)�	recursive)�_get_platform_patternsr$rOrr�	itertools�chain�
from_iterable�filterrrY�isfilerR�get�exclude_data_files)r)rIr_�patterns�globs_expanded�
globs_matches�
glob_files�filess        rr]zbuild_py.find_data_filesqs����.�.������
��
�W�T�T�:�H�E��!���5�5�n�E�
��B�G�G�N�N�M�:�
�������#�#�G�R�0��
���&�&�w���?�?r�returnc���|jr't|j�j��St�|�|�S)�1See :class:`setuptools.commands.build.SubCommand`)rrN�get_output_mapping�keysr-r>)r)r7r5s  �rr>zbuild_py.get_outputs�s:��������/�/�1�6�6�8�9�9��w�"�#3�4�4rc��tj|j�|j��}t	t|d����S)rtc��|dS)NrrL)�xs r�<lambda>z-build_py.get_output_mapping.<locals>.<lambda>�s
��!�A�$�r)�key)rfrg� _get_package_data_output_mapping�_get_module_mapping�dict�sorted)r)�mappings  rruzbuild_py.get_output_mapping�s<���/�/��1�1�3��$�$�&�
���F�7��7�8�8rc#�K�|j�D]:\}}}|jd�}|j|j||�}||f���<y�w)z5Iterate over all modules producing (dest, src) pairs.rWN)�find_all_modulesr\�get_module_outfiler[)r)rIrGrH�filenames     rr}zbuild_py._get_module_mapping�sV����,0�,A�,A�,C�	*�(�G�V�[��m�m�C�(�G��.�.�t�~�~�w��O�H��[�)�)�	*�s�AAc#��K�|jD]T\}}}}|D]H}tjj||�}tjj||�}||f���J�Vy�w)z6Iterate over package data producing (dest, src) pairs.N)r rrYrZ)r)rIr_r`rbr�r�srcfiles        rr|z)build_py._get_package_data_output_mapping�sd����6:�o�o�	(�2�G�W�i��%�
(�������i��:���'�'�,�,�w��9���w�'�'�
(�	(�s�A%A'c���|j�D]S\}}|jtjj	|��|j||�\}}t
|��Uy)z$Copy data files into build directoryN)r|�mkpathrrY�dirnamer.r)r)rr��_outf�_copieds     rr<zbuild_py.build_package_data�sS��#�D�D�F�	"�O�F�G��K�K�������/�0�!�^�^�G�V�<�N�E�7��&�!�	"rc�.�ix|_}|jjsyi}|jxsdD]}||t	|j|��<�!t
|dd�r]t|jd�j�r9|j}t|d�}|jd��j�}nD|jd�|jd�}|j}|jj }t#�}|j%||�D]�}	t&j(j+t	|	��\}
}d}|}
|
rY|
|k7rT|
|vrP|
}t&j(j+|
�\}
}t&j(j-||�}|
r
|
|k7r|
|vr�P|
|vs��||
k(r|j/|�r)��|j1||
|�}|r|j3|�|j5||
g�j7|	���y)NrLrzSOURCES.txtzutf-8)�encoding�egg_info)rRr#�include_package_datar9�assert_relativerX�getattrrr�exists�	read_text�
splitlines�run_command�get_finalized_commandr��filelistrq�_IncludePackageDataAbuse�_filter_build_filesrrYr\rZ�	is_module�importable_subpackage�warnrSrF)r)�mf�src_dirsrI�egg_info_dir�manifestrq�ei_cmd�checkrY�d�f�prev�oldf�df�
importables                rrMzbuild_py.analyze_manifest�s���#%�%���b�� � �5�5�����}�}�*��	O�G�GN�H�_�T�%9�%9�'�%B�C�D�	O�

�D�1�4�8��T�/�/��?�F�F�H��5�5�L��L�-�8�H��&�&��&�8�C�C�E�E����Z�(��/�/�
�;�F�!�?�?�L��O�O�)�)�E�(�*���,�,�U�L�A�	<�D��7�7�=�=���!6�7�D�A�q��D��D���T�	�a�x�&7������
�
�a�(���2��G�G�L�L��Q�'����T�	�a�x�&7��H�}���9����q�)� �!&�!<�!<�X�a�[�!�!L�J�!��
�
�:�.��
�
�h�q�k�2�.�5�5�d�;�!	<rrqr�c#��K�|jd�}||j|j|jf}|D�cgc]$}|s�tj
j
|���&}}|D]Y}tj
j
|��tj
j|�rt�fd�|D��s�V|���[ycc}w�w)a}
        ``build_meta`` may try to create egg_info outside of the project directory,
        and this can be problematic for certain plugins (reported in issue #3500).

        Extensions might also include between their sources files created on the
        ``build_lib`` and ``build_temp`` directories.

        This function should filter this case of invalid files out.
        �buildc3�&�K�|]}|�v���
y�wrrL)�.0r��	norm_paths  �r�	<genexpr>z/build_py._filter_build_files.<locals>.<genexpr>�s�����-T�Q�a�y�.@�-T�s�N)	r�r[�
build_temp�
build_baserrY�normpath�isabs�all)	r)rqr�r��
build_dirs�p�	norm_dirsrar�s	        @rr�zbuild_py._filter_build_files�s�������*�*�7�3�������0@�0@�%�BR�BR�S�
�2<�B�Q��R�W�W�%�%�a�(�B�	�B��	�D����(�(��.�I��7�7�=�=��&�#�-T�)�-T�*T��
�	��C�s�:C�C�!C�&AC�Cc��yrrLr(s r�get_data_fileszbuild_py.get_data_files�s��rc��	|j|S#t$rYnwxYwtjj	|||�}||j|<|r|j
js|S|j
jD]}||k(s|j|dz�s�n|Stj|d�5}|j�}ddd�n#1swYnxYwdvr#tjjd|�d���|S)z8Check namespace packages' __init__ for declare_namespacerW�rbNsdeclare_namespacezNamespace package problem: z� is a namespace package, but its
__init__.py does not call declare_namespace()! Please fix it.
(See the setuptools manual under "Namespace Packages" for details.)
")�packages_checked�KeyErrorr!r�
check_packager#�namespace_packages�
startswith�io�open�read�	distutils�errors�DistutilsError)r)rI�package_dir�init_py�pkgr��contentss       rr�zbuild_py.check_package�s	��	��(�(��1�1���	��	���-�-�-�-�d�G�[�I��)0����g�&��d�/�/�B�B��N��$�$�7�7�	�C��g�~�����#�
�!>��	��N�
�W�W�W�d�
#�	 �q��v�v�x�H�	 �	 �	 ���x�/��"�"�1�1�<C�E��
��s��	��8C�Cc�l�i|_tjj|�d|_d|_y)NF)r�r!r�initialize_optionsrrr(s rr�zbuild_py.initialize_optionss,�� "����
�
�(�(��.�"���%)��"rc���tjj||�}|jj�4t
jj|jj|�S|Sr)r!rrXr#�src_rootrrYrZ)r)rI�ress   rrXzbuild_py.get_package_dir	sP���m�m�+�+�D�'�:�����%�%�1��7�7�<�<�� 1� 1� :� :�C�@�@��
rc����t���|j|j||�}�fd�|D�}tjj|�}t
|���fd��D�}tt|��S)z6Filter filenames for package's data files in 'src_dir'c3�J�K�|]}tj�|����y�wr)�fnmatchri)r��patternrqs  �rr�z.build_py.exclude_data_files.<locals>.<genexpr>s�����O�7����u�g�6�O�s� #c3�,�K�|]}|�vs�|���
y�wrrL)r��fn�bads  �rr�z.build_py.exclude_data_files.<locals>.<genexpr>s�����7�"��3��2�7�s�	�)rNrer%rfrgrh�setr)	r)rIr_rqrm�match_groups�matches�keepersr�s	   `    @rrlzbuild_py.exclude_data_filesso����U����.�.��%�%���
��
P�h�O���/�/�/�/��=���'�l��7��7���O�G�,�-�-rc���tj|jdg�|j|g��}�fd�|D�S)z�
        yield platform-specific path patterns (suitable for glob
        or fn_match) from a glob-based spec (such as
        self.package_data or self.exclude_package_data)
        matching package in src_dir.
        �c3�p�K�|]-}tjj�t|�����/y�wr)rrYrZr)r�r�r_s  �rr�z2build_py._get_platform_patterns.<locals>.<genexpr>+s/�����
��
�G�G�L�L��,�w�"7�8�
�s�36)rfrgrk)�specrIr_�raw_patternss  ` rrezbuild_py._get_platform_patternssC���!����H�H�R����H�H�W�b�!�
��
�(�
�	
r)�r�Nr�)r�)'�__name__�
__module__�__qualname__�__doc__r�bool�__annotations__rrr+r"r.r?rBrErArTrPr]r
r>rrur	rr}r|r<rMrr�r�r�r�rXrl�staticmethodre�
__classcell__)r5s@rrrs���� �M�4��+/��8�C�=�/�"�TU�	
�O� 5��H�
H�6�@�"5��c��5�9�D��c��N�9�*�X�e�C��H�o�%>�*�(�(�5��c��?�2K�(�"�'<�R��#���#��(�SV�-��&
��<*��.� �
��
rrc��tjj|�s|Sddlm}tjd�j�|z}||��)Nr)�DistutilsSetupErrorz�
        Error: setup script specifies an absolute path:

            %s

        setup() arguments must *always* be /-separated paths relative to the
        setup.py directory, *never* absolute paths.
        )rrYr��distutils.errorsr��textwrap�dedent�lstrip)rYr��msgs   rr�r�2sP��
�7�7�=�=�����4�	���
�		
��&�(�
�
	���c�
"�"rc�>�eZdZdZGd�de�Zd�Zd�Zd�Zd�Z	y)	r�z>Inform users that package or module is included as 'data file'c��eZdZdZdZy)�!_IncludePackageDataAbuse._WarningzU
        Package {importable!r} is absent from the `packages` configuration.
        a|
        ############################
        # Package would be ignored #
        ############################
        Python recognizes {importable!r} as an importable package[^1],
        but it is absent from setuptools' `packages` configuration.

        This leads to an ambiguous overall configuration. If you want to distribute this
        package, please make sure that {importable!r} is explicitly added
        to the `packages` configuration field.

        Alternatively, you can also rely on setuptools' discovery methods
        (for example by using `find_namespace_packages(...)`/`find_namespace:`
        instead of `find_packages(...)`/`find:`).

        You can read more about "package discovery" on setuptools documentation page:

        - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

        If you don't want {importable!r} to be distributed and are
        already explicitly excluding {importable!r} via
        `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
        you can try to use `exclude_package_data`, or `include-package-data=False` in
        combination with a more fine grained `package-data` configuration.

        You can read more about "package data files" on setuptools documentation page:

        - https://setuptools.pypa.io/en/latest/userguide/datafiles.html


        [^1]: For Python, any directory (with suitable naming) can be imported,
              even if it does not contain any `.py` files.
              On the other hand, currently there is no concept of package data
              directory, all directories are treated like packages.
        N)r�r�r��_SUMMARY�_DETAILSrLrr�_Warningr�Js����"�rr�c�"�t�|_yr)r��_already_warnedr(s r�__init__z!_IncludePackageDataAbuse.__init__us��"�u��rc�b�|jd�xr|dtd�j�S)Nz.py)�endswith�len�isidentifier)r)ras  rr�z"_IncludePackageDataAbuse.is_modulexs,���}�}�U�#�J��]��E�
�{�(;�(H�(H�(J�Jrc���t|�j}ttjt
j|j��}|rdj|g|��SyrV)	r�parentrNrf�	takewhiler+r��partsrZ)r)r�rar�r�s     rr�z._IncludePackageDataAbuse.importable_subpackage{sO���4�j�����Y�(�(��)9�)9�3�9�9�E�F����8�8�V�,�e�,�-�-�rc��||jvr8|jj|��|jj|�yy)N)r�)r�r��emit�add)r)r�s  rr�z_IncludePackageDataAbuse.warn�s>���T�1�1�1��M�M���*��5�� � �$�$�Z�0�2rN)
r�r�r�r�rr�r�r�r�r�rLrrr�r�Gs(��H�'�/�'�V%�K��1rr�)!�	functoolsrr�distutils.utilr�distutils.command.build_py�commandrr!rr�r�r�r�r�rfr�pathlibr�typingrrr	r
rr�extern.more_itertoolsr�warningsrrr�r�rLrr�<module>rs_����'�)�)�	���	�����B�B�3�3�>�X
�t�}�}�X
�v#�*>1�>1r

Zerion Mini Shell 1.0