Your IP : 18.116.19.29


Current Path : /usr/lib64/python3.8/distutils/__pycache__/
Upload File :
Current File : //usr/lib64/python3.8/distutils/__pycache__/dist.cpython-38.opt-2.pyc

U

e5d���@s�ddlZddlZddlZddlmZzddlZWnek
rHdZYnXddlTddlm	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_]*)$cCsLt|t�rn<t|t�sHt|�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�&/usr/lib64/python3.8/distutils/dist.py�_ensure_lists


rc@sleZdZdddddgZdZddd	d
ddd
ddddddddddddddgZdd�eD�ZddiZd`d!d"�Zd#d$�Z	dad&d'�Z
d(d)�Zdbd*d+�Zd,d-�Z
d.d/�Zd0d1�Zd2d3�Zd4d4gfd5d6�Zd7d8�Zd9d:�Zd;d<�Zd=d>�Zd?d@�ZdAdB�ZdcdCdD�ZdddEdF�ZdedHdI�ZejfdJdK�ZdLdM�ZdNdO�ZdPdQ�Z dRdS�Z!dTdU�Z"dVdW�Z#dXdY�Z$dZd[�Z%d\d]�Z&d^d_�Z'd S)f�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>rrNcCs\d|_d|_d|_|jD]}t||d�qt�|_|jjD] }d|}t||t|j|��q:i|_	d|_
d|_d|_i|_
g|_d|_i|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_i|_i|_|�r|�d�}|dk	�r8|d=|��D]4\}}|� |�}|��D]\}	}
d|
f||	<�q�qd|k�r~|d|d<|d=d	}t!dk	�rnt!�"|�nt#j$�%|d
�|��D]�\}}
t&|jd|��r�t|jd|�|
�nNt&|j|��r�t|j||
�n0t&||��r�t|||
�ndt'|�}t!�"|��q�d
|_(|jdk	�rP|jD].}
|
�)d��s6�qP|
dk�r d|_(�qP�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)�self�attrs�attr�basenameZmethod_namer9�commandZcmd_options�opt_dict�opt�valr�key�argrrr�__init__�s~








zDistribution.__init__cCs&|j�|�}|dkr"i}|j|<|S�N)rGrQ)r^rb�dictrrrrS&szDistribution.get_option_dictr8c	Cs�ddlm}|dkr"t|j���}|dk	r@|�||�|d}|sV|�|d�dS|D]h}|j�|�}|dkr�|�|d|�qZ|�|d|�||�}|�d�D]}|�|d|�q�qZdS)Nr)�pformatz  zno commands known yetzno option dict for '%s' commandzoption dict for '%s' command:r:)Zpprintrk�sortedrG�keys�announcerQ�split)	r^�header�commands�indentrkZcmd_namerc�out�linerrr�dump_option_dicts1s*��zDistribution.dump_option_dictscCs�g}t�tj�tjdj�}tj�|d�}tj�|�rB|�	|�tj
dkrRd}nd}|jr�tj�tj�d�|�}tj�|�r�|�	|�d}tj�|�r�|�	|�t
r�|�dd	�|��|S)
N�	distutilsz
distutils.cfg�posixz.pydistutils.cfgzpydistutils.cfg�~z	setup.cfgzusing config files: %sz, )r�os�path�dirnamerV�modules�__file__�join�isfile�appendr!r[�
expanduserrrn)r^�filesZsys_dirZsys_fileZ
user_filenameZ	user_fileZ
local_filerrr�find_config_filesMs&



zDistribution.find_config_filesc
Cs�ddlm}tjtjkr8ddddddd	d
ddd
ddg
}ng}t|�}|dkrT|��}trb|�d�|�}|D]�}tr�|�d|�|�	|�|�
�D]V}|�|�}|�|�}|D]8}	|	dkr�|	|kr�|�
||	�}
|	�dd�}	||
f||	<q�q�|��qld|jk�r�|jd��D]�\}	\}}
|j�
|	�}zF|�rDt||t|
��n(|	dk�r`t||	t|
��nt||	|
�Wn,tk
�r�}
zt|
��W5d}
~
XYnX�qdS)Nr)�ConfigParserz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�rVr��base_prefix�	frozensetr�rrn�readZsectionsr9rSrQ�replacerhrGrR�negative_optr>r�
ValueError�DistutilsOptionError)r^�	filenamesr�Zignore_options�parser�filenameZsectionr9rcrdre�src�aliasrrrr�parse_config_files}s^�





zDistribution.parse_config_filescCs�|��}g|_t||j�}|�|j�|�ddi�|j|j|d�}|�	�}t
�|j�|�
|�rhdS|r�|�||�}|dkrhdSqh|jr�|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�getoptrFZget_option_orderr
Z
set_verbosityr�handle_display_options�_parse_command_optsr�
_show_help�len�DistutilsArgError)r^Ztoplevel_optionsr�r��option_orderrrr�parse_command_line�s.	
�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�|�s*td|��|j�|�z|�|�}Wn*tk
rn}zt	|��W5d}~XYnXt
||�s�td|��t|d�r�t
|jt�s�d}t||��|j}t|d�r�|��}|�|j�t|d�r�t
|jt�r�t|j�}ng}|�|j|j|�|�|�|�|d	d��\}}	t|	d
��rV|	j�rV|j|d|gd�dSt|d��r�t
|jt��r�d}
|jD]F\}}}
}t|	|�|���rzd	}
t|��r�|�ntd||f���qz|
�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��
issubclassZDistutilsClassErrorrYr
r�rr��copy�updater��fix_help_options�set_option_tabler�r�r�rr�Z
get_attr_name�callablerS�varsrR)r^r�r�r�rbZ	cmd_classrr�r�ZoptsZhelp_option_foundZhelp_optionZshortZdesc�funcrcr!rrrrr�sr


�

�


���

�
��
z Distribution._parse_command_optscCsPdD]F}t|j|�}|dkrqt|t�rdd�|�d�D�}t|j||�qdS)N�r/r-cSsg|]}|���qSr��strip)r4Zelmrrrr6jsz1Distribution.finalize_options.<locals>.<listcomp>�,)rBr@r
rror>)r^r`rrrrr]`s
zDistribution.finalize_optionsrc
Csddlm}ddlm}|rR|r*|��}n|j}|�|�|�|jd�t	d�|rt|�|j
�|�d�t	d�|jD]z}t|t
�r�t||�r�|}	n
|�|�}	t|	d�r�t|	jt�r�|�|	jt|	j��n|�|	j�|�d|	j�t	d�qzt	||j��dS)	Nr��	gen_usager�z
Global options:r8zKInformation 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�rYr�rr�r�rrE)
r^r�r�r�rqr�r�r9rb�klassrrrr�ms:

�



��
zDistribution._show_helpc	Cs�ddlm}|jr4|��td�t||j��dSd}i}|jD]}d||d<qB|D]l\}}|rX|�|�rXt|�}t	|j
d|��}|dkr�td�|��n |dkr�td	�|��nt|�d}qX|S)
Nrr�r8rr7r�r�)r.r0r1r2r:)r�r�Z
help_commands�print_commandsr�rEr�rQrrBr@r~)	r^r�r�Zany_display_optionsZis_display_option�optionrdrerrrrr��s*
z#Distribution.handle_display_optionsc	Csjt|d�|D]T}|j�|�}|s.|�|�}z
|j}Wntk
rPd}YnXtd|||f�qdS)N�:�(no description available)z
  %-*s  %s)r�rCrQr�r,�AttributeError)r^rqrp�
max_length�cmdr�r,rrr�print_command_list�s


zDistribution.print_command_listcCs�ddl}|jj}i}|D]}d||<qg}|j��D]}|�|�s4|�|�q4d}||D]}t|�|krZt|�}qZ|�|d|�|r�t	�|�|d|�dS)NrrzStandard commandszExtra commands)
�distutils.commandrb�__all__rCrmrQr�r�r�r�)r^rv�std_commands�is_stdr��extra_commandsr�rrrr��s.


��zDistribution.print_commandsc		Cs�ddl}|jj}i}|D]}d||<qg}|j��D]}|�|�s4|�|�q4g}||D]P}|j�|�}|sx|�|�}z
|j}Wnt	k
r�d}YnX|�||f�qZ|S)Nrrr�)
r�rbr�rCrmrQr�r�r,r�)	r^rvr�r�r�r��rvr�r,rrr�get_command_list�s(	




zDistribution.get_command_listcCsN|j}t|t�sJ|dkrd}dd�|�d�D�}d|krD|�dd�||_|S)Nr8cSsg|]}|dkr|���qS)r8r�)r4Zpkgrrrr6!sz5Distribution.get_command_packages.<locals>.<listcomp>r�zdistutils.commandr)rDr
rro�insert)r^Zpkgsrrr�get_command_packagess
z!Distribution.get_command_packagesc	Cs�|j�|�}|r|S|��D]�}d||f}|}zt|�tj|}Wntk
r^YqYnXzt||�}Wn&tk
r�t	d|||f��YnX||j|<|St	d|��dS)Nz%s.%sz3invalid command '%s' (no class '%s' in module '%s')zinvalid command '%s')
rCrQr��
__import__rVr|�ImportErrorrBr�r�)r^rbr�ZpkgnameZmodule_nameZ
klass_name�modulerrrr�'s,
��

zDistribution.get_command_classcCsl|j�|�}|sh|rhtr&|�d|�|�|�}||�}|j|<d|j|<|j�|�}|rh|�||�|S)Nz<Distribution.get_command_obj(): creating '%s' command objectr)rOrQrrnr�rPrG�_set_command_options)r^rbZcreate�cmd_objr�r9rrr�get_command_objMs�

zDistribution.get_command_objcCs\|��}|dkr|�|�}tr,|�d|�|��D�] \}\}}trZ|�d|||f�zdd�|jD�}Wntk
r�g}YnXz
|j}Wntk
r�i}YnXz|t|t	�}	||kr�|	r�t
|||t|��nJ||kr�|	r�t
||t|��n,t||��rt
|||�nt
d|||f��Wq4tk
�rT}
zt
|
��W5d}
~
XYq4Xq4dS)Nz#  setting options for '%s' command:z    %s = %s (from %s)cSsg|]}t|��qSrr3)r4�orrrr6|s�z5Distribution._set_command_options.<locals>.<listcomp>z1error in %s: command '%s' has no such option '%s')�get_command_namerSrrnrRZboolean_optionsr�r�r
rr>rrYr�r�)r^rOZoption_dict�command_namer��sourcerZ	bool_optsZneg_optZ	is_stringrrrrr�hsF	

��




��z!Distribution._set_command_optionsrcCs|ddlm}t||�s&|}|�|�}n|��}|js8|S|��d|_d|j|<|�|�|rx|�	�D]}|�
||�qf|S)Nrr�)r�r�r
r�r�Z	finalizedZinitialize_optionsrPr�Zget_sub_commands�reinitialize_command)r^rbZreinit_subcommandsr�r��subrrrr��s


z!Distribution.reinitialize_commandcCst�||�dSrir	)r^r�levelrrrrn�szDistribution.announcecCs|jD]}|�|�qdSri)rq�run_command)r^r�rrr�run_commands�s
zDistribution.run_commandscCsD|j�|�rdSt�d|�|�|�}|��|��d|j|<dS)Nz
running %sr)rPrQr
�infor�Zensure_finalized�run)r^rbr�rrrr��s	
zDistribution.run_commandcCst|jp|jpg�dkS�Nr)r�rHrIr�rrr�has_pure_modules�szDistribution.has_pure_modulescCs|jot|j�dkSr�)rLr�r�rrr�has_ext_modules�szDistribution.has_ext_modulescCs|jot|j�dkSr�)rJr�r�rrr�has_c_libraries�szDistribution.has_c_librariescCs|��p|��Sri)r�r�r�rrr�has_modules�szDistribution.has_modulescCs|jot|j�dkSr�)rKr�r�rrr�has_headers�szDistribution.has_headerscCs|jot|j�dkSr�)rMr�r�rrr�has_scripts�szDistribution.has_scriptscCs|jot|j�dkSr�)rNr�r�rrr�has_data_files�szDistribution.has_data_filescCs|��o|��o|��Sri)r�r�r�r�rrr�is_pure�s
��zDistribution.is_pure)N)NNr8)N)r)N)r)(r�
__module__�__qualname__r�r�r�r=r�rhrSrur�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,s��	�,

0
:C[
�
2(!"&

,
)
rc@seZdZdZdAdd�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�|dk	r|�t|��nfd|_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__cst|���fdd�}�fdd�}�d}|d�|_|d�|_|d�|_|d	�|_d|_|d
�|_d|_|d�|_|d�|_	d
�kr�|d
�|_
nd|_
|d�|_|d�|_d�kr�|d��d�|_
|d�|_|d�|_|dkr�|d�|_|d�|_|d�|_nd|_d|_d|_dS)Ncs�|}|dkrdS|S�NZUNKNOWNr)r!r�rrr�_read_field(sz7DistributionMetadata.read_pkg_file.<locals>._read_fieldcs��|d�}|gkrdS|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�r�Zmetadata_versionrr�rr�$s:












z"DistributionMetadata.read_pkg_filec	Cs2ttj�|d�ddd��}|�|�W5QRXdS)NzPKG-INFO�wzUTF-8)�encoding)r�ryrzr~�write_pkg_file)r^Zbase_dirZpkg_inforrr�write_pkg_infoXs
�z#DistributionMetadata.write_pkg_infocCsbd}|js"|js"|js"|js"|jr&d}|�d|�|�d|���|�d|���|�d|���|�d|�	��|�d|�
��|�d	|���|�d
|���|jr�|�d|j�t
|���}|�d|�d
�|���}|�r|�d|�|�|d|���|�|d|���|�|d|���|�|d|���|�|d|���dS)Nz1.0r�zMetadata-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�rX�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^r�r"Z	long_descr/rrrr_s6��z#DistributionMetadata.write_pkg_filecCs |D]}|�d||f�qdS)Nz%s: %s
)rX)r^r�r!r�rrrrr
�sz DistributionMetadata._write_listcCs
|jpdSr�)r!r�rrrr�szDistributionMetadata.get_namecCs
|jpdS)Nz0.0.0)r"r�rrrr�sz DistributionMetadata.get_versioncCsd|��|��fS)Nz%s-%s)rrr�rrr�get_fullname�sz!DistributionMetadata.get_fullnamecCs
|jpdSr�)r%r�rrr�
get_author�szDistributionMetadata.get_authorcCs
|jpdSr�)r�r�rrr�get_author_email�sz%DistributionMetadata.get_author_emailcCs
|jpdSr�)r'r�rrr�get_maintainer�sz#DistributionMetadata.get_maintainercCs
|jpdSr�)r�r�rrr�get_maintainer_email�sz)DistributionMetadata.get_maintainer_emailcCs|jp|jpdSr�)r'r%r�rrrr�sz DistributionMetadata.get_contactcCs|jp|jpdSr�)r�r�r�rrrr	�sz&DistributionMetadata.get_contact_emailcCs
|jpdSr�)r)r�rrrr�szDistributionMetadata.get_urlcCs
|jpdSr�)r*r�rrrr
�sz DistributionMetadata.get_licensecCs
|jpdSr�)r,r�rrrr�sz$DistributionMetadata.get_descriptioncCs
|jpdSr�)r�r�rrrr�sz)DistributionMetadata.get_long_descriptioncCs
|jpgSri)r/r�rrrr�sz!DistributionMetadata.get_keywordscCst|d�|_dS)Nr/)rr/�r^rrrr�set_keywords�sz!DistributionMetadata.set_keywordscCs|jp
dgSr�)r-r�rrrr�sz"DistributionMetadata.get_platformscCst|d�|_dS)Nr-)rr-rrrr�
set_platforms�sz"DistributionMetadata.set_platformscCs
|jpgSri)r.r�rrrr�sz$DistributionMetadata.get_classifierscCst|d�|_dS)Nr.)rr.rrrr�set_classifiers�sz$DistributionMetadata.set_classifierscCs
|jpdSr�)r�r�rrr�get_download_url�sz%DistributionMetadata.get_download_urlcCs
|jpgSri)r1r�rrrr�sz!DistributionMetadata.get_requirescCs,ddl}|D]}|j�|�qt|�|_dSr�)�distutils.versionpredicate�versionpredicate�VersionPredicaterr1�r^rrvrrrr�set_requires�sz!DistributionMetadata.set_requirescCs
|jpgSri)r0r�rrrr�sz!DistributionMetadata.get_providescCs6dd�|D�}|D]}ddl}|j�|�q||_dS)NcSsg|]}|���qSrr�)r4rrrrr6�sz5DistributionMetadata.set_provides.<locals>.<listcomp>r)rrZsplit_provisionr0)r^rrrvrrr�set_provides�s
z!DistributionMetadata.set_providescCs
|jpgSri)r2r�rrrr�sz"DistributionMetadata.get_obsoletescCs,ddl}|D]}|j�|�qt|�|_dSr�)rrrrr2r rrr�
set_obsoletes�sz"DistributionMetadata.set_obsoletes)N)$rr�r�rArhr�rrr
rrrrrrrrr	rr
Zget_licencerrrrrrrrrrr!rr"rr#rrrrr?�sB	
4"r?cCs$g}|D]}|�|dd��q|S)Nr�)r�)r9Znew_optionsZ
help_tuplerrrr��sr�)rVry�reZemailrrTr�Zdistutils.errorsZdistutils.fancy_getoptrrZdistutils.utilrrrrvr
Zdistutils.debugr�compiler�rrr?r�rrrr�<module>s2

Zc

?>