Your IP : 3.146.65.134


Current Path : /opt/alt/python310/lib64/python3.10/distutils/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/distutils/__pycache__/dist.cpython-310.opt-2.pyc

o

6��f���@s�	ddlZddlZddlZddlmZzddlZWney$dZYnwddlTddlm	Z	m
Z
ddlmZm
Z
mZddlmZddlmZe�d�Zd	d
�ZGdd�d�ZGd
d�d�Zdd�ZdS)�N)�message_from_file)�*)�FancyGetopt�translate_longopt)�
check_environ�	strtobool�
rfc822_escape��log)�DEBUGz^[a-zA-Z]([a-zA-Z0-9_]*)$cCsPt|t�r	|St|t�s&t|�j}d|�d|�d�}t�tj|�t|�}|S)Nz
Warning: 'z' should be a list, got type '�')�
isinstance�str�list�type�__name__r
ZWARN)�valueZ	fieldname�typename�msg�r�5/opt/alt/python310/lib64/python3.10/distutils/dist.py�_ensure_lists

�
rc@sBeZdZ	gd�ZdZgd�Zdd�eD�ZddiZdHd	d
�Zdd�Z	dIdd�Z
dd�ZdHdd�Zdd�Z
dd�Zdd�Zdd�Zddgfdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�ZdJd+d,�ZdHd-d.�ZdKd0d1�Zejfd2d3�Zd4d5�Zd6d7�Zd8d9�Z d:d;�Z!d<d=�Z"d>d?�Z#d@dA�Z$dBdC�Z%dDdE�Z&dFdG�Z'dS)L�Distribution))�verbose�vzrun verbosely (default)�)�quiet�qz!run quietly (turns verbosity off))zdry-run�nzdon't actually do anything)�help�hzshow detailed help message)zno-user-cfgNz-ignore pydistutils.cfg in your home directoryz�Common commands: (see '--help-commands' for more)

  setup.py build      will build the package underneath 'build/'
  setup.py install    will install the package
))z
help-commandsNzlist all available commands)�nameNzprint package name)�version�Vzprint package version)�fullnameNzprint <package name>-<version>)�authorNzprint the author's name)�author-emailNz print the author's email address)�
maintainerNzprint the maintainer's name)zmaintainer-emailNz$print the maintainer's email address)�contactNz7print the maintainer's name if known, else the author's)z
contact-emailNz@print the maintainer's email address if known, else the author's)�urlNzprint the URL for this package)�licenseNz print the license of the package)�licenceNzalias for --license)�descriptionNzprint the package description)zlong-descriptionNz"print the long package description)�	platformsNzprint the list of platforms)�classifiersNzprint the list of classifiers)�keywordsNzprint the list of keywords)�providesNz+print the list of packages/modules provided)�requiresNz+print the list of packages/modules required)�	obsoletesNz0print the list of packages/modules made obsoletecCsg|]}t|d��qS�r�r)�.0�xrrr�
<listcomp>�szDistribution.<listcomp>rrNcCsF	d|_d|_d|_|jD]}t||d�q
t�|_|jjD]}d|}t||t|j|��qi|_	d|_
d|_d|_i|_
g|_d|_i|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_i|_i|_|r�|�d�}|dur�|d=|��D]\}}|� |�}|��D]
\}	}
d|
f||	<q�q�d|vr�|d|d<|d=d	}t!dur�t!�"|�nt#j$�%|d
�|��D]<\}}
t&|jd|�r�t|jd|�|
�q�t&|j|�r�t|j||
�q�t&||�r�t|||
�q�dt'|�}t!�"|�q�d
|_(|jdu�r|jD]}
|
�)d��sn|
dk�rd|_(n�q|�*�dS)Nrr�get_��optionszsetup scriptr+r*z:'licence' distribution option is deprecated; use 'license'�
Zset_zUnknown distribution option: %sT�-z
--no-user-cfgF)+r�dry_runr�display_option_names�setattr�DistributionMetadata�metadata�_METHOD_BASENAMES�getattr�cmdclass�command_packages�script_name�script_args�command_optionsZ
dist_files�packagesZpackage_dataZpackage_dir�
py_modules�	libraries�headers�ext_modulesZext_packageZinclude_dirsZ
extra_path�scripts�
data_filesZpassword�command_obj�have_run�get�items�get_option_dict�warnings�warn�sys�stderr�write�hasattr�repr�
want_user_cfg�
startswith�finalize_options)�selfZattrs�attr�basenameZmethod_namer:�commandZcmd_options�opt_dict�opt�valr�key�argrrr�__init__�s�


�


�zDistribution.__init__cCs(	|j�|�}|duri}|j|<|S�N)rHrR)r_rb�dictrrrrT&s
zDistribution.get_option_dictr9c	Cs�ddlm}|durt|j���}|dur |�||�|d}|s+|�|d�dS|D]4}|j�|�}|durC|�|d|�q-|�|d|�||�}|�d�D]}|�|d|�qUq-dS)Nr)�pformatz  zno commands known yetzno option dict for '%s' commandzoption dict for '%s' command:r;)Zpprintrk�sortedrH�keys�announcerR�split)	r_�header�commands�indentrkZcmd_namerc�out�linerrr�dump_option_dicts1s.����zDistribution.dump_option_dictscCs�	g}t�tj�tjdj�}tj�|d�}tj�|�r"|�	|�tj
dkr*d}nd}|jrEtj�tj�d�|�}tj�|�rE|�	|�d}tj�|�rR|�	|�t
r^|�dd	�|��|S)
N�	distutilsz
distutils.cfg�posixz.pydistutils.cfgzpydistutils.cfg�~z	setup.cfgzusing config files: %sz, )r�os�path�dirnamerW�modules�__file__�join�isfile�appendr!r\�
expanduserrrn)r_�filesZsys_dirZsys_fileZ
user_filenameZ	user_fileZ
local_filerrr�find_config_filesMs(



zDistribution.find_config_filescCs|ddlm}tjtjkrgd�}ng}t|�}|dur|��}tr&|�d�|�}|D]D}tr6|�d|�|�	|�|�
�D]+}|�|�}|�|�}|D]}	|	dkri|	|vri|�
||	�}
|	�dd�}	||
f||	<qMq?|��q+d	|jvr�|jd	��D]?\}	\}}
|j�
|	�}z!|r�t||t|
��n|	d
vr�t||	t|
��nt||	|
�Wq|ty�}
zt|
��d}
~
wwdSdS)Nr)�ConfigParser)
zinstall-basezinstall-platbasezinstall-libzinstall-platlibzinstall-purelibzinstall-headerszinstall-scriptszinstall-data�prefixzexec-prefix�home�user�rootz"Distribution.parse_config_files():z  reading %srr<�_�global)rr=)Zconfigparserr�rWr��base_prefix�	frozensetr�rrn�readZsectionsr:rTrR�replacerhrHrS�negative_optr?r�
ValueError�DistutilsOptionError)r_�	filenamesr�Zignore_options�parser�filenameZsectionr:rcrdre�src�aliasrrrr�parse_config_files}sR




��

����zDistribution.parse_config_filescCs�	|��}g|_t||j�}|�|j�|�ddi�|j|j|d�}|�	�}t
�|j�|�
|�r5dS|rE|�||�}|durCdS|s7|jrX|j|t|j�dk|jd�dS|js_td��dS)Nr+r*)�args�objectr��display_optionsrqzno commands suppliedT)�_get_toplevel_optionsrqrr��set_negative_aliasesr�Zset_aliases�getoptrGZget_option_orderr
Z
set_verbosityr�handle_display_options�_parse_command_optsr�
_show_help�len�DistutilsArgError)r_Ztoplevel_optionsr�r��option_orderrrr�parse_command_line�s2	
��zDistribution.parse_command_linecCs	|jdgS)N)zcommand-packages=Nz0list of packages that provide distutils commands)�global_options�r_rrrr��s�z"Distribution._get_toplevel_optionsc
Cs�	ddlm}|d}t�|�std|��|j�|�z|�|�}Wnty3}zt	|��d}~wwt
||�s?td|��t|d�rJt
|jt�sRd}t||��|j}t|d�rd|��}|�|j�t|d�rut
|jt�rut|j�}ng}|�|j|j|�|�|�|�|d	d��\}}	t|	d
�r�|	jr�|j|d|gd�dSt|d�r�t
|jt�r�d}
|jD] \}}}
}t|	|�|��r�d	}
t|�r�|�q�td||f��q�|
r�dS|�|�}t|	���D]
\}}d
|f||<q�|S)Nr��Commandzinvalid command name '%s'z&command class %s must subclass Command�user_optionszIcommand class %s must provide 'user_options' attribute (a list of tuples)r��help_optionsrrr�zYinvalid help function %r for help option '%s': must be a callable object (function, etc.)zcommand line) �
distutils.cmdr��
command_re�match�
SystemExitrqr��get_command_class�DistutilsModuleErrorr��
issubclassZDistutilsClassErrorrZr
r�rr��copy�updater��fix_help_options�set_option_tabler�r�r�rr�Z
get_attr_name�callablerT�varsrS)r_r�r�r�rbZ	cmd_classrr�r�ZoptsZhelp_option_foundZhelp_optionZshortZdesc�funcrcr!rrrrr�sz	
��
�

�


���


����

z Distribution._parse_command_optscCsR	dD]#}t|j|�}|durqt|t�r&dd�|�d�D�}t|j||�qdS)N�r/r-cS�g|]}|���qSr��strip)r5Zelmrrrr7j�z1Distribution.finalize_options.<locals>.<listcomp>�,)rCrAr
rror?)r_r`rrrrr^`s
��zDistribution.finalize_optionsrc
Cs
	ddlm}ddlm}|r*|r|��}n|j}|�|�|�|jd�t	d�|r;|�|j
�|�d�t	d�|jD]=}t|t
�rMt||�rM|}	n|�|�}	t|	d�rit|	jt�ri|�|	jt|	j��n|�|	j�|�d|	j�t	d�q>t	||j��dS)	Nr��	gen_usager�z
Global options:r9zKInformation display options (just display information, ignore any commands)r�zOptions for '%s' command:)�distutils.corer�r�r�r�r�r�Z
print_help�common_usage�printr�rqr
rr�r�rZr�rr�r�rrF)
r_r�r�r�rqr�r�r:rb�klassrrrr�ms<


�



��
zDistribution._show_helpc	Cs�	ddlm}|jr|��td�t||j��dSd}i}|jD]}d||d<q"|D]6\}}|rc|�|�rct|�}t	|j
d|��}|dvrQtd�|��n|dvr]td	�|��nt|�d}q-|S)
Nrr�r9rr8r�r�)r.r0r1r2r;)r�r�Z
help_commands�print_commandsr�rFr�rRrrCrAr~)	r_r�r�Zany_display_optionsZis_display_option�optionrdrerrrrr��s.
�z#Distribution.handle_display_optionsc	Csj	t|d�|D])}|j�|�}|s|�|�}z|j}Wnty(d}Ynwtd|||f�q	dS)N�:�(no description available)z
  %-*s  %s)r�rDrRr�r,�AttributeError)r_rqrp�
max_length�cmdr�r,rrr�print_command_list�s

��zDistribution.print_command_listcCs�	ddl}|jj}i}|D]}d||<q
g}|j��D]}|�|�s'|�|�qd}||D]}t|�|kr:t|�}q.|�|d|�|rPt	�|�|d|�dSdS)NrrzStandard commandszExtra commands)
�distutils.commandrb�__all__rDrmrRr�r�r�r�)r_rv�std_commands�is_stdr��extra_commandsr�rrrr��s6


�����zDistribution.print_commandsc		Cs�	ddl}|jj}i}|D]}d||<q
g}|j��D]}|�|�s'|�|�qg}||D]'}|j�|�}|s=|�|�}z|j}Wnt	yMd}Ynw|�||f�q.|S)Nrrr�)
r�rbr�rDrmrRr�r�r,r�)	r_rvr�r�r�r�Zrvr�r,rrr�get_command_list�s.


�

�zDistribution.get_command_listcCsP	|j}t|t�s&|durd}dd�|�d�D�}d|vr#|�dd�||_|S)Nr9cSsg|]
}|dkr|���qS)r9r�)r5Zpkgrrrr7!sz5Distribution.get_command_packages.<locals>.<listcomp>r�zdistutils.commandr)rEr
rro�insert)r_Zpkgsrrr�get_command_packagess
z!Distribution.get_command_packagesc	Cs�	|j�|�}|r|S|��D]?}d||f}|}zt|�tj|}Wn	ty-Yqwzt||�}WntyEt	d|||f��w||j|<|St	d|��)Nz%s.%sz3invalid command '%s' (no class '%s' in module '%s')zinvalid command '%s')
rDrRr��
__import__rWr|�ImportErrorrCr�r�)r_rbr�ZpkgnameZmodule_nameZ
klass_name�modulerrrr�'s2����
zDistribution.get_command_classcCsn	|j�|�}|s5|r5tr|�d|�|�|�}||�}|j|<d|j|<|j�|�}|r5|�||�|S)Nz<Distribution.get_command_obj(): creating '%s' command objectr)rPrRrrnr�rQrH�_set_command_options)r_rbZcreate�cmd_objr�r:rrr�get_command_objMs�

zDistribution.get_command_objcCsH	|��}|dur|�|�}tr|�d|�|��D]�\}\}}tr-|�d|||f�z
dd�|jD�}WntyBg}Ynwz|j}WntySi}Ynwz=t|t	�}	||vrl|	rlt
|||t|��n$||vr{|	r{t
||t|��nt||�r�t
|||�n	t
d|||f��Wqty�}
zt
|
��d}
~
wwdS)Nz#  setting options for '%s' command:z    %s = %s (from %s)cSsg|]}t|��qSrr4)r5�orrrr7|s�z5Distribution._set_command_options.<locals>.<listcomp>z1error in %s: command '%s' has no such option '%s')�get_command_namerTrrnrSZboolean_optionsr�r�r
rr?rrZr�r�)r_rPZoption_dict�command_namer��sourcerZ	bool_optsZneg_optZ	is_stringrrrrr�hsT

�
��
�

������z!Distribution._set_command_optionsrcCs~	ddlm}t||�s|}|�|�}n|��}|js|S|��d|_d|j|<|�|�|r=|�	�D]}|�
||�q4|S)Nrr�)r�r�r
r�r�Z	finalizedZinitialize_optionsrQr�Zget_sub_commands�reinitialize_command)r_rbZreinit_subcommandsr�r��subrrrr��s 


z!Distribution.reinitialize_commandcCst�||�dSrir	)r_r�levelrrrrn��zDistribution.announcecCs	|jD]}|�|�qdSri)rq�run_command)r_r�rrr�run_commands�s
�zDistribution.run_commandscCsF	|j�|�r	dSt�d|�|�|�}|��|��d|j|<dS)Nz
running %sr)rQrRr
�infor�Zensure_finalized�run)r_rbr�rrrr��s
zDistribution.run_commandcCst|jp|jpg�dkS�Nr)r�rIrJr�rrr�has_pure_modules�szDistribution.has_pure_modulescC�|jo	t|j�dkSr�)rMr�r�rrr�has_ext_modules��zDistribution.has_ext_modulescCr�r�)rKr�r�rrr�has_c_libraries�r�zDistribution.has_c_librariescCs|��p|��Sri)r�r�r�rrr�has_modules�r�zDistribution.has_modulescCr�r�)rLr�r�rrr�has_headers�r�zDistribution.has_headerscCr�r�)rNr�r�rrr�has_scripts�r�zDistribution.has_scriptscCr�r�)rOr�r�rrr�has_data_files�r�zDistribution.has_data_filescCs|��o
|��o
|��Sri)r�r�r�r�rrr�is_pure�s
��zDistribution.is_pureri)NNr9)rr3)(r�
__module__�__qualname__r�r�r�r>r�rhrTrur�r�r�r�r�r^r�r�r�r�r�r�r�r�r�r�r
�INFOrnr�r�r�r�r�r�r�r�r�r�rrrrr,sP,


0:C[

�2(!"
&

,)
rc@seZdZ	dZdAdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�ZeZd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Z d;d<�Z!d=d>�Z"d?d@�Z#dS)Br@)r!r"r%�author_emailr'�maintainer_emailr)r*r,�long_descriptionr/r-r$r(Z
contact_emailr.�download_urlr0r1r2NcCs�|dur
|�t|��dSd|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_dSri)�
read_pkg_file�openr!r"r%r�r'r�r)r*r,r�r/r-r.r�r0r1r2)r_rzrrrrh
s&
zDistributionMetadata.__init__cs	t|���fdd�}�fdd�}�d}|d�|_|d�|_|d�|_|d	�|_d|_|d
�|_d|_|d�|_|d�|_	d
�vrH|d
�|_
nd|_
|d�|_|d�|_d�vra|d��d�|_
|d�|_|d�|_|dkr�|d�|_|d�|_|d�|_dSd|_d|_d|_dS)Ncs�|}|dkr
dS|S�NZUNKNOWNr)r!r�rrr�_read_field(sz7DistributionMetadata.read_pkg_file.<locals>._read_fieldcs��|d�}|gkrdS|Sri)Zget_all)r!�valuesr�rr�
_read_list.sz6DistributionMetadata.read_pkg_file.<locals>._read_listzmetadata-versionr!r"Zsummaryr%r&z	home-pager*zdownload-urlr,r/r��platformZ
classifier�1.1r1r0r2)rr!r"r,r%r'r�r�r)r*r�r�ror/r-r.r1r0r2)r_�filer�rZmetadata_versionrr�rr�$s<













z"DistributionMetadata.read_pkg_filecCsJ	ttj�|d�ddd��}|�|�Wd�dS1swYdS)NzPKG-INFO�wzUTF-8)�encoding)r�ryrzr~�write_pkg_file)r_Zbase_dirZpkg_inforrr�write_pkg_infoXs�"�z#DistributionMetadata.write_pkg_infocCsb	d}|js|js|js|js|jrd}|�d|�|�d|���|�d|���|�d|���|�d|�	��|�d|�
��|�d	|���|�d
|���|jre|�d|j�t
|���}|�d|�d
�|���}|r�|�d|�|�|d|���|�|d|���|�|d|���|�|d|���|�|d|���dS)Nz1.0rzMetadata-Version: %s
z	Name: %s
zVersion: %s
zSummary: %s
zHome-page: %s
zAuthor: %s
zAuthor-email: %s
zLicense: %s
zDownload-URL: %s
zDescription: %s
r�z
Keywords: %s
ZPlatformZ
ClassifierZRequiresZProvidesZ	Obsoletes)r0r1r2r.r�rY�get_name�get_version�get_description�get_url�get_contact�get_contact_email�get_licenser�get_long_descriptionr~�get_keywords�_write_list�
get_platforms�get_classifiers�get_requires�get_provides�
get_obsoletes)r_rr"Z	long_descr/rrrr_s8��z#DistributionMetadata.write_pkg_filecCs |D]}|�d||f�qdS)Nz%s: %s
)rY)r_rr!r�rrrrr�s�z DistributionMetadata._write_listcC�
|jpdSr�)r!r�rrrr��
zDistributionMetadata.get_namecCr)Nz0.0.0)r"r�rrrr	�rz DistributionMetadata.get_versioncCsd|��|��fS)Nz%s-%s)rr	r�rrr�get_fullname�r�z!DistributionMetadata.get_fullnamecCrr�)r%r�rrr�
get_author�rzDistributionMetadata.get_authorcCrr�)r�r�rrr�get_author_email�rz%DistributionMetadata.get_author_emailcCrr�)r'r�rrr�get_maintainer�rz#DistributionMetadata.get_maintainercCrr�)r�r�rrr�get_maintainer_email�rz)DistributionMetadata.get_maintainer_emailcC�|jp|jpdSr�)r'r%r�rrrr�r�z DistributionMetadata.get_contactcCrr�)r�r�r�rrrr
�r�z&DistributionMetadata.get_contact_emailcCrr�)r)r�rrrr�rzDistributionMetadata.get_urlcCrr�)r*r�rrrr�rz DistributionMetadata.get_licensecCrr�)r,r�rrrr
�rz$DistributionMetadata.get_descriptioncCrr�)r�r�rrrr�rz)DistributionMetadata.get_long_descriptioncC�
|jpgSri)r/r�rrrr�rz!DistributionMetadata.get_keywordscC�t|d�|_dS)Nr/)rr/�r_rrrr�set_keywords�r�z!DistributionMetadata.set_keywordscCs|jpdgSr�)r-r�rrrr�sz"DistributionMetadata.get_platformscCr )Nr-)rr-r!rrr�
set_platforms�r�z"DistributionMetadata.set_platformscCrri)r.r�rrrr�rz$DistributionMetadata.get_classifierscCr )Nr.)rr.r!rrr�set_classifiers�r�z$DistributionMetadata.set_classifierscCrr�)r�r�rrr�get_download_url�rz%DistributionMetadata.get_download_urlcCrri)r1r�rrrr�rz!DistributionMetadata.get_requirescC�,ddl}|D]}|j�|�qt|�|_dSr�)�distutils.versionpredicate�versionpredicate�VersionPredicaterr1�r_rrvrrrr�set_requires��z!DistributionMetadata.set_requirescCrri)r0r�rrrr�rz!DistributionMetadata.get_providescCs6dd�|D�}|D]}ddl}|j�|�q	||_dS)NcSr�rr�)r5rrrrr7�r�z5DistributionMetadata.set_provides.<locals>.<listcomp>r)r'r(Zsplit_provisionr0)r_rrrvrrr�set_provides�s

z!DistributionMetadata.set_providescCrri)r2r�rrrr�rz"DistributionMetadata.get_obsoletescCr&r�)r'r(r)rr2r*rrr�
set_obsoletes�r,z"DistributionMetadata.set_obsoletesri)$rr�r�rBrhr�rrrrr	rrrrrrr
rrZget_licencer
rrr"rr#rr$r%rr+rr-rr.rrrrr@�sF
	4"r@cCs&	g}|D]}|�|dd��q|S)Nr�)r�)r:Znew_optionsZ
help_tuplerrrr��s
r�)rWry�reZemailrrUr�Zdistutils.errorsZdistutils.fancy_getoptrrZdistutils.utilrrrrvr
Zdistutils.debugr�compiler�rrr@r�rrrr�<module>s8�
Zc

?>