AlkantarClanX12

Your IP : 3.14.249.124


Current Path : /opt/alt/python37/lib/python3.7/site-packages/setuptools/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/setuptools/__pycache__/dist.cpython-37.pyc

B

��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/m0Z0ddl1m2Z2ddl3Z3e�rpddl4m5Z5e6d�e6d�dd�Z7dd�Z8e9e9d�dd�Z:de9ee9d �d!d"�Z;de9ee9d �d#d$�Z<de9eee9d �d%d&�Z=dee9d'�d(d)�Z>d*d+�Z?d,d-�Z@d.d/�ZAeBeCfZDd0d1�ZEd2d3�ZFd4d5�ZGd6d7�ZHd8d9�ZId:d;�ZJd<d=�ZKd>d?�ZLd@dA�ZMdBdC�ZNdDdE�ZOdFdG�ZPdHdI�ZQe0ejRjS�ZTGdJd�deT�ZSGdKdL�dLe+�ZUdS)M�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-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/dist.py�_get_unpatched2srcCs&t|dd�}|dkr"td�}||_|S)N�metadata_versionz2.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r/r)�msg�fieldr&cCs||}|dkrdS|S)zRead Message header field.�UNKNOWNNr)r0r1�valuerrr�_read_field_from_msgGsr4cCst||�}|dkr|St|�S)z4Read Message header field and apply rfc822_unescape.N)r4r/)r0r1r3rrr�_read_field_unescaped_from_msgOs
r5cCs|�|d�}|gkrdS|S)z9Read Message header field and return all results as list.N)�get_all)r0r1�valuesrrr�_read_list_from_msgWsr8)r0r&cCs|����}|dkrdS|S)Nr2)�get_payload�strip)r0r3rrr�_read_payload_from_msg_sr;cCsVt|�}t|d�|_t|d�|_t|d�|_t|d�|_t|d�|_d|_t|d�|_	d|_
t|d�|_t|d	�|_
d
|kr�t|d
�|_nd|_t|d�|_|jdkr�|jtd�kr�t|�|_t|d�|_d
|kr�t|d
��d�|_t|d�|_t|d�|_|jtd�k�r4t|d�|_t|d�|_t|d�|_nd|_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�descriptionz2.1�keywords�,�platform�
classifierz1.1�requires�provides�	obsoleteszlicense-file)rrr r4r<r=rAr?�
maintainer�author_email�maintainer_email�urlr5r@�download_url�long_descriptionr;�splitrBr8�	platforms�classifiersrFrGrH�
license_files)r"�filer0rrr�
read_pkg_filefs<
rTcCs"d|krt�d�|�dd�}|S)Nr'z1newlines not allowed and will break in the future� )rr�replace)�valrrr�single_line�s
rXc
s�|��}�fdd�}|dt|��|d|���|d|���|dt|����|d|���d}x.|D]&\}}t||d	�}|d	k	rh|||�qhWt|�	��}|d
|�|j
r�|d|j
�x |j��D]}	|dd
|	�q�Wd�
|���}
|
r�|d|
�x|��D]}|d|��qW|��d|���|��d|���|��d|���|��d|���t|d��rv|d|j�|j�r�|d|j�|j�r�x|jD]}|d|��q�W|��d|j�p�g���d|���d	S)z0Write the PKG-INFO format data to a file object.cs��d||f�dS)Nz%s: %s
)�write)�keyr3)rSrr�write_field�sz#write_pkg_file.<locals>.write_fieldzMetadata-Version�Name�VersionZSummaryz	Home-page))ZAuthorr?)zAuthor-emailrJ)Z
MaintainerrI)zMaintainer-emailrKNZLicensezDownload-URLzProject-URLz%s, %srCZKeywords�Platform�
Classifier�Requires�Provides�	Obsoletes�python_requireszRequires-PythonzDescription-Content-TypezProvides-ExtrazLicense-Filez
%s

)r$�str�get_name�get_versionrX�get_description�get_urlr!r�get_licenserM�project_urls�itemsr+�get_keywords�
get_platforms�_write_list�get_classifiers�get_requires�get_provides�
get_obsoletes�hasattrrc�long_description_content_type�provides_extrasrRrY�get_long_description)
r"rSr=r[Zoptional_fieldsr1�attrZattr_valr@�project_urlrBrD�extrar)rSr�write_pkg_file�sH

rzcCs`ytj�d|�}|jrt�Wn<ttttfk
rZ}ztd||f�|�Wdd}~XYnXdS)Nzx=z4%r must be importable 'module:attrs' string (got %r))	�
pkg_resources�
EntryPoint�parse�extras�AssertionError�	TypeError�
ValueError�AttributeErrorr
)�distrwr3�ep�errr�check_importable�sr�cCsjy(t|ttf�st�d�|�|ks&t�Wn<ttttfk
rd}ztd||f�|�Wdd}~XYnXdS)z"Verify that value is a string list�z%%r must be a list of strings (got %r)N)	�
isinstance�list�tuplerr+r�r�r�r
)r�rwr3r�rrr�assert_string_list�sr�cCsh|}t|||�xR|D]J}|�|�s4tdd|��|�d�\}}}|r||krtj�d||�qWdS)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�rwr3Zns_packages�nsp�parent�sep�childrrr�	check_nsp�s

r�c
CsPytt�t|����Wn2tttfk
rJ}ztd�|�Wdd}~XYnXdS)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_extrarkr�r�r�r
)r�rwr3r�rrr�check_extras
sr�cCs<|�d�\}}}|r*t�|�r*td|��tt�|��dS)N�:zInvalid environment marker: )�	partitionr{�invalid_markerr
r��parse_requirements)ry�reqsr<r��markerrrrr�sr�cCs&t|�|kr"d}t|j||d���dS)z)Verify that value is True, False, 0, or 1z0{attr!r} must be a boolean value (got {value!r}))rwr3N)�boolr
�format)r�rwr3�tmplrrr�assert_boolsr�cCs,|st�|�d�t�dSt|�d���dS)Nz is ignored.z is invalid.)rrrr
)r�rwr3rrr�invalid_unless_false$sr�c
Csly(tt�|��t|ttf�r&td��Wn>ttfk
rf}zd}t|j	||d��|�Wdd}~XYnXdS)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})rw�errorN)
r�r{r�r��dict�setr�r�r
r�)r�rwr3r�r�rrr�check_requirements+sr�c
CsXytj�|�WnBtjjtfk
rR}zd}t|j||d��|�Wdd}~XYnXdS)z.Verify that value is a valid version specifierzF{attr!r} must be a string containing valid version specifiers; {error})rwr�N)r�
specifiers�SpecifierSet�InvalidSpecifierr�r
r�)r�rwr3r�r�rrr�check_specifier9s
r�c
CsBytj�|�Wn,tk
r<}zt|�|�Wdd}~XYnXdS)z)Verify that entry_points map is parseableN)r{r|�	parse_mapr�r
)r�rwr3r�rrr�check_entry_pointsDsr�cCst|t�std��dS)Nztest_suite must be a string)r�rdr
)r�rwr3rrr�check_test_suiteLs
r�cCs^t|t�std�|���x@|��D]4\}}t|t�sDtd�||���t|d�|�|�q"WdS)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�r
r�rkrdr�)r�rwr3�k�vrrr�check_package_dataQs

r�cCs,x&|D]}t�d|�stj�d|�qWdS)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�rwr3�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��ZdVd d!�Zd"d#�Zd$d%�Zd&d'�ZdWd(d)�ZdXd+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)YraGDistribution 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.
    cCsdS)Nrrrrr�<lambda>��zDistribution.<lambda>cCsdS)Nrrrrrr��r�cCsdS)Nrrrrrr��r�)rtrjru�license_filerRNcCsl|rd|ksd|krdSt�t|d����}tjj�|�}|dk	rh|�d�sht�t|d��|_	||_
dS)Nr<r=zPKG-INFO)r{�	safe_namerd�lower�working_set�by_key�get�has_metadata�safe_version�_version�
_patched_dist)r"�attrsrZr�rrr�patch_missing_pkg_info�sz#Distribution.patch_missing_pkg_infocs�t�d�}|si�_|pi}g�_|�dd��_��|�|�dg��_|�dg��_x$t�	d�D]}t
���|jd�qbWt
���fdd�|��D����|������jj���j_���dS)N�package_data�src_root�dependency_links�setup_requireszdistutils.setup_keywordscs i|]\}}|�jkr||�qSr)�_DISTUTILS_UNSUPPORTED_METADATA)�.0r�r�)r"rr�
<dictcomp>�sz)Distribution.__init__.<locals>.<dictcomp>)rsr��
dist_files�popr�r�r�r�r{�iter_entry_points�vars�
setdefaultr<�
_Distribution�__init__rk�_set_metadata_defaults�_normalize_version�_validate_version�metadatar=�_finalize_requires)r"r�Zhave_package_datar�r)r"rr��s&



zDistribution.__init__cCs8x2|j��D]$\}}t|j��||�||���qWdS)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�rkr�r�r�r�)r"r��option�defaultrrrr��sz#Distribution._set_metadata_defaultscCsPt|tj�s|dkr|Sttj�|��}||krLd}t�|j	ft
���|S|S)Nz)Normalizing '{version}' to '{normalized}')r��
setuptools�sicrdrr=r]rrr��locals)r=�
normalizedr�rrrr��szDistribution._normalize_versionc	Csbt|tj�rt|�}|dk	r^ytj�|�Wn0tjjtfk
r\t	�
d|�t�|�SX|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�Numberrdrr=r]�InvalidVersionr�rrr�r�)r=rrrr��szDistribution._validate_versioncCsjt|dd�r|j|j_t|dd�rVx2|j��D]$}|�d�d}|r.|jj�|�q.W|��|�	�dS)z�
        Set `metadata.python_requires` and fix environment markers
        in `install_requires` and `extras_require`.
        rcN�extras_requirer�r)
r!rcr�r��keysrOru�add�_convert_extras_requirements�"_move_install_requirements_markers)r"ryrrrr��s
zDistribution._finalize_requirescCspt|dd�pi}tt�|_xP|��D]D\}}|j|x0t�|�D]"}|�|�}|j||�|�qBWq$WdS)z�
        Convert requirements in `extras_require` of the form
        `"extra": ["barbazquux; {marker}"]` to
        `"extra:{marker}": ["barbazquux"]`.
        r�N)	r!r
r��_tmp_extras_requirerkr{r��_suffix_for�append)r"Z
spec_ext_reqs�sectionr��r�suffixrrrr�s


z)Distribution._convert_extras_requirementscCs|jrdt|j�SdS)ze
        For a requirement, return the 'extras_require' suffix for
        that requirement.
        r�r�)r�rd)�reqrrrr�!szDistribution._suffix_forcs�dd�}t�dd�pd}tt�|��}t||�}t�||�}ttt|���_	x&|D]}�j
dt|j��|�qRWt
�fdd��j
��D���_dS)	zv
        Move requirements in `install_requires` that are using environment
        markers `extras_require`.
        cSs|jS)N)r�)r�rrr�
is_simple_req3szFDistribution._move_install_requirements_markers.<locals>.is_simple_req�install_requiresNrr�c3s,|]$\}}|dd�t�j|�D�fVqdS)cSsg|]}t|��qSr)rd)r�r�rrr�
<listcomp>?szMDistribution._move_install_requirements_markers.<locals>.<genexpr>.<listcomp>N)�map�
_clean_req)r�r�r�)r"rr�	<genexpr>?szBDistribution._move_install_requirements_markers.<locals>.<genexpr>)r!r�r{r��filterr��filterfalser�rdr�r�r�r�r�rkr�)r"r�Zspec_inst_reqsZ	inst_reqsZsimple_reqsZcomplex_reqsr�r)r"rr�)s



z/Distribution._move_install_requirements_markerscCs
d|_|S)zP
        Given a Requirement, remove environment markers and return it.
        N)r�)r"r�rrrr�CszDistribution._clean_reqcCs`|jj}|r|ng}|jj}|r2||kr2|�|�|dkrF|dkrFd}tt|�|���|j_dS)z<Compute names of all license files which should be included.N)zLICEN[CS]E*zCOPYING*zNOTICE*zAUTHORS*)r�rRr�r�r�r�_expand_patterns)r"rR�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:|]2}tt|��D] }|�d�stj�|�r|VqqdS)�~N)�sortedr�endswith�os�path�isfile)r��patternr�rrrr�fsz0Distribution._expand_patterns.<locals>.<genexpr>r)r�rrrr�]s	zDistribution._expand_patternsc
Cs�ddlm}tjtjkrgnddddddd	d
ddd
ddg
}t|�}|dkrR|��}tr`|�d�|�}t	|_
x�|D]�}tj|dd��(}tr�|�dj
ft���|�|�WdQRXxt|��D]h}|�|�}|�|�}	xN|D]F}
|
dks�|
|kr�q�|�||
�}|�|
|�}
|�|
|�}
||f|	|
<q�Wq�W|��qrWd|jk�rDdSx�|jd��D]�\}
\}}|j�|
�}
|
�r~t|�}n|
dk�r�t|�}yt||
�p�|
|�Wn.tk
�r�}zt|�|�Wdd}~XYnX�qTWdS)z�
        Adapted from distutils.dist.Distribution.parse_config_files,
        this method provides the same functionality in subtly-improved
        ways.
        r)�ConfigParserzinstall-basezinstall-platbasezinstall-libzinstall-platlibzinstall-purelibzinstall-headerszinstall-scriptszinstall-data�prefixzexec-prefix�home�user�rootNz"Distribution.parse_config_files():zutf-8)�encodingz  reading {filename}�__name__�global)�verbose�dry_run)�configparserr��sysr�base_prefix�	frozenset�find_config_filesr�announcerd�optionxform�io�openr�r��	read_file�sections�options�get_option_dictr��warn_dash_deprecation�make_option_lowercaser��command_optionsrk�negative_optr�setattrr�r)r"�	filenamesr��ignore_options�parser�filename�readerr�r�opt_dict�optrW�src�aliasr�rrr�_parse_config_filesmsd





z Distribution._parse_config_filescCsd|dkr|S|�dd�}tjj|��}|�d�sF|dkrF||krF|Sd|kr`t�d||f�|S)N)zoptions.extras_requirezoptions.data_files�-�_rr�zrUsage of dash-separated '%s' will not be supported in future versions. Please use the underscore name '%s' instead)rVr��command�__all__�_setuptools_commands�
startswithrr)r"r!r�Zunderscore_opt�commandsrrrr�s
z"Distribution.warn_dash_deprecationcCs4yt�d�}t|�d��Stjk
r.gSXdS)Nr�zdistutils.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"r!r�Z
lowercase_optrrrr�sz"Distribution.make_option_lowercasecCsd|��}|dkr|�|�}tr,|�d|��x0|��D�]"\}\}}tr^|�d|||f�ydd�|jD�}Wntk
r�g}YnXy
|j}Wntk
r�i}YnXy|t|t	�}	||kr�|	r�t
|||t|��nJ||kr�|	r�t
||t|��n,t||��rt
|||�nt
d|||f��Wq8tk
�rZ}
zt
|
�|
�Wdd}
~
XYq8Xq8WdS)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)cSsg|]}t|��qSr)r)r��orrrr��sz5Distribution._set_command_options.<locals>.<listcomp>z1error in %s: command '%s' has no such option '%s')�get_command_namerrrrk�boolean_optionsr�rr�rdrrrsrr�)r"�command_obj�option_dict�command_namer��sourcer3�	bool_opts�neg_opt�	is_stringr�rrr�_set_command_options�s:




z!Distribution._set_command_optionsFcCs0|j|d�t||j|d�|��|��dS)zYParses configuration files from various levels
        and loads configuration.

        )r)�ignore_option_errorsN)r$rrr�r�)r"rr;rrr�parse_config_filess
zDistribution.parse_config_filescCs<tjjt�|�|jdd�}x|D]}tjj|dd�q W|S)zResolve pre-setup requirementsT)�	installer�replace_conflicting)rV)r{r��resolver��fetch_build_eggr�)r"rFZresolved_distsr�rrr�fetch_build_eggs$s
zDistribution.fetch_build_eggscCsTd}dd�}t�|�}t�|j|�}tdd�|�}xt||d�D]}||�q@WdS)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_order8sz/Distribution.finalize_options.<locals>.by_ordercSs|��S)N)�load)r�rrrr�=r�z/Distribution.finalize_options.<locals>.<lambda>)rZN)r{r�r�r��_removedr�r�)r"�grouprDZdefined�filteredZloadedr�rrr�finalize_options/s
zDistribution.finalize_optionscCsdh}|j|kS)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��removedrrrrFAs
zDistribution._removedcCsNxHt�d�D]:}t||jd�}|dk	r|j|jd�|��||j|�qWdS)Nzdistutils.setup_keywords)r=)r{r�r!r<�requirer@rE)r"r�r3rrr�_finalize_setup_keywordsOs
z%Distribution._finalize_setup_keywordsc	Csvtj�tjd�}tj�|�srt�|�t�|�tj�|d�}t|d��$}|�	d�|�	d�|�	d�WdQRX|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_filerrY)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)r@)Zsetuptools.installerr@)r"r�r@rrrr@iszDistribution.fetch_build_eggcCs`||jkr|j|St�d|�}x:|D]&}|j|jd�|��|j|<}|SWt�||�SdS)z(Pluggable version of get_command_class()zdistutils.commands)r=N)�cmdclassr{r�rKr@rEr��get_command_class)r"r'Zepsr�rSrrrrTos


zDistribution.get_command_classcCs>x2t�d�D]$}|j|jkr|��}||j|j<qWt�|�S)Nzdistutils.commands)r{r�r<rSr?r��print_commands)r"r�rSrrrrU|s
zDistribution.print_commandscCs>x2t�d�D]$}|j|jkr|��}||j|j<qWt�|�S)Nzdistutils.commands)r{r�r<rSr?r��get_command_list)r"r�rSrrrrV�s
zDistribution.get_command_listcKsDx>|��D]2\}}t|d|d�}|r0||�q
|�||�q
WdS)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)rkr!�
_include_misc)r"r�r�r��includerrrrX�s

zDistribution.includecsf�d�|jr&��fdd�|jD�|_|jrD��fdd�|jD�|_|jrb��fdd�|jD�|_dS)z9Remove packages, modules, and extensions in named packager�cs"g|]}|�kr|���s|�qSr)r*)r��p)�package�pfxrrr��sz0Distribution.exclude_package.<locals>.<listcomp>cs"g|]}|�kr|���s|�qSr)r*)r�rY)rZr[rrr��scs&g|]}|j�kr|j���s|�qSr)r<r*)r�rY)rZr[rrr��sN)�packages�
py_modules�ext_modules)r"rZr)rZr[r�exclude_package�szDistribution.exclude_packagecCs4|d}x&|��D]}||ks(|�|�rdSqWdS)z<Return true if 'exclude_package(package)' would do somethingr�TN)�iter_distribution_namesr*)r"rZr[rYrrrr��szDistribution.has_contents_forc
s�t�t�std|�f��yt||�}Wn0tk
rX}ztd|�|�Wdd}~XYnX|dk	rzt|t�szt|d��n|r�t||�fdd�|D��dS)zAHandle 'exclude()' for list/tuple attrs without a special handlerz(%s: setting must be a list or tuple (%r)z %s: No such distribution settingNz4: this setting cannot be changed via include/excludecsg|]}|�kr|�qSrr)r��item)r3rrr��sz.Distribution._exclude_misc.<locals>.<listcomp>)r��sequencer
r!r�r)r"r<r3�oldr�r)r3r�
_exclude_misc�s
 zDistribution._exclude_miscc
s�t|t�std||f��yt||��Wn0tk
rX}ztd|�|�Wdd}~XYnX�dkrpt|||�n:t�t�s�t|d��n"�fdd�|D�}t||�|�dS)zAHandle 'include()' for list/tuple attrs without a special handlerz%s: setting must be a list (%r)z %s: No such distribution settingNz4: this setting cannot be changed via include/excludecsg|]}|�kr|�qSrr)r�ra)rcrrr��sz.Distribution._include_misc.<locals>.<listcomp>)r�rbr
r!r�r)r"r<r3r��newr)rcrrW�s
 
zDistribution._include_misccKsDx>|��D]2\}}t|d|d�}|r0||�q
|�||�q
WdS)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)rkr!rd)r"r�r�r��excluderrrrf�s

zDistribution.excludecCs,t|t�std|f��tt|j|��dS)Nz.packages: setting must be a list or tuple (%r))r�rbr
r�r�r_)r"r\rrr�_exclude_packages�s
zDistribution._exclude_packagesc
Cs�|jj|_|jj|_|d}|�d�}xB||krh||\}}||=ddl}|�|d�|dd�<|d}q(Wt�|||�}|�|�}	t	|	dd�r�d|f|�|�d<|dk	r�gS|S)Nr�aliasesTrZcommand_consumes_argumentszcommand line�args)
�	__class__�global_optionsrr�shlexrOr��_parse_command_optsrTr!)
r"rrir'rhr"r#rl�nargs�	cmd_classrrrrms"




z Distribution._parse_command_optscCs�i}x�|j��D]�\}}x�|��D]�\}\}}|dkr8q"|�dd�}|dkr�|�|�}|j��}|�t|di��x<|��D]\}	}
|
|kr||	}d}Pq|Wtd��n|dkr�d}||�	|i�|<q"WqW|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.
        zcommand liner&r%rrNzShouldn't be able to get herer)
rrkrV�get_command_objr�copy�updater!rr�)r"�d�cmd�optsr!r"rWZcmdobjr8�neg�posrrr�get_cmdline_optionss(



z Distribution.get_cmdline_optionsccs�x|jp
dD]
}|VqWx|jp$dD]
}|Vq&WxH|jp>dD]:}t|t�rX|\}}n|j}|�d�rt|dd�}|Vq@WdS)z@Yield all packages, modules, and extension names in distributionr�moduleNi����)r\r]r^r�r�r<r�)r"�pkgry�extr<Z	buildinforrrr`Es




z$Distribution.iter_distribution_namesc
Cs�ddl}|jrt�||�St|jtj�s4t�||�S|jj�	�dkrPt�||�S|jj}|jj
}|jdkrndppd}|jj}t�|j�
�d|||�|_zt�||�St�|j�
�||||�|_XdS)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)zutf-8�utf8�win32r'zutf-8)r
�
help_commandsr��handle_display_optionsr��stdoutr�
TextIOWrapperrr��errorsrD�line_buffering�detach)r"�option_orderr
rr��newliner�rrrrWs"z#Distribution.handle_display_options)N)N)N)NF)0r�
__module__�__qualname__�__doc__r�rZ
OrderedSetr�r�r�r�r��staticmethodr�r�r�r�r�r�r�r�r�r$rr)rr:r<rArIrFrLrRr@rTrUrVrXr_r�rdrWrfrgrmrxr`rrrrrrmsZ2


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(rr
r�r�rr�Z
distutils.logr��distutils.core�
distutils.cmd�distutils.dist�distutils.command�distutils.utilr�distutils.debugr�distutils.fancy_getoptr�globrr�r,�typingrrr	�collectionsr
�emailr�distutils.errorsrr
rZdistutils.versionrZsetuptools.externrrZ setuptools.extern.more_itertoolsrr�rr�Zsetuptools.commandrZsetuptools.monkeyrZsetuptools.configrr{�
email.messager�
__import__rr$rdr/r4r5r8r;rTrXrzr�r�rbr�r�r�r�r�r�r�r�r�r�r�r�r��corerr�rrrrr�<module>s�-
>