CasperSecurity

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

o

�_�a/"�@s�ddlmZddlmZddlmmZddlZddlZddl	Z	ddl
Z
ddlZddl
Z
ddlZddlmZdd�ZGdd�dej�Zd	d
�ZdS)�)�glob)�convert_pathN)�unique_everseencCst�|t�|�jtjB�dS�N)�os�chmod�stat�st_mode�S_IWRITE)�target�r�=/usr/lib/python3/dist-packages/setuptools/command/build_py.py�
make_writablesrc@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zed d!��Zd"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.
    cCs@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��selfrrr
rs


zbuild_py.finalize_optionscCsN|js|jsdS|jr|��|jr|��|��|�tjj|dd��dS)z?Build modules, packages, and copy data files to build directoryNr)�include_bytecode)	�
py_modules�packages�
build_modules�build_packages�build_package_data�byte_compilerr�get_outputsrrrr
�run$szbuild_py.runcCs&|dkr|��|_|jStj�||�S)zlazily compute data filesr)�_get_data_filesrrr�__getattr__)r�attrrrr
r$4s
zbuild_py.__getattr__cCs.tj�||||�\}}|r|j�|�||fSr)rr�build_moduler�append)r�module�module_file�package�outfile�copiedrrr
r&;s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_filesrrrrr
r#Aszbuild_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/r0rrrrr
�get_data_files_without_manifestFsz(build_py.get_data_files_without_manifestcsJ|�|��tjj|jg|�d��}�fdd�|�|��D�}|�||fS)N�.csg|]	}tj�|���qSr)r�path�relpath)�.0�file��src_dirrr
�
<listcomp>Xs��z0build_py._get_pkg_data_files.<locals>.<listcomp>)�get_package_dirrr5�join�	build_lib�split�find_data_files)rr*�	build_dir�	filenamesrr9r
r0Ps


�zbuild_py._get_pkg_data_filescCsX|�|j||�}tt|�}tj�|�}ttj	j
|�}t�|j�|g�|�}|�
|||�S)z6Return filenames for package's data files in 'src_dir')�_get_platform_patternsrr/r�	itertools�chain�
from_iterable�filterrr5�isfiler1�get�exclude_data_files)rr*r:�patterns�globs_expanded�
globs_matches�
glob_files�filesrrr
r@^s�
�zbuild_py.find_data_filesc
Cst|jD]4\}}}}|D]+}tj�||�}|�tj�|��tj�||�}|�||�\}}	t|�tj�|�}qqdS)z$Copy data files into build directoryN)	rrr5r=�mkpath�dirname�	copy_filer�abspath)
rr*r:rArB�filenamer�srcfile�outfr,rrr
ros��zbuild_py.build_package_datacCs�i|_}|jjsdSi}|jpdD]}||t|�|��<q|�d�|�d�}|jj	D]N}t
j�t|��\}}d}|}	|ra||kra||vra|}t
j�|�\}}
t
j�
|
|�}|ra||kra||vsF||vrz|�d�ro||	kroq,|�||g��|�q,dS)Nr�egg_infoz.py)r1r�include_package_datar�assert_relativer<�run_command�get_finalized_command�filelistrOrr5r?r=�endswithr2r')r�mf�src_dirsr*�ei_cmdr5�d�f�prev�oldf�dfrrr
r-zs.


���zbuild_py.analyze_manifestcCsdSrrrrrr
�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_namespacer4�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�errors�DistutilsError)rr*�package_dir�init_py�pkgrb�contentsrrr
rj�s0�
�
���zbuild_py.check_packagecCsi|_tj�|�dSr)rhrr�initialize_optionsrrrr
rw�szbuild_py.initialize_optionscCs0tj�||�}|jjdurtj�|jj|�S|Sr)rrr<r�src_rootrr5r=)rr*�resrrr
r<�s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)�fnmatchrG�r7�pattern)rOrr
�	<genexpr>���z.build_py.exclude_data_files.<locals>.<genexpr>c3s�|]	}|�vr|VqdSrr)r7�fn)�badrr
r}�r~)r.rCrrDrErF�setr)rr*r:rOrK�match_groups�matches�keepersr)r�rOr
rJ�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)rr5r=rr{r9rr
r}�s
��
�z2build_py._get_platform_patterns.<locals>.<genexpr>)rDrErI)�specr*r:�raw_patternsrr9r
rC�s

�
�zbuild_py._get_platform_patternsN)�__name__�
__module__�__qualname__�__doc__rr"r$r&r#r3r0r@rr-rfrjrwr<rJ�staticmethodrCrrrr
rs&	
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.
        )rr5�isabs�distutils.errorsr��textwrap�dedent�lstrip)r5r��msgrrr
rY�s�	��
rY)r�distutils.utilr�distutils.command.build_py�commandrrrrzr�rmr�rprDr� setuptools.extern.more_itertoolsrrrYrrrr
�<module>sO
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY