AlkantarClanX12

Your IP : 18.117.168.71


Current Path : /opt/alt/python310/lib/python3.10/site-packages/setuptools/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib/python3.10/site-packages/setuptools/__pycache__/dist.cpython-310.pyc

o

~�ReO��@s�dgZddlZddlZddlZddlZddlZddlZddlZddl	Zddl
ZddlZddlZddl
mZddlmZddlmZddlmZddlZddlZddlmZmZmZddlmZdd	lmZdd
lm Z m!Z!ddl
m"Z"ddl#m$Z$dd
l%m&Z&ddl%m'Z'ddl(m)Z)ddl*m+Z+ddl,Z,ddl-Z,ddl,m.Z.ddl/m0Z0ddl1m2Z2ddl3Z3er�ddl4m5Z5e6d�e6d�dd�Z7dd�Z8de9de9fdd�Z:d d!d"e9dee9fd#d$�Z;d d!d"e9dee9fd%d&�Z<d d!d"e9deee9fd'd(�Z=d d!dee9fd)d*�Z>d+d,�Z?d-d.�Z@d/d0�ZAeBeCfZDd1d2�ZEd3d4�ZFd5d6�ZGd7d8�ZHd9d:�ZId;d<�ZJd=d>�ZKd?d@�ZLdAdB�ZMdCdD�ZNdEdF�ZOdGdH�ZPdIdJ�ZQe0ejRjS�ZTGdKd�deT�ZSGdLdM�dMe+�ZUdS)N�Distribution�N)�	strtobool)�DEBUG��translate_longopt)�iglob)�List�Optional�
TYPE_CHECKING)�defaultdict)�message_from_file)�DistutilsOptionError�DistutilsSetupError)�
rfc822_escape)�
StrictVersion)�	packaging)�ordered_set)�unique_everseen�)�SetuptoolsDeprecationWarning)�windows_support)�
get_unpatched)�parse_configuration)�Messagez&setuptools.extern.packaging.specifiersz#setuptools.extern.packaging.versioncCst�dt�t|�S)NzDo not call this function)�warnings�warn�DistDeprecationWarningr)�cls�r��/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-2.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/setuptools/dist.py�_get_unpatched2sr cCs&t|dd�}|durtd�}||_|S)N�metadata_version�2.1)�getattrrr!)�self�mvrrr�get_metadata_version7s
r&�content�returnc
CsJ|��}t|�dkr|d��Sd�|d��t�d�|dd���f�S)zFReverse RFC-822 escaping by removing leading whitespaces from content.rr�
N)�
splitlines�len�lstrip�join�textwrap�dedent)r'�linesrrr�rfc822_unescape?s*r1�msgr�fieldcCs||}|dkr
dS|S)zRead Message header field.�UNKNOWNNr�r2r3�valuerrr�_read_field_from_msgGsr7cCst||�}|dur|St|�S)z4Read Message header field and apply rfc822_unescape.N)r7r1r5rrr�_read_field_unescaped_from_msgOs
r8cCs|�|d�}|gkrdS|S)z9Read Message header field and return all results as list.N)�get_all)r2r3�valuesrrr�_read_list_from_msgWsr;cCs|����}|dkrdS|S)Nr4)�get_payload�strip)r2r6rrr�_read_payload_from_msg_sr>cCsTt|�}t|d�|_t|d�|_t|d�|_t|d�|_t|d�|_d|_t|d�|_	d|_
t|d�|_t|d	�|_
d
|vrFt|d
�|_nd|_t|d�|_|jdur`|jtd�kr`t|�|_t|d�|_d
|vrst|d
��d�|_t|d�|_t|d�|_|jtd�kr�t|d�|_t|d�|_t|d�|_n	d|_d|_d|_t|d�|_dS)z-Reads the metadata values from a file object.zmetadata-version�name�version�summary�authorNzauthor-emailz	home-page�licensezdownload-url�descriptionr"�keywords�,�platform�
classifierz1.1�requires�provides�	obsoleteszlicense-file)rrr!r7r?r@rDrB�
maintainer�author_email�maintainer_email�urlr8rC�download_url�long_descriptionr>�splitrEr;�	platforms�classifiersrIrJrK�
license_files)r$�filer2rrr�
read_pkg_filefs<
rWcCs"d|vrt�d�|�dd�}|S)Nr)z1newlines not allowed and will break in the future� )rr�replace)�valrrr�single_line�s
r[c
s�|��}�fdd�}|dt|��|d|���|d|���|dt|����|d|���d}|D]\}}t||d	�}|d	urF|||�q3t|�	��}|d
|�|j
r[|d|j
�|j��D]	}	|dd
|	�q`d�
|���}
|
rx|d|
�|��D]}|d|�q||��d|���|��d|���|��d|���|��d|���t|d�r�|d|j�|jr�|d|j�|jr�|jD]}|d|�q�|��d|jp�g���d|���d	S)z0Write the PKG-INFO format data to a file object.cs��d||f�dS)Nz%s: %s
)�write)�keyr6�rVrr�write_field�sz#write_pkg_file.<locals>.write_fieldzMetadata-Version�Name�VersionZSummaryz	Home-page))ZAuthorrB)zAuthor-emailrM)Z
MaintainerrL)zMaintainer-emailrNNZLicensezDownload-URLzProject-URLz%s, %srFZKeywords�Platform�
Classifier�Requires�Provides�	Obsoletes�python_requireszRequires-PythonzDescription-Content-TypezProvides-ExtrazLicense-Filez
%s

)r&�str�get_name�get_versionr[�get_description�get_urlr#r�get_licenserP�project_urls�itemsr-�get_keywords�
get_platforms�_write_list�get_classifiers�get_requires�get_provides�
get_obsoletes�hasattrrg�long_description_content_type�provides_extrasrUr\�get_long_description)
r$rVr@r_Zoptional_fieldsr3�attrZattr_valrC�project_urlrErG�extrarr^r�write_pkg_file�sJ
�



r~cCsTztj�d|�}|jrJ�WdSttttfy)}z	td||f�|�d}~ww)Nzx=z4%r must be importable 'module:attrs' string (got %r))	�
pkg_resources�
EntryPoint�parse�extras�	TypeError�
ValueError�AttributeError�AssertionErrorr)�distr{r6�ep�errr�check_importable�s
����r�cCs^zt|ttf�s
J�d�|�|ksJ�WdSttttfy.}z	td||f�|�d}~ww)z"Verify that value is a string list�z%%r must be a list of strings (got %r)N)	�
isinstance�list�tupler-r�r�r�r�r�r�r{r6r�rrr�assert_string_list�s
����r�cCsd|}t|||�|D]%}|�|�stdd|��|�d�\}}}|r/||vr/tj�d||�q
dS)z(Verify that namespace packages are validz1Distribution contains no modules or packages for znamespace package %r�.z^WARNING: %r is declared as a package namespace, but %r is not: please correct this in setup.pyN)r��has_contents_forr�
rpartition�	distutils�logr)r�r{r6Zns_packages�nsp�parent�sep�childrrr�	check_nsp�s$
�����r�c
CsDz
tt�t|����WdStttfy!}ztd�|�d}~ww)z+Verify that extras_require mapping is validz�'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.N)	r��	itertools�starmap�_check_extraror�r�r�rr�rrr�check_extras
s����r�cCs<|�d�\}}}|rt�|�rtd|��tt�|��dS)N�:zInvalid environment marker: )�	partitionr�invalid_markerrr��parse_requirements)r}�reqsr?r��markerrrrr�sr�cCs&t|�|krd}t|j||d���dS)z)Verify that value is True, False, 0, or 1z0{attr!r} must be a boolean value (got {value!r}))r{r6N)�boolr�format)r�r{r6�tmplrrr�assert_bools�r�cCs(|s
t�|�d�t�dSt|�d���)Nz is ignored.z is invalid.)rrrr�r�r{r6rrr�invalid_unless_false$sr�c
Cs`ztt�|��t|ttf�rtd��WdSttfy/}zd}t|j	||d��|�d}~ww)z9Verify that install_requires is a valid requirements listzUnordered types are not allowedzm{attr!r} must be a string or list of strings containing valid project/version requirement specifiers; {error}�r{�errorN)
r�rr�r��dict�setr�r�rr��r�r{r6r�r�rrr�check_requirements+s����r�c
CsLz	tj�|�WdStjjtfy%}zd}t|j||d��|�d}~ww)z.Verify that value is a valid version specifierzF{attr!r} must be a string containing valid version specifiers; {error}r�N)r�
specifiers�SpecifierSet�InvalidSpecifierr�rr�r�rrr�check_specifier9s���r�c
Cs6z	tj�|�WdSty}zt|�|�d}~ww)z)Verify that entry_points map is parseableN)rr��	parse_mapr�rr�rrr�check_entry_pointsDs
��r�cCst|t�s	td��dS)Nztest_suite must be a string)r�rhrr�rrr�check_test_suiteLs
�r�cCsZt|t�std�|���|��D]\}}t|t�s!td�||���t|d�|�|�qdS)z@Verify that value is a dictionary of package names to glob listszT{!r} must be a dictionary mapping package names to lists of string wildcard patternsz,keys of {!r} dict must be strings (got {!r})zvalues of {!r} dictN)r�r�rr�rorhr�)r�r{r6�k�vrrr�check_package_dataQs
�

��r�cCs(|D]}t�d|�stj�d|�qdS)Nz\w+(\.\w+)*z[WARNING: %r not a valid package name; please use only .-separated package names in setup.py)�re�matchr�r�r)r�r{r6�pkgnamerrr�check_packages`s���r�c@s~eZdZdZdd�eejdd�dd�d�ZdZdd	�Z	dUd
d�Z
dd
�Zedd��Z
edd��Zdd�Zdd�Zedd��Zdd�Zdd�Zdd�Zedd��ZdUd d!�Zd"d#�Zd$d%�Zd&d'�ZdUd(d)�ZdVd+d,�Zd-d.�Zd/d0�Zed1d2��Zd3d4�Zd5d6�Z d7d8�Z!d9d:�Z"d;d<�Z#d=d>�Z$d?d@�Z%dAdB�Z&dCdD�Z'dEdF�Z(dGdH�Z)dIdJ�Z*dKdL�Z+dMdN�Z,dOdP�Z-dQdR�Z.dSdT�Z/dS)WraGDistribution with support for tests and package data

    This is an enhanced version of 'distutils.dist.Distribution' that
    effectively adds the following new optional keyword arguments to 'setup()':

     'install_requires' -- a string or sequence of strings specifying project
        versions that the distribution requires when installed, in the format
        used by 'pkg_resources.require()'.  They will be installed
        automatically when the package is installed.  If you wish to use
        packages that are not available in PyPI, or want to give your users an
        alternate download location, you can add a 'find_links' option to the
        '[easy_install]' section of your project's 'setup.cfg' file, and then
        setuptools will scan the listed web pages for links that satisfy the
        requirements.

     'extras_require' -- a dictionary mapping names of optional "extras" to the
        additional requirement(s) that using those extras incurs. For example,
        this::

            extras_require = dict(reST = ["docutils>=0.3", "reSTedit"])

        indicates that the distribution can optionally provide an extra
        capability called "reST", but it can only be used if docutils and
        reSTedit are installed.  If the user installs your package using
        EasyInstall and requests one of your extras, the corresponding
        additional requirements will be installed if needed.

     'test_suite' -- the name of a test suite to run for the 'test' command.
        If the user runs 'python setup.py test', the package will be installed,
        and the named test suite will be run.  The format is the same as
        would be used on a 'unittest.py' command line.  That is, it is the
        dotted name of an object to import and call to generate a test suite.

     'package_data' -- a dictionary mapping package names to lists of filenames
        or globs to use to find data files contained in the named packages.
        If the dictionary has filenames or globs listed under '""' (the empty
        string), those names will be searched for in every package, in addition
        to any names for the specific package.  Data files found using these
        names/globs will be installed along with the package, in the same
        location as the package.  Note that globs are allowed to reference
        the contents of non-package subdirectories, as long as you use '/' as
        a path separator.  (Globs are automatically converted to
        platform-specific paths at runtime.)

    In addition to these new keywords, this class also has several new methods
    for manipulating the distribution's contents.  For example, the 'include()'
    and 'exclude()' methods can be thought of as in-place add and subtract
    commands that add or remove packages, modules, extensions, and so on from
    the distribution.
    cC�dS�Nrrrrr�<lambda>��zDistribution.<lambda>cCr�r�rrrrrr��r�cCr�r�rrrrrr��r�)rxrnry�license_filerUNcCst|r
d|vs
d|vrdSt�t|d����}tjj�|�}|dur6|�d�s8t�t|d��|_	||_
dSdSdS)Nr?r@zPKG-INFO)r�	safe_namerh�lower�working_set�by_key�get�has_metadata�safe_version�_version�
_patched_dist)r$�attrsr]r�rrr�patch_missing_pkg_info�s
�z#Distribution.patch_missing_pkg_infocs�t�d�}|s
i�_|p
i}g�_|�dd��_��|�|�dg��_|�dg��_t�	d�D]}t
���|jd�q0t
���fdd�|��D����|������jj���j_���dS)N�package_data�src_root�dependency_links�setup_requires�distutils.setup_keywordscs i|]\}}|�jvr||�qSr)�_DISTUTILS_UNSUPPORTED_METADATA��.0r�r��r$rr�
<dictcomp>�s

�z)Distribution.__init__.<locals>.<dictcomp>)rwr��
dist_files�popr�r�r�r�r�iter_entry_points�vars�
setdefaultr?�
_Distribution�__init__ro�_set_metadata_defaults�_normalize_version�_validate_version�metadatar@�_finalize_requires)r$r�Zhave_package_datar�rr�rr��s,


��
	�zDistribution.__init__cCs4|j��D]\}}t|j��||�||���qdS)z�
        Fill-in missing metadata fields not supported by distutils.
        Some fields may have been set by other tools (e.g. pbr).
        Those fields (vars(self.metadata)) take precedence to
        supplied attrs.
        N)r�ror�r�r�r�)r$r��option�defaultrrrr��s�z#Distribution._set_metadata_defaultscCsTt|tj�s
|dur|Sttj�|��}||kr(d}t�|j	dit
����|S|S)Nz)Normalizing '{version}' to '{normalized}'r)r��
setuptools�sicrhrr@rarrr��locals)r@�
normalizedr�rrrr��szDistribution._normalize_versionc	Csft|tj�r
t|�}|dur1z	tj�|�W|Stjjtfy0t	�
d|�t�|�YSw|S)Nz�The version specified (%r) is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.)
r��numbers�Numberrhrr@ra�InvalidVersionr�rrr�r�)r@rrrr��s	����zDistribution._validate_versioncCsft|dd�r|j|j_t|dd�r)|j��D]}|�d�d}|r(|jj�|�q|��|�	�dS)z�
        Set `metadata.python_requires` and fix environment markers
        in `install_requires` and `extras_require`.
        rgN�extras_requirer�r)
r#rgr�r��keysrRry�add�_convert_extras_requirements�"_move_install_requirements_markers)r$r}rrrr��s
�zDistribution._finalize_requirescCsht|dd�pi}tt�|_|��D] \}}|j|t�|�D]}|�|�}|j||�|�qqdS)z�
        Convert requirements in `extras_require` of the form
        `"extra": ["barbazquux; {marker}"]` to
        `"extra:{marker}": ["barbazquux"]`.
        r�N)	r#rr��_tmp_extras_requirerorr��_suffix_for�append)r$Z
spec_ext_reqs�sectionr��r�suffixrrrr�s


��z)Distribution._convert_extras_requirementscCs|jr
dt|j�SdS)ze
        For a requirement, return the 'extras_require' suffix for
        that requirement.
        r�r�)r�rh��reqrrrr�!szDistribution._suffix_forcs�dd�}t�dd�pd}tt�|��}t||�}t�||�}ttt|���_	|D]}�j
dt|j��|�q(t
�fdd��j
��D���_dS)	zv
        Move requirements in `install_requires` that are using environment
        markers `extras_require`.
        cSs|jSr��r�r�rrr�
is_simple_req3szFDistribution._move_install_requirements_markers.<locals>.is_simple_req�install_requiresNrr�c3s.�|]\}}|dd�t�j|�D�fVqdS)cS�g|]}t|��qSr)rh)r�r�rrr�
<listcomp>?�zMDistribution._move_install_requirements_markers.<locals>.<genexpr>.<listcomp>N)�map�
_clean_reqr�r�rr�	<genexpr>>s
��
�zBDistribution._move_install_requirements_markers.<locals>.<genexpr>)r#r�rr��filterr��filterfalserrhr�r�r�r�r�ror�)r$r�Zspec_inst_reqsZ	inst_reqsZsimple_reqsZcomplex_reqsr�rr�rr�)s

�z/Distribution._move_install_requirements_markerscCs
d|_|S)zP
        Given a Requirement, remove environment markers and return it.
        Nr�)r$r�rrrrCszDistribution._clean_reqcCs`|jj}|r|ng}|jj}|r||vr|�|�|dur#|dur#d}tt|�|���|j_dS)z<Compute names of all license files which should be included.N)zLICEN[CS]E*zCOPYING*zNOTICE*zAUTHORS*)r�rUr�r�r�r�_expand_patterns)r$rU�patternsr�rrr�_finalize_license_filesJs
�z$Distribution._finalize_license_filescCsdd�|D�S)z�
        >>> list(Distribution._expand_patterns(['LICENSE']))
        ['LICENSE']
        >>> list(Distribution._expand_patterns(['setup.cfg', 'LIC*']))
        ['setup.cfg', 'LICENSE']
        css<�|]}tt|��D]}|�d�s
tj�|�r
|Vq
qdS)�~N)�sortedr�endswith�os�path�isfile)r��patternr
rrrres�
��
��z0Distribution._expand_patterns.<locals>.<genexpr>r)rrrrr]s�zDistribution._expand_patternscCs�ddlm}tjtjkrgngd�}t|�}|dur|��}tr%|�d�|�}t	|_
|D]g}tj|dd��}trE|�dj
dit����|�|�Wd�n1sTwY|��D]2}|�|�}|�|�}	|D]#}
|
d	ksu|
|vrvqk|�||
�}|�|
|�}
|�|
|�}
||f|	|
<qkq]|��q-d
|jvr�dS|jd
��D]7\}
\}}|j�|
�}
|
r�t|�}n|
dvr�t|�}z
t||
p�|
|�Wq�ty�}zt|�|�d}~wwdS)
z�
        Adapted from distutils.dist.Distribution.parse_config_files,
        this method provides the same functionality in subtly-improved
        ways.
        r)�ConfigParser)
zinstall-basezinstall-platbasezinstall-libzinstall-platlibzinstall-purelibzinstall-headerszinstall-scriptszinstall-data�prefixzexec-prefix�home�user�rootNz"Distribution.parse_config_files():�utf-8)�encodingz  reading {filename}�__name__�global)�verbose�dry_runr)�configparserr�sysr�base_prefix�	frozenset�find_config_filesr�announcerh�optionxform�io�openr�r��	read_file�sections�options�get_option_dictr��warn_dash_deprecation�make_option_lowercaser��command_optionsro�negative_optr�setattrr�r
)r$�	filenamesr�ignore_options�parser�filename�readerr�r&�opt_dict�optrZ�src�aliasr�rrr�_parse_config_filesmsZ��
�

�


���z Distribution._parse_config_filescCsd|dvr|S|�dd�}tjj|��}|�d�s#|dkr#||vr#|Sd|vr0t�d||f�|S)N)zoptions.extras_requirezoptions.data_files�-�_r&r�zrUsage of dash-separated '%s' will not be supported in future versions. Please use the underscore name '%s' instead)rYr��command�__all__�_setuptools_commands�
startswithrr)r$r3r�Zunderscore_opt�commandsrrrr(�s ���z"Distribution.warn_dash_deprecationcCs4z
t�d�}t|�d��WStjygYSw)Nr��distutils.commands)r�get_distributionr��
get_entry_map�DistributionNotFound)r$r�rrrr;�s
�z!Distribution._setuptools_commandscCs4|dks|��r
|S|��}t�d|||f�|S)Nr�zlUsage of uppercase key '%s' in '%s' will be deprecated in future versions. Please use lowercase '%s' instead)�islowerr�rr)r$r3r�Z
lowercase_optrrrr)�s��z"Distribution.make_option_lowercasecCsH|��}|dur
|�|�}tr|�d|�|��D]�\}\}}tr,|�d|||f�z
dd�|jD�}WntyAg}Ynwz|j}WntyRi}Ynwz=t|t	�}	||vrk|	rkt
|||t|��n$||vrz|	rzt
||t|��nt||�r�t
|||�n	t
d|||f��Wqty�}
zt
|
�|
�d}
~
wwdS)a�
        Set the options for 'command_obj' from 'option_dict'.  Basically
        this means copying elements of a dictionary ('option_dict') to
        attributes of an instance ('command').

        'command_obj' must be a Command instance.  If 'option_dict' is not
        supplied, uses the standard option dictionary for this command
        (from 'self.command_options').

        (Adopted from distutils.dist.Distribution._set_command_options)
        Nz#  setting options for '%s' command:z    %s = %s (from %s)cSr�rr)r��orrrr��rz5Distribution._set_command_options.<locals>.<listcomp>z1error in %s: command '%s' has no such option '%s')�get_command_namer'rr ro�boolean_optionsr�r+r�rhr,rrwr
r�)r$�command_obj�option_dict�command_namer��sourcer6�	bool_opts�neg_opt�	is_stringr�rrr�_set_command_options�sJ
�
�

���
���z!Distribution._set_command_optionsFcCs0|j|d�t||j|d�|��|��dS)zYParses configuration files from various levels
        and loads configuration.

        )r-)�ignore_option_errorsN)r6rr*r�r)r$r-rNrrr�parse_config_filess�zDistribution.parse_config_filescCs8tjjt�|�|jdd�}|D]
}tjj|dd�q|S)zResolve pre-setup requirementsT)�	installer�replace_conflicting)rY)rr��resolver��fetch_build_eggr�)r$rIZresolved_distsr�rrr�fetch_build_eggs$s�zDistribution.fetch_build_eggscCsPd}dd�}t�|�}t�|j|�}tdd�|�}t||d�D]}||�qdS)z�
        Allow plugins to apply arbitrary operations to the
        distribution. Each hook may optionally define a 'order'
        to influence the order of execution. Smaller numbers
        go first and the default is 0.
        z(setuptools.finalize_distribution_optionscSst|dd�S)N�orderr)r#)�hookrrr�by_order8sz/Distribution.finalize_options.<locals>.by_ordercSs|��Sr�)�load)r�rrrr�=sz/Distribution.finalize_options.<locals>.<lambda>)r]N)rr�r�r�_removedrr
)r$�grouprWZdefined�filteredZloadedr�rrr�finalize_options/s

�zDistribution.finalize_optionscCsdh}|j|vS)z�
        When removing an entry point, if metadata is loaded
        from an older version of Setuptools, that removed
        entry point will attempt to be loaded and will fail.
        See #2765 for more details.
        Z
2to3_doctests)r?)r��removedrrrrYAs
�
zDistribution._removedcCsJt�d�D]}t||jd�}|dur"|j|jd�|��||j|�qdS)Nr��rP)rr�r#r?�requirerSrX)r$r�r6rrr�_finalize_setup_keywordsOs��z%Distribution._finalize_setup_keywordscCs�tj�tjd�}tj�|�sDt�|�t�|�tj�|d�}t|d��}|�	d�|�	d�|�	d�Wd�|S1s?wY|S)Nz.eggsz
README.txt�wzcThis directory contains eggs that were downloaded by setuptools to build, test, and run plug-ins.

zAThis directory caches those eggs to prevent repeated downloads.

z/However, it is safe to delete this directory.

)
rr
r-�curdir�exists�mkdirrZ	hide_filer#r\)r$Z
egg_cache_dirZreadme_txt_filename�frrr�get_egg_cache_dirVs"

��
��zDistribution.get_egg_cache_dircCsddlm}|||�S)z Fetch an egg needed for buildingr)rS)Zsetuptools.installerrS)r$r�rSrrrrSis
zDistribution.fetch_build_eggcCs\||jvr
|j|St�d|�}|D]}|j|jd�|��|j|<}|St�||�S)z(Pluggable version of get_command_class()r>r^)�cmdclassrr�r_rSrXr��get_command_class)r$r9Zepsr�rgrrrrhos

zDistribution.get_command_classcC�:t�d�D]}|j|jvr|��}||j|j<qt�|�S�Nr>)rr�r?rgrRr��print_commands�r$r�rgrrrrk|��
zDistribution.print_commandscCrirj)rr�r?rgrRr��get_command_listrlrrrrn�rmzDistribution.get_command_listcK�@|��D]\}}t|d|d�}|r||�q|�||�qdS)a�Add items to distribution that are named in keyword arguments

        For example, 'dist.include(py_modules=["x"])' would add 'x' to
        the distribution's 'py_modules' attribute, if it was not already
        there.

        Currently, this method only supports inclusion for attributes that are
        lists or tuples.  If you need to add support for adding to other
        attributes in this or a subclass, you can add an '_include_X' method,
        where 'X' is the name of the attribute.  The method will be called with
        the value passed to 'include()'.  So, 'dist.include(foo={"bar":"baz"})'
        will try to call 'dist._include_foo({"bar":"baz"})', which can then
        handle whatever special inclusion logic is needed.
        Z	_include_N)ror#�
_include_misc)r$r�r�r��includerrrrq�s
�zDistribution.includecsj�d�|jr��fdd�|jD�|_|jr"��fdd�|jD�|_|jr3��fdd�|jD�|_dSdS)z9Remove packages, modules, and extensions in named packager�c�"g|]
}|�kr|���s|�qSr�r<�r��p��package�pfxrrr���z0Distribution.exclude_package.<locals>.<listcomp>crrrrsrtrvrrr��rycs&g|]}|j�kr|j���s|�qSr)r?r<rtrvrrr��s
�N)�packages�
py_modules�ext_modules)r$rwrrvr�exclude_package�s����zDistribution.exclude_packagecCs2|d}|��D]}||ks|�|�rdSqdS)z<Return true if 'exclude_package(package)' would do somethingr�TN)�iter_distribution_namesr<)r$rwrxrurrrr��s��zDistribution.has_contents_forc
s�t�t�s
td|�f��zt||�}Wnty'}ztd|�|�d}~ww|dur7t|t�s7t|d��|rHt||�fdd�|D��dSdS)zAHandle 'exclude()' for list/tuple attrs without a special handlerz(%s: setting must be a list or tuple (%r)� %s: No such distribution settingN�4: this setting cannot be changed via include/excludec�g|]}|�vr|�qSrr�r��item�r6rrr���z.Distribution._exclude_misc.<locals>.<listcomp>�r��sequencerr#r�r,)r$r?r6�oldr�rr�r�
_exclude_misc�s"

�����zDistribution._exclude_miscc
s�t|t�s
td||f��zt||��Wnty'}ztd|�|�d}~ww�dur4t|||�dSt�t�s?t|d���fdd�|D�}t||�|�dS)zAHandle 'include()' for list/tuple attrs without a special handlerz%s: setting must be a list (%r)rNr�cr�rrr��r�rrr��r�z.Distribution._include_misc.<locals>.<listcomp>r�)r$r?r6r��newrr�rrp�s 
��
�zDistribution._include_misccKro)aRemove items from distribution that are named in keyword arguments

        For example, 'dist.exclude(py_modules=["x"])' would remove 'x' from
        the distribution's 'py_modules' attribute.  Excluding packages uses
        the 'exclude_package()' method, so all of the package's contained
        packages, modules, and extensions are also excluded.

        Currently, this method only supports exclusion from attributes that are
        lists or tuples.  If you need to add support for excluding from other
        attributes in this or a subclass, you can add an '_exclude_X' method,
        where 'X' is the name of the attribute.  The method will be called with
        the value passed to 'exclude()'.  So, 'dist.exclude(foo={"bar":"baz"})'
        will try to call 'dist._exclude_foo({"bar":"baz"})', which can then
        handle whatever special exclusion logic is needed.
        Z	_exclude_N)ror#r�)r$r�r�r��excluderrrr��s
�zDistribution.excludecCs,t|t�std|f��tt|j|��dS)Nz.packages: setting must be a list or tuple (%r))r�r�rr�rr})r$rzrrr�_exclude_packages�s

�zDistribution._exclude_packagesc
Cs�|jj|_|jj|_|d}|�d�}||vr6||\}}||=ddl}|�|d�|dd�<|d}||vst�|||�}|�|�}	t	|	dd�rWd|f|�|�d<|durWgS|S)Nr�aliasesTrZcommand_consumes_arguments�command line�args)
�	__class__�global_optionsr+r'�shlexrRr��_parse_command_optsrhr#)
r$r/r�r9r�r4r5r��nargs�	cmd_classrrrr�s$


�
z Distribution._parse_command_optscCs�i}|j��D]W\}}|��D]N\}\}}|dkrq|�dd�}|dkrO|�|�}|j��}|�t|di��|��D]\}	}
|
|krI|	}d}nq;td��n|dkrUd}||�	|i�|<qq|S)	ahReturn a '{cmd: {opt:val}}' map of all command-line options

        Option names are all long, but do not include the leading '--', and
        contain dashes rather than underscores.  If the option doesn't take
        an argument (e.g. '--quiet'), the 'val' is 'None'.

        Note that options provided by config files are intentionally excluded.
        r�r8r7rr+NzShouldn't be able to get herer)
r*rorY�get_command_objr+�copy�updater#r�r�)r$�d�cmd�optsr3r4rZZcmdobjrK�neg�posrrr�get_cmdline_optionss.


���z Distribution.get_cmdline_optionsccsx�|jpdD]}|Vq|jpdD]}|Vq|jpdD]}t|t�r(|\}}n|j}|�d�r6|dd�}|VqdS)z@Yield all packages, modules, and extension names in distributionr�moduleNi����)rzr{r|r�r�r?r)r$�pkgr��extr?Z	buildinforrrr~Es�


�z$Distribution.iter_distribution_namesc
Cs�ddl}|jr
t�||�St|jtj�st�||�S|jj�	�dvr(t�||�S|jj}|jj
}|jdkr7dp8d}|jj}t�|j�
�d|||�|_zt�||�Wt�|j�
�||||�|_St�|j�
�||||�|_w)z�If there were any non-global "display-only" options
        (--help-commands or the metadata display options) on the command
        line, display the requested info and return true; else return
        false.
        rN)r�utf8�win32r)r)r�
help_commandsr��handle_display_optionsr��stdoutr"�
TextIOWrapperrr��errorsrG�line_buffering�detach)r$�option_orderrrr��newliner�rrrr�Ws*���z#Distribution.handle_display_optionsr�)NF)0r�
__module__�__qualname__�__doc__r�rZ
OrderedSetr�r�r�r�r��staticmethodr�r�r�r�r�r�rrrr6r(r;r)rMrOrTr\rYr`rfrSrhrkrnrqr}r�r�rpr�r�r�r�r~r�rrrrrmsh4�







O

.



	(c@seZdZdZdS)rzrClass for warning about deprecations in dist in
    setuptools. Not ignored by default, unlike DeprecationWarning.N)rr�r�r�rrrrr|sr)Vr:r"rr�rrr�Z
distutils.logr��distutils.core�
distutils.cmd�distutils.dist�distutils.command�distutils.utilr�distutils.debugr�distutils.fancy_getoptr�globrr�r.�typingrr	r
�collectionsr�emailr�distutils.errorsr
rrZdistutils.versionrZsetuptools.externrrZ setuptools.extern.more_itertoolsrr�rr�Zsetuptools.commandrZsetuptools.monkeyrZsetuptools.configrr�
email.messager�
__import__r r&rhr1r7r8r;r>rWr[r~r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��corerr�rrrrr�<module>s�-
>