HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/site-packages/setuptools/command/__pycache__/build_py.cpython-310.pyc
o

��i#7�@s�ddlmZddlmZddlmZddlmmZddl	Z	ddl
Z
ddlZddlZddl
ZddlZddlZddlZddlmZddlmZmZmZmZmZmZddlmZddlmZd	d
�ZGdd�dej�Zd
d�Z Gdd�d�Z!dS)�)�partial)�glob)�convert_pathN)�Path)�Dict�Iterable�Iterator�List�Optional�Tuple)�SetuptoolsDeprecationWarning)�unique_everseencCst�|t�|�jtjB�dS�N)�os�chmod�stat�st_mode�S_IWRITE)�target�r�F/usr/local/lib/python3.10/site-packages/setuptools/command/build_py.py�
make_writablesrcsHeZdZUdZdZeed<dZee	ed<dd�Z
		d6�fd	d
�	Zdd�Zd
d�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd7dee	f�fdd�
Zdee	e	ffdd�Zdeee	e	ffdd�Zdeee	e	ffd d!�Zd"d#�Zd$d%�Zd&ee	d'e	dee	fd(d)�Zd*d+�Zd,d-�Z d.d/�Z!d0d1�Z"d2d3�Z#e$d4d5��Z%�Z&S)8�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_dircCs@tj�|�|jj|_|jjpi|_d|jvr|jd=g|_dS)N�
data_files)�origr�finalize_options�distribution�package_data�exclude_package_data�__dict__�_build_py__updated_files��selfrrrr$s


zbuild_py.finalize_options�cs:|rtt|����}tt|����}t��||||||�Sr)�strr�resolve�super�	copy_file)r$�infile�outfileZ
preserve_modeZpreserve_times�link�level��	__class__rrr),s�zbuild_py.copy_filecCsT|js|jr	|jrdS|jr|��|jr|��|��|�tjj	|dd��dS)z?Build modules, packages, and copy data files to build directoryNr)�include_bytecode)
Z
py_modules�packagesrZ
build_modulesZbuild_packages�build_package_data�byte_compilerr�get_outputsr#rrr�run5szbuild_py.runcCs&|dkr|��|_|jStj�||�S)zlazily compute data filesr)�_get_data_filesrrr�__getattr__)r$�attrrrrr7Es
zbuild_py.__getattr__cCs.tj�||||�\}}|r|j�|�||fSr)rr�build_moduler"�append)r$�module�module_file�packager+Zcopiedrrrr9Lszbuild_py.build_modulecCs|��tt|j|jpd��S)z?Generate list of '(package,src_dir,build_dir,filenames)' tuplesr)�analyze_manifest�list�map�_get_pkg_data_filesr1r#rrrr6Rszbuild_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!�
setdefaultr?r@rAr1r#rrr�get_data_files_without_manifestWsz(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>is��z0build_py._get_pkg_data_files.<locals>.<listcomp>)�get_package_dirrrF�join�	build_lib�split�find_data_files)r$r=�	build_dir�	filenamesrrJrrAas


�zbuild_py._get_pkg_data_filescCs`|�|j||�}tttdd�|�}tj�|�}tt	j
j|�}t�|j�
|g�|�}|�|||�S)z6Return filenames for package's data files in 'src_dir'T)�	recursive)�_get_platform_patternsrr@rr�	itertools�chain�
from_iterable�filterrrF�isfilerB�get�exclude_data_files)r$r=rK�patternsZglobs_expandedZ
globs_matchesZ
glob_files�filesrrrrQos��zbuild_py.find_data_files�returncs"|jrt|�����St��|�S)�1See :class:`setuptools.commands.build.SubCommand`)rr?�get_output_mapping�keysr(r4)r$r0r.rrr4�szbuild_py.get_outputscCs(t�|��|���}tt|dd�d��S)r`cSs|dS)Nrr)�xrrr�<lambda>�sz-build_py.get_output_mapping.<locals>.<lambda>)�key)rVrW� _get_package_data_output_mapping�_get_module_mapping�dict�sorted)r$�mappingrrrra�s
�zbuild_py.get_output_mappingccs>�|��D]\}}}|�d�}|�|j||�}||fVqdS)z5Iterate over all modules producing (dest, src) pairs.rEN)Zfind_all_modulesrPZget_module_outfilerO)r$r=r;r<�filenamerrrrg�s�
�zbuild_py._get_module_mappingccsJ�|jD]\}}}}|D]}tj�||�}tj�||�}||fVqqdS)z6Iterate over package data producing (dest, src) pairs.N)rrrFrN)r$r=rKrRrSrkr�srcfilerrrrf�s���z)build_py._get_package_data_output_mappingcCs@|��D]\}}|�tj�|��|�||�\}}t|�qdS)z$Copy data files into build directoryN)rfZmkpathrrF�dirnamer)r)r$rrlZ_outfZ_copiedrrrr2�s

�zbuild_py.build_package_datacCspi|_}|jjsdSi}|jpdD]}||t|�|��<qt|dd�r=t|jd��	�r=|j}t|d�}|j
dd���}n|�d�|�
d�}|j}|jj}t�}|�||�D]^}	tj�t|	��\}
}d}|}
|
r�|
|kr�|
|vr�|
}tj�|
�\}
}tj�||�}|
r�|
|kr�|
|vsq|
|vr�||
kr�|�|�r�qWn|�||
|�}|r�|�|�|�||
g��|	�qWdS)NrrzSOURCES.txtzutf-8)�encoding�egg_info)rBrZinclude_package_datar1�assert_relativerM�getattrrr�exists�	read_text�
splitlines�run_command�get_finalized_commandro�filelistr^�_IncludePackageDataAbuse�_filter_build_filesrrFrPrN�	is_module�importable_subpackage�warnrCr:)r$�mfZsrc_dirsr=�egg_info_dir�manifestr^Zei_cmd�checkrF�d�f�prevZoldfZdf�
importablerrrr>�sL

��


�
�
��zbuild_py.analyze_manifestr^roc#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)rrF�normpath)rH�prrrrL�sz0build_py._filter_build_files.<locals>.<listcomp>c3s�|]}|�vVqdSrr)rHr��Z	norm_pathrr�	<genexpr>�s�z/build_py._filter_build_files.<locals>.<genexpr>N)	rvrOZ
build_tempZ
build_baserrFr��isabs�all)r$r^ror�Z
build_dirsZ	norm_dirsrIrr�rry�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�n1sPwYd|vrbtj�
d|f��|S)z8Check namespace packages' __init__ for declare_namespacerE�rbNsdeclare_namespacez�Namespace package problem: %s 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�KeyErrorrr�
check_packager�namespace_packages�
startswith�io�open�read�	distutils�errorsZDistutilsError)r$r=Zpackage_dirZinit_py�pkgr��contentsrrrr��s0�
�
���zbuild_py.check_packagecCs"i|_tj�|�d|_d|_dS)NF)r�rr�initialize_optionsrrr#rrrr�s
zbuild_py.initialize_optionscCs0tj�||�}|jjdurtj�|jj|�S|Sr)rrrMrZsrc_rootrrFrN)r$r=�resrrrrMs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)�fnmatchrY�rH�pattern)r^rrr���z.build_py.exclude_data_files.<locals>.<genexpr>c3s�|]	}|�vr|VqdSrr)rH�fn)�badrrr�r�)r?rUr rVrWrX�setr
)r$r=rKr^r]Zmatch_groups�matchesZkeepersr)r�r^rr\
s�zbuild_py.exclude_data_filescs.t�|�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)rrFrNrr�rJrrr�)s
��
�z2build_py._get_platform_patterns.<locals>.<genexpr>)rVrWr[)�specr=rKZraw_patternsrrJrrUs

�
�zbuild_py._get_platform_patterns)r%r%Nr%)r%)'�__name__�
__module__�__qualname__�__doc__r�bool�__annotations__rr
r&rr)r5r7r9r6rDrArQr	r4rrarrrgrfr2r>rryr�r�r�rMr\�staticmethodrU�
__classcell__rrr.rrs:
�	
)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.
        )rrFr��distutils.errorsr��textwrap�dedent�lstrip)rFr��msgrrrrp0s�	��
rpc@s4eZdZdZdZdd�Zdd�Zdd�Zd	d
�ZdS)rxz>Inform users that package or module is included as 'data file'a�    Installing {importable!r} as data is deprecated, please list it in `packages`.
    !!


    ############################
    # Package would be ignored #
    ############################
    Python recognizes {importable!r} as an importable package,
    but it is not listed in the `packages` configuration of setuptools.

    {importable!r} has been automatically added to the distribution only
    because it may contain data files, but this behavior is likely to change
    in future versions of setuptools (and therefore is considered deprecated).

    Please make sure that {importable!r} is included as a package by using
    the `packages` configuration field or the proper discovery methods
    (for example by using `find_namespace_packages(...)`/`find_namespace:`
    instead of `find_packages(...)`/`find:`).

    You can read more about "package discovery" and "data files" on setuptools
    documentation page.
    

!!
    cCst�|_dSr)r��_already_warnedr#rrr�__init___sz!_IncludePackageDataAbuse.__init__cCs |�d�o|dtd����S)Nz.py)�endswith�len�isidentifier)r$rIrrrrzbs z"_IncludePackageDataAbuse.is_modulecCs6t|�j}tt�tj|j��}|rd�|g|��SdS)NrE)	r�parentr?rV�	takewhiler&r��partsrN)r$r�rIr�r�rrrr{es

z._IncludePackageDataAbuse.importable_subpackagecCsB||jvrt�|j�j|d�}tj|tdd�|j�|�dSdS)N)r��)�
stacklevel)	r�r�r��MESSAGE�format�warningsr|r�add)r$r�r�rrrr|ls

�z_IncludePackageDataAbuse.warnN)	r�r�r�r�r�r�rzr{r|rrrrrxEsrx)"�	functoolsrrZdistutils.utilrZdistutils.command.build_py�commandrrrr�r�r�r�r�rVrr��pathlibr�typingrrrr	r
rZsetuptools._deprecation_warningrZ setuptools.extern.more_itertoolsr
rrprxrrrr�<module>s,