add-determinism 0.7.3

RPM buildroot helper to strip nondeterministic bits in files
Documentation
U

�AT^� c@sHddlZddlZddlZddlmZddlmZdZGdd�de�Z	dS)�N)�Command)�DistutilsOptionErrorz.pyc@s�eZdZdZdddddddgZd	d
dgZdd
iZd
d�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd �Zd!S)"�install_libz7install all Python modules (extensions and pure Python))zinstall-dir=Zdzdirectory to install to)z
build-dir=Zbz'build directory (where to install from))�forceZfz-force installation (overwrite existing files))�compileZczcompile .py to .pyc [default])�
no-compileNzdon't compile .py files)z	optimize=ZOzlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])�
skip-buildNzskip the build stepsrrrrcCs(d|_d|_d|_d|_d|_d|_dS)Nr)�install_dir�	build_dirrr�optimize�
skip_build��self�r�5/usr/lib64/python3.8/distutils/command/install_lib.py�initialize_options3szinstall_lib.initialize_optionsc	Cs�|�ddddddd�|jdkr&d|_|jdkr6d	|_t|jt�s�zt|j�|_|jd
kr^t�Wn ttfk
r�td��YnXdS)N�install)�	build_libr	)rr)rr)rr)r
r
)rrTF)r�izoptimize must be 0, 1, or 2)Zset_undefined_optionsrr
Z
isinstanceZintZAssertionErrorZ
ValueErrorrrrrr�finalize_options<s&�	


zinstall_lib.finalize_optionscCs0|��|��}|dk	r,|j��r,|�|�dS�N)�buildr�distribution�has_pure_modules�byte_compile�r
Zoutfilesrrr�runVszinstall_lib.runcCs2|js.|j��r|�d�|j��r.|�d�dS�N�build_py�	build_ext)rrrZrun_command�has_ext_modulesrrrrrfs



zinstall_lib.buildcCs8tj�|j�r |�|j|j�}n|�d|j�dS|S)Nz3'%s' does not exist -- no Python modules to install)�os�pathZisdirr	Z	copy_treer�warnrrrrrms�zinstall_lib.installcCsrtjr|�d�dSddlm}|�d�j}|jrH||d|j||j	d�|j
dkrn|||j
|j||j|j	d�dS)Nz%byte-compiling is disabled, skipping.r)rr)r
r�prefix�dry_run)r
rr#�verboser$)�sysZdont_write_bytecoder"Zdistutils.utilr�get_finalized_commandZrootrrr$r
r%)r
ZfilesrZinstall_rootrrrrvs$
�
�zinstall_lib.byte_compilec
	Csd|sgS|�|�}|��}t||�}t|�ttj�}g}|D] }	|�tj�||	|d���q>|Sr)	r'�get_outputsZgetattrZlenr Zsep�appendr!Zjoin)
r
Zhas_anyZ	build_cmdZ
cmd_optionZ
output_dirZbuild_filesr	Z
prefix_lenZoutputsZfilerrr�_mutate_outputs�s

zinstall_lib._mutate_outputscCsrg}|D]d}tj�tj�|��d}|tkr.q|jrJ|�tjj	|dd��|j
dkr|�tjj	||j
d��q|S)NrZ)Zoptimizationr)r r!ZsplitextZnormcase�PYTHON_SOURCE_EXTENSIONrr)�	importlibZutilZcache_from_sourcer
)r
Zpy_filenamesZbytecode_filesZpy_fileZextrrr�_bytecode_filenames�s 
�

�
zinstall_lib._bytecode_filenamescCsR|�|j��dd|j�}|jr*|�|�}ng}|�|j��dd|j�}|||S)Nrrr)r*rrrrr-r)r
Zpure_outputsZbytecode_outputsZext_outputsrrrr(�s ����zinstall_lib.get_outputscCsLg}|j��r&|�d�}|�|���|j��rH|�d�}|�|���|Sr)rrr'Zextendr(r)r
Zinputsrrrrr�
get_inputs�s



zinstall_lib.get_inputsN)Z__name__Z
__module__Z__qualname__ZdescriptionZuser_optionsZboolean_optionsZnegative_optrrrrrrr*r-r(r.rrrrrs*�
		r)
r Zimportlib.utilr,r&Zdistutils.corerZdistutils.errorsrr+rrrrrZ<module>s