Hacked By AnonymousFox

Current Path : /opt/alt/python311/lib64/python3.11/distutils/command/__pycache__/
Upload File :
Current File : //opt/alt/python311/lib64/python3.11/distutils/command/__pycache__/build_py.cpython-311.opt-1.pyc

�

c��f&C���dZddlZddlZddlZddlZddlmZddlTddl	m
Z
mZddlm
Z
Gd�de��ZGd	�d
ee��ZdS)zHdistutils.command.build_py

Implements the Distutils 'build_py' command.�N)�Command)�*)�convert_path�	Mixin2to3)�logc��eZdZdZgd�ZddgZddiZd�Zd�Zd�Z	d	�Z
d
�Zd�Zd�Z
d
�Zd�Zd�Zd�Zd�Zd�Zd�Zdd�Zd�Zd�Zd�Zd�ZdS)�build_pyz5"build" pure Python modules (copy to build directory)))z
build-lib=�dzdirectory to "build" (copy) to)�compile�czcompile .py to .pyc)�
no-compileNz!don't compile .py files [default])z	optimize=�Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])�force�fz2forcibly build everything (ignore file timestamps)rrr
c�v�d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr)�	build_lib�
py_modules�package�package_data�package_dirr�optimizer��selfs �A/opt/alt/python311/lib64/python3.11/distutils/command/build_py.py�initialize_optionszbuild_py.initialize_options s@����������� �����������
���
�
�
�c��|�ddd��|jj|_|jj|_|jj|_i|_|jjr;|jj���D]\}}t|��|j|<�|���|_	t|jt��s@	t|j��|_dS#ttf$rtd���wxYwdS)N�build)rr)rrzoptimize must be 0, 1, or 2)�set_undefined_options�distribution�packagesrrr�itemsr�get_data_files�
data_files�
isinstancer�int�
ValueError�AssertionError�DistutilsOptionError)r�name�paths   r�finalize_optionszbuild_py.finalize_options*s#���"�"�7�#=�#5�	7�	7�	7��)�2��
��+�6��� �-�:��������(�	<�"�/�;�A�A�C�C�
<�
<�
��d�)5�d�);�);�� ��&�&��-�-�/�/����$�-��-�-�	J�
J� #�D�M� 2� 2��
�
�
����/�
J�
J�
J�*�+H�I�I�I�
J����		J�	Js�
C(�(!D	c���|jr|���|jr(|���|���|�|�d�����dS�Nr)�include_bytecode)r�
build_modulesr!�build_packages�build_package_data�byte_compile�get_outputsrs r�runzbuild_py.runCsy��,�?�	!���� � � ��=�	&����!�!�!��#�#�%�%�%����$�*�*�A�*�>�>�?�?�?�?�?rc�\��g}|js|S|jD]�}|�|��}tjj|jg|�d��z�}d�|rt|��dz��fd�|�||��D��}|�	||||f����|S)z?Generate list of '(package,src_dir,build_dir,filenames)' tuples�.r�c�$��g|]}|�d���
S�N�)�.0�file�plens  �r�
<listcomp>z+build_py.get_data_files.<locals>.<listcomp>ss.������ $��T�U�U����r)
r!�get_package_dir�osr+�joinr�split�len�find_data_files�append)r�datar�src_dir�	build_dir�	filenamesr>s      @rr#zbuild_py.get_data_filesas�������}�	��K��}�	B�	B�G��*�*�7�3�3�G������'7�'�-�-��:L�:L�'L�N�I��D��
&��7�|�|�A�~������(,�(<�(<�W�g�(N�(N����I�
�K�K��'�9�i�@�A�A�A�A��rc	�h��|j�dg��|j�|g��z}g�|D]t}tjtj�tj|��t|������}���fd�|D�����u�S)z6Return filenames for package's data files in 'src_dir'�c�Z��g|]'}|�v�tj�|���%|��(Sr;)rAr+�isfile)r<�fn�filess  �rr?z,build_py.find_data_files.<locals>.<listcomp>�s;���(�(�(��2�U�?�?��G�N�N�2�&�&�4C�"�?�?�?r)	r�get�globrAr+rB�escaper�extend)rrrH�globs�pattern�filelistrPs      @rrEzbuild_py.find_data_filesys�����"�&�&�r�2�.�.��$�(�(��"�5�5�6�����	)�	)�G��y�����d�k�'�.B�.B�L�QX�DY�DY�!Z�!Z�[�[�H��L�L�(�(�(�(�x�(�(�(�
)�
)�
)�
)��rc�B�d}|jD]�\}}}}|D]�}tj�||��}|�tj�|����|�tj�||��|d�������dS)z$Copy data files into build directoryNF��
preserve_mode)r$rAr+rB�mkpath�dirname�	copy_file)r�lastdirrrHrIrJ�filename�targets        rr2zbuild_py.build_package_data�s�����6:�o�	4�	4�2�G�W�i��%�
4�
4������i��:�:�����B�G�O�O�F�3�3�4�4�4����r�w�|�|�G�X�>�>��-2��4�4�4�4�
4�	4�	4rc��|�d��}|js|rtjj|�SdSg}|r{	|jd�|��}|�d|��tjj|�S#t$r"|�d|d��|d=YnwxYw|�{|j�d��}|�|�d|��|rtjj|�SdS)z�Return the directory, relative to the top of the source
           distribution, where package 'package' should be found
           (at least according to the 'package_dir' option, if any).r7rLr���)rCrrAr+rB�insert�KeyErrorrQ)rrr+�tail�pdirs     rr@zbuild_py.get_package_dir�s"���}�}�S�!�!����	��
��w�|�T�*�*��r��D��
�/��+�C�H�H�T�N�N�;�D�
�K�K��4�(�(�(��7�<��.�.�� �!�!�!��K�K��4��8�,�,�,��R����!�����
�"�'�+�+�B�/�/���#��K�K��4�(�(�(����7�<��.�.��2s� B�)B.�-B.c��|dkrbtj�|��std|z���tj�|��std|z���|rVtj�|d��}tj�|��r|Stjd|��dS)NrLz%package directory '%s' does not existz>supposed package directory '%s' exists, but is not a directoryz__init__.pyz8package init file '%s' not found (or not a regular file))	rAr+�exists�DistutilsFileError�isdirrBrNr�warn)rrr�init_pys    r�
check_packagezbuild_py.check_package�s���
�"����7�>�>�+�.�.�
M�(�=��K�M�M�M��7�=�=��-�-�
?�(�0�2=�>�?�?�?�
�	?��g�l�l�;�
�>�>�G��w�~�~�g�&�&�
?�����4�6=�?�?�?�
�trc�t�tj�|��stjd||��dSdS)Nz!file %s (for module %s) not foundFT)rAr+rNrrk)r�module�module_files   r�check_modulezbuild_py.check_module�s7���w�~�~�k�*�*�	��H�8�+�v�N�N�N��5��4rc�J�|�||��tjtj�tj|��d����}g}tj�|jj��}|D]�}tj�|��}||kr[tj�	tj�
|����d}|�|||f����|�d|z����|S)Nz*.pyrzexcluding %s)
rmrRrAr+rBrS�abspathr �script_name�splitext�basenamerF�debug_print)	rrr�module_files�modules�setup_scriptr�abs_fros	         r�find_package_moduleszbuild_py.find_package_modules�s������7�K�0�0�0��y�����d�k�+�.F�.F��!O�!O�P�P�����w���t�'8�'D�E�E���	@�	@�A��G�O�O�A�&�&�E���$�$���)�)�"�'�*:�*:�1�*=�*=�>�>�q�A��������3�4�4�4�4�� � ��,�!>�?�?�?�?��rc��i}g}|jD]�}|�d��}d�|dd���}|d}	||\}}n'#t$r|�|��}d}YnwxYw|s7|�||��}	|df||<|	r|�|d|	f��tj�||dz��}
|�	||
��s��|�|||
f����|S)a�Finds individually-specified Python modules, ie. those listed by
        module name in 'self.py_modules'.  Returns a list of tuples (package,
        module_base, filename): 'package' is a tuple of the path through
        package-space to the module; 'module_base' is the bare (no
        packages, no dots) module name, and 'filename' is the path to the
        ".py" file (relative to the distribution root) that implements the
        module.
        r7rrbr8�__init__�.py)
rrCrBrdr@rmrFrAr+rq)rr!ryror+r�module_baser�checkedrlrps           r�find_moduleszbuild_py.find_modules�sN�������o�	@�	@�F��<�<��$�$�D��h�h�t�A�b�D�z�*�*�G��r�(�K�
�)1�'�):�&��g�g���
�
�
�"�2�2�7�;�;������
�����
C��,�,�W�k�B�B��%0�!�$4���!��C��N�N�G�Z��#A�B�B�B�
�'�,�,�{�K�%�4G�H�H�K��$�$�V�[�9�9�
���N�N�G�[�+�>�?�?�?�?��s�	A�!A9�8A9c��g}|jr'|�|�����|jrJ|jD]B}|�|��}|�||��}|�|���C|S)a4Compute the list of all modules that will be built, whether
        they are specified one-module-at-a-time ('self.py_modules') or
        by whole packages ('self.packages').  Return a list of tuples
        (package, module, module_file), just like 'find_modules()' and
        'find_package_modules()' do.)rrTr�r!r@r|)rryrr�ms     r�find_all_moduleszbuild_py.find_all_moduless������?�	0��N�N�4�,�,�.�.�/�/�/��=�	"��=�
"�
"��"�2�2�7�;�;���-�-�g�{�C�C�����q�!�!�!�!��rc�>�d�|���D��S)Nc��g|]
}|d��S)rbr;)r<ros  rr?z-build_py.get_source_files.<locals>.<listcomp>-s��A�A�A�v��r�
�A�A�Ar)r�rs r�get_source_fileszbuild_py.get_source_files,s"��A�A��)>�)>�)@�)@�A�A�A�Arc�\�|gt|��z|dzgz}tjj|�S)Nr)�listrAr+rB)rrIrro�outfile_paths     r�get_module_outfilezbuild_py.get_module_outfile/s/��!�{�T�'�]�]�2�f�u�n�5E�E���w�|�\�*�*rr8c��|���}g}|D]�\}}}|�d��}|�|j||��}|�|��|r|jr4|�tj�|d�����|j	dkr9|�tj�||j	�������|d�|j
D��z
}|S)Nr7rL)�optimizationrc�b�g|],\}}}}|D]"}tj�||����#�-Sr;)rAr+rB)r<rrHrIrJr_s      rr?z(build_py.get_outputs.<locals>.<listcomp>BsW�����6���)�Y�%����
�G�L�L��H�-�-����r)r�rCr�rrFr�	importlib�util�cache_from_sourcerr$)rr/ry�outputsrrorpr_s        rr4zbuild_py.get_outputs3s'���'�'�)�)����.5�
	?�
	?�*�W�f�k��m�m�C�(�(�G��.�.�t�~�w��O�O�H��N�N�8�$�$�$��
?��<�4��N�N�9�>�#C�#C� �r�$D�$3�$3�4�4�4��=�1�$�$��N�N�9�>�#C�#C� �t�}�$D�$>�$>�?�?�?��	���:>�/����	���rc�~�t|t��r|�d��}n+t|ttf��std���|�|j||��}tj	�
|��}|�|��|�||d���S)Nr7z:'package' must be a string (dot-separated), list, or tuplerrY)
r%�strrCr��tuple�	TypeErrorr�rrAr+r\r[r])rrorpr�outfile�dirs      r�build_modulezbuild_py.build_moduleJs����g�s�#�#�	P��m�m�C�(�(�G�G��G�d�E�]�3�3�	P��N�P�P�
P��)�)�$�.�'�6�J�J���g�o�o�g�&�&�����C�����~�~�k�7�!�~�D�D�Drc�n�|���}|D]\}}}|�|||���dSr:)r�r�)rryrrorps     rr0zbuild_py.build_modulesYsP���#�#�%�%��.5�	<�	<�*�W�f�k�

���f�k�7�;�;�;�;�	<�	<rc��|jD]M}|�|��}|�||��}|D]\}}}|�|||����NdSr:)r!r@r|r�)rrrry�package_rorps       rr1zbuild_py.build_packagesbs����}�	@�	@�G��.�.�w�7�7�K��/�/���E�E�G�4;�
@�
@�/��6�;��!�!�&�+�w�?�?�?�?�
@�	@�	@rc�J�tjr|�d��dSddlm}|j}|dtjkr|tjz}|jr||d|j	||j
���|jdkr!|||j|j	||j
���dSdS)Nz%byte-compiling is disabled, skipping.r)r3rb)rr�prefix�dry_run)�sys�dont_write_bytecoderk�distutils.utilr3rrA�seprrr�r)rrPr3r�s    rr3zbuild_py.byte_compilevs����"�	��I�I�=�>�>�>��F�/�/�/�/�/�/�����"�:������b�f�_�F�
�<�	P��L���#�z�&�$�,�
P�
P�
P�
P��=�1����L����#�z�&�$�,�
P�
P�
P�
P�
P�
P��rN)r8)�__name__�
__module__�__qualname__�description�user_options�boolean_options�negative_optrr,r5r#rEr2r@rmrqr|r�r�r�r�r4r�r0r1r3r;rrr	r	sx������K�K�
�
�
�L�!�'�*�O� �9�-�L����J�J�J�2@�@�@�<���0���4�4�4�%�%�%�N���6���
�
�
�2�2�2�h��� B�B�B�+�+�+�����.
E�
E�
E�<�<�<�@�@�@�(P�P�P�P�Prr	c��eZdZd�Zd�ZdS)�
build_py_2to3c�.�g|_|jr|���|jr(|���|���|�|j��|�|�d�����dSr.)	�
updated_filesrr0r!r1r2�run_2to3r3r4rs rr5zbuild_py_2to3.run�s�������?�	!���� � � ��=�	&����!�!�!��#�#�%�%�%�	
�
�
�d�(�)�)�)�	
���$�*�*�A�*�>�>�?�?�?�?�?rc��t�||||��}|dr |j�|d��|S)Nr8r)r	r�r�rF)rrorpr�ress     rr�zbuild_py_2to3.build_module�sG���#�#�D�&�+�w�G�G���q�6�	.���%�%�c�!�f�-�-�-��
rN)r�r�r�r5r�r;rrr�r��s5������@�@�@� ����rr�)�__doc__rA�importlib.utilr�r�rR�distutils.corer�distutils.errorsr�rr�	distutilsrr	r�r;rr�<module>r�s���0�0�
�	�	�	�����
�
�
�
�����"�"�"�"�"�"�����2�2�2�2�2�2�2�2�������yP�yP�yP�yP�yP��yP�yP�yP�v�����H�i�����r

Hacked By AnonymousFox1.0, Coded By AnonymousFox