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

��h�<�@s�ddlmZddlZddlZddlZddlZddlZddlmZm	Z	ddl
mZddlmZddl
mZddlmZdd	lmZmZdd
lmZddlmZddlmmZddlZddlmZd
Z ddd�Z!Gdd�dej�Zdd�Z"Gdd�d�Z#dS)�)�annotationsN)�Iterable�Iterator)�partial)�glob)�Path)�unique_everseen�)�StrPath�StrPathT)�Distribution)�SetuptoolsDeprecationWarning)�convert_path)z*.pyizpy.typed�return�NonecCst�|t�|�jtjB�dS�N)�os�chmod�stat�st_mode�S_IWRITE)�target�r�F/usr/local/lib/python3.10/dist-packages/setuptools/command/build_py.py�
make_writablesrcseZdZUdZded<dZded<dZded	<d
d�Z				
dNdO�fdd�
ZdPdd�Z	dQd!d"�Z
d#d$�Zd%d&�Zd'd(�Z
d)d*�ZdRdS�fd-d.�
ZdTd0d1�ZdUd3d4�ZdUd5d6�ZdPd7d8�ZdPd9d:�ZdVd?d@�ZdPdAdB�ZdCdD�ZdEdF�ZdGdH�ZdIdJ�ZedWdLdM��Z�ZS)X�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.
    r�distributionF�bool�
editable_modeNzStrPath | None�existing_egg_info_dircCs>tj�|�|jj|_|jjpi|_d|jvr|jd=dSdS)N�
data_files)�origr�finalize_optionsr�package_data�exclude_package_data�__dict__��selfrrrr",s

�zbuild_py.finalize_optionsT��infiler
�outfiler�
preserve_mode�preserve_times�link�
str | None�level�objectr�tuple[StrPathT | str, bool]cs:|rtt|����}tt|����}t��||||||�Sr)�strr�resolve�super�	copy_file)r'r)r*r+r,r-r/��	__class__rrr53s
�zbuild_py.copy_filercCsT|js|jr	|jrdS|jr|��|jr|��|��|�tjj	|dd��dS)z?Build modules, packages, and copy data files to build directoryNF)�include_bytecode)
�
py_modules�packagesr�
build_modules�build_packages�build_package_data�byte_compiler!r�get_outputsr&rrr�runDszbuild_py.run�attrr2cCs&|dkr|��|_|jStj�||�S)zlazily compute data filesr )�_get_data_filesr r!r�__getattr__)r'rArrrrCTs
zbuild_py.__getattr__cCs|��tt|j|jpd��S)z?Generate list of '(package,src_dir,build_dir,filenames)' tuplesr)�analyze_manifest�list�map�_get_pkg_data_filesr:r&rrrrB[szbuild_py._get_data_filescCs$|j�di�tt|j|jpd��S)z�
        Generate list of ``(package,src_dir,build_dir,filenames)`` tuples,
        but without triggering any attempt to analyze or build the manifest.
        �manifest_filesr)r%�
setdefaultrErFrGr:r&rrr�get_data_files_without_manifest`sz(build_py.get_data_files_without_manifestcsJ|�|��tjj|jg|�d��}�fdd�|�|��D�}|�||fS)N�.csg|]	}tj�|���qSr)r�path�relpath)�.0�file��src_dirrr�
<listcomp>rs��z0build_py._get_pkg_data_files.<locals>.<listcomp>)�get_package_dirrrL�join�	build_lib�split�find_data_files)r'�package�	build_dir�	filenamesrrPrrGjs


�zbuild_py._get_pkg_data_filescCsd|j|j||td�}tttdd�|�}tj�|�}t	t
jj|�}t�|j
�|g�|�}|�|||�S)z6Return filenames for package's data files in 'src_dir')�extra_patternsT)�	recursive)�_get_platform_patternsr#�_IMPLICIT_DATA_FILESrFrr�	itertools�chain�
from_iterable�filterrrL�isfilerH�get�exclude_data_files)r'rXrQ�patterns�globs_expanded�
globs_matches�
glob_files�filesrrrrWxs��zbuild_py.find_data_filesr8�	list[str]cs"|jrt|�����St��|�S)�1See :class:`setuptools.commands.build.SubCommand`)rrE�get_output_mapping�keysr4r?)r'r8r6rrr?�szbuild_py.get_outputs�dict[str, str]cCs(t�|��|���}tt|dd�d��S)rlcSs|dS)Nrr)�xrrr�<lambda>�sz-build_py.get_output_mapping.<locals>.<lambda>)�key)r_r`� _get_package_data_output_mapping�_get_module_mapping�dict�sorted)r'�mappingrrrrm�s
�zbuild_py.get_output_mapping�Iterator[tuple[str, str]]ccs>�|��D]\}}}|�d�}|�|j||�}||fVqdS)z5Iterate over all modules producing (dest, src) pairs.rKN)�find_all_modulesrV�get_module_outfilerU)r'rX�module�module_file�filenamerrrrt�s�
�zbuild_py._get_module_mappingccsJ�|jD]\}}}}|D]}tj�||�}tj�||�}||fVqqdS)z6Iterate over package data producing (dest, src) pairs.N)r rrLrT)r'rXrQrYrZr}r�srcfilerrrrs�s���z)build_py._get_package_data_output_mappingcCs@|��D]\}}|�tj�|��|�||�\}}t|�qdS)z$Copy data files into build directoryN)rs�mkpathrrL�dirnamer5r)r'rr~�_outf�_copiedrrrr=�s

�zbuild_py.build_package_datacCshi|_|jjs	dSi}|jpdD]}||t|�|��<q|jr8t|jd���r8|j}t|d�}|j	dd��
�}n|�d�|�d�}|j
}|jj}t�}|�||�D]_}tj�t|��\}	}
d}|
}|	r�|	|kr�|	|vr�|	}tj�|	�\}	}
tj�|
|
�}
|	r�|	|kr�|	|vsl|	|vr�|
|kr�|�|
�r�qRn|�||	|
�}|r�|�|�|j�||	g��|�qRdS)NrzSOURCES.txtzutf-8)�encoding�egg_info)rHr�include_package_datar:�assert_relativerSrr�exists�	read_text�
splitlines�run_command�get_finalized_commandr��filelistrj�_IncludePackageDataAbuse�_filter_build_filesrrLrVrT�	is_module�importable_subpackage�warnrI�append)r'�src_dirsrX�egg_info_dir�manifestrj�ei_cmd�checkrL�d�f�prev�oldf�df�
importablerrrrD�sL��


�
�
��zbuild_py.analyze_manifestrj�
Iterable[str]r��
Iterator[str]c#sn�|�d�}||j|j|jf}dd�|D�}|D]}tj�|��tj�|�r1t�fdd�|D��r4|VqdS)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.
        �buildcSsg|]
}|rtj�|��qSr)rrL�normpath)rN�prrrrR�sz0build_py._filter_build_files.<locals>.<listcomp>c3s�|]}|�vVqdSrr)rNr���	norm_pathrr�	<genexpr>�s�z/build_py._filter_build_files.<locals>.<genexpr>N)	r�rU�
build_temp�
build_baserrLr��isabs�all)r'rjr�r��
build_dirs�	norm_dirsrOrr�rr��s�
"��zbuild_py._filter_build_filescCsdSrrr&rrr�get_data_files�szbuild_py.get_data_filescCs�z|j|WStyYnwtj�|||�}||j|<|r#|jjs%|S|jjD]}||ks6|�|d�r8nq)|St|d��}|�	�}Wd�n1sOwYd|vrbt
j�d|�d���|S)z8Check namespace packages' __init__ for declare_namespacerK�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�open�read�	distutils�errors�DistutilsError)r'rX�package_dir�init_py�pkgr��contentsrrrr��s,�
�
�
�zbuild_py.check_packagecCs"i|_tj�|�d|_d|_dS)NF)r�r!r�initialize_optionsrrr&rrrr�
s
zbuild_py.initialize_optionscCs0tj�||�}|jjdurtj�|jj|�S|Sr)r!rrSr�src_rootrrLrT)r'rX�resrrrrSszbuild_py.get_package_dircs\t���|�|j||�}�fdd�|D�}tj�|�}t|���fdd��D�}tt|��S)z6Filter filenames for package's data files in 'src_dir'c3s�|]	}t��|�VqdSr)�fnmatchrb�rN�pattern)rjrrr�!��z.build_py.exclude_data_files.<locals>.<genexpr>c3s�|]	}|�vr|VqdSrr)rN�fn)�badrrr�%r�)rEr]r$r_r`ra�setr)r'rXrQrjrf�match_groups�matches�keepersr)r�rjrres�zbuild_py.exclude_data_filesrcs0t�||�dg�|�|g��}�fdd�|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.
        �c3s"�|]}tj��t|��VqdSr)rrLrTrr�rPrrr�6s
��
�z2build_py._get_platform_patterns.<locals>.<genexpr>)r_r`rd)�specrXrQr[�raw_patternsrrPrr])s

�
�zbuild_py._get_platform_patterns)TTNr()r)r
r*rr+rr,rr-r.r/r0rr1�rr)rAr2)T)r8rrrk)rro)rrx)rjr�r�r
rr�)r)�__name__�
__module__�__qualname__�__doc__�__annotations__rrr"r5r@rCrBrJrGrWr?rmrtrsr=rDr�r�r�r�rSre�staticmethodr]�
__classcell__rrr6rrs>
	�








)
rcCs6tj�|�s|Sddlm}t�d���|}||��)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.
        )rrLr��distutils.errorsr��textwrap�dedent�lstrip)rLr��msgrrrr�=s�	��
r�c@s@eZdZdZGdd�de�Zdd�Zdd�Zdd	�Zd
d�Z	dS)
r�z>Inform users that package or module is included as 'data file'c@seZdZdZdZdS)z!_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�_DETAILSrrrr�_WarningUsr�cCst�|_dSr)r��_already_warnedr&rrr�__init__�sz!_IncludePackageDataAbuse.__init__cCs |�d�o|dtd����S)Nz.py)�endswith�len�isidentifier)r'rOrrrr��s z"_IncludePackageDataAbuse.is_modulecCs6t|�j}tt�tj|j��}|rd�|g|��SdS)NrK)	r�parentrEr_�	takewhiler2r��partsrT)r'r�rOr�r�rrrr��s

z._IncludePackageDataAbuse.importable_subpackagecCs,||jvr|jj|d�|j�|�dSdS)N)r�)r�r��emit�add)r'r�rrrr��s
�z_IncludePackageDataAbuse.warnN)
r�r�r�r�r
r�r�r�r�r�rrrrr�Rs+r�r�)$�
__future__rr�r_rrr��collections.abcrr�	functoolsrr�pathlibr�more_itertoolsr�_pathr
r�distr�warningsr
�distutils.command.build_py�commandrr!r�r��distutils.utilrr^rr�r�rrrr�<module>s0
!