Current Dir: /snap/core22/2955/usr/lib/python3/dist-packages/setuptools/_distutils/command/__pycache__/

[FILE] bdist.cpython-310.pyc [ edit | delete | rename ]
[FILE] bdist_dumb.cpython-310.pyc [ edit | delete | rename ]
[FILE] bdist_msi.cpython-310.pyc [ edit | delete | rename ]
[FILE] bdist_rpm.cpython-310.pyc [ edit | delete | rename ]
[FILE] bdist_wininst.cpython-310.pyc [ edit | delete | rename ]
[FILE] build.cpython-310.pyc [ edit | delete | rename ]
[FILE] build_clib.cpython-310.pyc [ edit | delete | rename ]
[FILE] build_ext.cpython-310.pyc [ edit | delete | rename ]
[FILE] build_py.cpython-310.pyc [ edit | delete | rename ]
[FILE] build_scripts.cpython-310.pyc [ edit | delete | rename ]
[FILE] check.cpython-310.pyc [ edit | delete | rename ]
[FILE] clean.cpython-310.pyc [ edit | delete | rename ]
[FILE] config.cpython-310.pyc [ edit | delete | rename ]
[FILE] install.cpython-310.pyc [ edit | delete | rename ]
[FILE] install_data.cpython-310.pyc [ edit | delete | rename ]
[FILE] install_egg_info.cpython-310.pyc [ edit | delete | rename ]
[FILE] install_headers.cpython-310.pyc [ edit | delete | rename ]
[FILE] install_lib.cpython-310.pyc [ edit | delete | rename ]
[FILE] install_scripts.cpython-310.pyc [ edit | delete | rename ]
[FILE] py37compat.cpython-310.pyc [ edit | delete | rename ]
[FILE] register.cpython-310.pyc [ edit | delete | rename ]
[FILE] sdist.cpython-310.pyc [ edit | delete | rename ]
[FILE] upload.cpython-310.pyc [ edit | delete | rename ]
[FILE] __init__.cpython-310.pyc [ edit | delete | rename ]

Viewing: /snap/core22/2955/usr/lib/python3/dist-packages/setuptools/_distutils/command/__pycache__/build_py.cpython-310.pyc

o

�_�ao@�@sddZddlZddlZddlZddlZddlmZddlTddl	m
Z
ddlmZGdd�de�Z
dS)	zHdistutils.command.build_py

Implements the Distutils 'build_py' command.�N)�Command)�*)�convert_path)�logc@s�eZdZdZgd�ZddgZddiZdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd.d#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-S)/�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)rrr
cCs4d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr)�	build_lib�
py_modules�package�package_data�package_dirr�optimizer��self�r�H/usr/lib/python3/dist-packages/setuptools/_distutils/command/build_py.py�initialize_options s
zbuild_py.initialize_optionsc	Cs�|�ddd�|jj|_|jj|_|jj|_i|_|jjr/|jj��D]\}}t|�|j|<q#|��|_	t
|jt�s`zt|j�|_d|jkrMdksPJ�J�WdSt
tfy_td��wdS)N�build)rr)rrr�zoptimize must be 0, 1, or 2)�set_undefined_options�distribution�packagesrrr�itemsr�get_data_files�
data_files�
isinstancer�int�
ValueError�AssertionError�DistutilsOptionError)r�name�pathrrr�finalize_options*s(�



$��zbuild_py.finalize_optionscCs:|jr|��|jr|��|��|�|jdd��dS)Nr)�include_bytecode)r�
build_modulesr�build_packages�build_package_data�byte_compile�get_outputsrrrr�runCszbuild_py.runcs�g}|js|S|jD]4}|�|�}tjj|jg|�d��}d�|r(t|�d��fdd�|�||�D�}|�	||||f�q
|S)z?Generate list of '(package,src_dir,build_dir,filenames)' tuples�.r�csg|]}|�d��qS�Nr)�.0�file��plenrr�
<listcomp>ss�z+build_py.get_data_files.<locals>.<listcomp>)
r�get_package_dir�osr'�joinr�split�len�find_data_files�append)r�datar�src_dir�	build_dir�	filenamesrr5rras



�zbuild_py.get_data_filescsd|j�dg�|j�|g�}g�|D]}t�tj�t�|�t|���}���fdd�|D��q�S)z6Return filenames for package's data files in 'src_dir'�cs$g|]}|�vrtj�|�r|�qSr)r9r'�isfile)r3�fn��filesrrr7�s

�z,build_py.find_data_files.<locals>.<listcomp>)	r�get�globr9r'r:�escaper�extend)rrr@�globs�pattern�filelistrrFrr=ys�zbuild_py.find_data_filescCs`d}|jD](\}}}}|D]}tj�||�}|�tj�|��|jtj�||�|dd�q
qdS)z$Copy data files into build directoryNF��
preserve_mode)r r9r'r:�mkpath�dirname�	copy_file)r�lastdirrr@rArB�filename�targetrrrr,�s���zbuild_py.build_package_datacCs�|�d�}|js|rtjj|�SdSg}|rCz
|jd�|�}Wnty4|�d|d�|d=Yn
w|�d|�tjj|�S|s|j�d�}|durS|�d|�|r[tjj|�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).r0rCr���N)r;rr9r'r:�KeyError�insertrH)rrr'�tail�pdirrrrr8�s,

��zbuild_py.get_package_dircCsj|dkrtj�|�std|��tj�|�std|��|r3tj�|d�}tj�|�r-|St�d|�dS)NrCz%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))	r9r'�exists�DistutilsFileError�isdirr:rDr�warn)rrr�init_pyrrr�
check_package�s&����zbuild_py.check_packagecCs"tj�|�st�d||�dSdS)Nz!file %s (for module %s) not foundFT)r9r'rDrr_)r�module�module_filerrr�check_module�szbuild_py.check_modulec	Cs�|�||�t�tj�t�|�d��}g}tj�|jj�}|D](}tj�|�}||kr@tj�	tj�
|��d}|�|||f�q|�d|�q|S)Nz*.pyrzexcluding %s)
rarIr9r'r:rJ�abspathr�script_name�splitext�basenamer>�debug_print)	rrr�module_files�modules�setup_scriptr
�abs_frbrrr�find_package_modules�szbuild_py.find_package_modulesc	Cs�i}g}|jD]]}|�d�}d�|dd��}|d}z||\}}Wnty3|�|�}d}Ynw|sL|�||�}	|df||<|	rL|�|d|	f�tj�||d�}
|�	||
�s\q|�|||
f�q|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.
        r0rrWr1�__init__�.py)
rr;r:rXr8rar>r9r'rd)rrrkrbr'r�module_baser�checkedr`rcrrr�find_modules�s,


�zbuild_py.find_modulescCsNg}|jr|�|���|jr%|jD]}|�|�}|�||�}|�|�q|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.)rrKrsrr8rn)rrkrr�mrrr�find_all_moduless

zbuild_py.find_all_modulescCsdd�|��D�S)NcSsg|]}|d�qS)rWr)r3rbrrrr7-sz-build_py.get_source_files.<locals>.<listcomp>)rurrrr�get_source_files,szbuild_py.get_source_filescCs$|gt|�|dg}tjj|�S)Nrp)�listr9r'r:)rrArrb�outfile_pathrrr�get_module_outfile/szbuild_py.get_module_outfiler1cCs�|��}g}|D]8\}}}|�d�}|�|j||�}|�|�|r@|jr/|�tjj|dd��|j	dkr@|�tjj||j	d��q|dd�|j
D�7}|S)Nr0rC)�optimizationrcSs,g|]\}}}}|D]	}tj�||��q
qSr)r9r'r:)r3rr@rArBrUrrrr7Bs
���z(build_py.get_outputs.<locals>.<listcomp>)rur;ryrr>r�	importlib�util�cache_from_sourcerr )rr)rk�outputsrrbrcrUrrrr.3s(


�

���zbuild_py.get_outputscCsbt|t�r|�d�}nt|ttf�std��|�|j||�}tj	�
|�}|�|�|j||dd�S)Nr0z:'package' must be a string (dot-separated), list, or tuplerrO)
r!�strr;rw�tuple�	TypeErrorryrr9r'rRrQrS)rrbrcr�outfile�dirrrr�build_moduleJs
�
zbuild_py.build_modulecCs*|��}|D]\}}}|�|||�qdSr2)rsr�)rrkrrbrcrrrr*Ys�zbuild_py.build_modulescCsP|jD]"}|�|�}|�||�}|D]\}}}||ksJ�|�|||�qqdSr2)rr8rnr�)rrrrk�package_rbrcrrrr+bs


��zbuild_py.build_packagescCs�tjr
|�d�dSddlm}|j}|dtjkr|tj}|jr-||d|j	||j
d�|jdkr@|||j|j	||j
d�dSdS)Nz%byte-compiling is disabled, skipping.r)r-rW)rr�prefix�dry_run)�sys�dont_write_bytecoder_�distutils.utilr-rr9�seprrr�r)rrGr-r�rrrr-vs 


�


��zbuild_py.byte_compileN)r1)�__name__�
__module__�__qualname__�description�user_options�boolean_options�negative_optrr(r/rr=r,r8rardrnrsrurvryr.r�r*r+r-rrrrrs0



'4
	r)�__doc__r9�importlib.utilr{r�rI�distutils.corer�distutils.errorsr�r�	distutilsrrrrrr�<module>s
Upload File: