HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/setuptools/__pycache__/dist.cpython-310.pyc
o

�N�g��@s2dgZddlZddlZddlZddlZddlZddlZddlmZddl	m
Z
ddlmZddl
mZmZmZddlZddlZddlZddlZddlZddlmZddlmZmZdd	lmZdd
lmZddl m!Z!m"Z"dd
l#m$Z$ddl%m&Z&m'Z'ddl(m)Z)m*Z*ddl+m,Z,m-Z-ddl.m/Z/ddl.m0Z0ddl.m1Z1ddl.m2Z3ddl4m5Z5ddl6m7Z7m8Z8ddl9m:Z:ddl;m<Z<ddl=m>Z>m?Z?e@eAfZBdd�ZCdd�ZDdd�ZEd d!�ZFd"d#�ZGd$d%�ZHd&d'�ZId(d)�ZJd*d+�ZKd,d-�ZLd.d/�ZMd0d1�ZNd2d3�ZOd4d5�ZPe<ejQjR�ZSGd6d�deS�ZRGd7d8�d8e?�ZTdS)9�Distribution�N)�suppress)�iglob)�Path)�List�Optional�Set)�DEBUG)�DistutilsOptionError�DistutilsSetupError��translate_longopt)�	strtobool�)�	partition�unique_everseen)�
OrderedSet)�
InvalidMarker�Marker)�InvalidSpecifier�SpecifierSet)�InvalidVersion�Version)�
_entry_points)�_normalization)�_reqs)�command)�metadata)�setupcfg�
pyprojecttoml)�ConfigDiscovery)�
get_unpatched)�InformationOnly�SetuptoolsDeprecationWarningcCsTztj|ddd�}|jrJ�WdSttttfy)}z	td||f�|�d}~ww)N)�value�name�groupz4%r must be importable 'module:attrs' string (got %r))rZ
EntryPoint�extras�	TypeError�
ValueError�AttributeError�AssertionErrorr)�dist�attrr$�ep�e�r0�C/opt/saltstack/salt/lib/python3.10/site-packages/setuptools/dist.py�check_importable-s
����r2cCs^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�tuple�joinr(r)r*r+r�r,r-r$r/r0r0r1�assert_string_list7s
����r9cCst|}t|||�|D]-}|�|�stdd|��|�d�\}}}|r/||vr/tj�d||�tjdddd�q
d	S)
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.pyz/The namespace_packages parameter is deprecated.z<Please replace its usage with implicit namespaces (PEP 420).z3references/keywords.html#keyword-namespace-packages)�see_docsN)	r9�has_contents_forr�
rpartition�	distutils�log�warnr#�emit)r,r-r$Zns_packagesZnsp�parent�sep�childr0r0r1�	check_nspEs,
�����rEc
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)	r5�	itertools�starmap�_check_extra�itemsr(r)r*rr8r0r0r1�check_extrasbs����rJcCsZ|�d�\}}}zt|�Wnty#d|�d|�d�}t|�d�wtt�|��dS)N�:zInvalid environment marker: z (�))r�
_check_markerrrr5r�parse)�extraZreqsr%rC�marker�msgr0r0r1rHns
�rHcCs|sdSt|�}|��dS�N)rZevaluate)rP�mr0r0r1rMxsrMcCs&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-r$N)�boolr�format)r,r-r$�tmplr0r0r1�assert_bools�rWcCs&|st�|�d��dSt|�d���)Nz is ignored.z is invalid.)�DistDeprecationWarningrAr�r,r-r$r0r0r1�invalid_unless_false�srZc
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)
r5rrNr4�dict�setr(r)rrU�r,r-r$r\rVr0r0r1�check_requirements�s����r`c
CsDzt|�WdSttfy!}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)rrr*rrUr_r0r0r1�check_specifier�s���rac
Cs4zt�|�WdSty}zt|�|�d}~ww)z)Verify that entry_points map is parseableN)r�load�	Exceptionrr8r0r0r1�check_entry_points�s
��rdcCst|t�s	td��dS)Nztest_suite must be a string)r4�strrrYr0r0r1�check_test_suite�s
�rfcCsZt|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)r4r]rrUrIrer9)r,r-r$�k�vr0r0r1�check_package_data�s
�

��ricCs(|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-r$Zpkgnamer0r0r1�check_packages�s���rlcs�eZdZdZdd�eedd�dd�eed�ZdZdd	�Z	dUd
d�Z
dd
�Zdd�Ze
dd��Ze
dd��Zdd�Zdd�Zdd�Ze
dd��ZdUdd�Zdd�Zd d!�Zd"d#�ZdUd$d%�Zd&d'�ZdVd)d*�Zd+d,�Zd-d.�Ze
d/d0��Zd1d2�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.�fdSdT�Z/�Z0S)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�dSrRr0r0r0r0r1�<lambda>�zDistribution.<lambda>cCrmrRr0r0r0r0r1rnrocCrmrRr0r0r0r0r1rn	ro)Zlong_description_content_typeZproject_urls�provides_extras�license_file�
license_files�install_requires�extras_requireNcCs�|r
d|vs
d|vrdSt�t|d����}ttj��4t�|�}|dur@|�d�sHt�	t|d��|_
||_Wd�dSWd�dSWd�dS1sSwYdS)Nr%�versionzPKG-INFO)rZ	safe_namere�lowerrr�PackageNotFoundError�distribution�	read_textZsafe_version�_version�
_patched_dist)�self�attrsr%r,r0r0r1�patch_missing_pkg_infos
��"�z#Distribution.patch_missing_pkg_infocs�t|d�}|s
i|_|p
i}g|_|�dd�|_|�|�|�dg�|_|�dg�|_tj	dd�D]}t
|��|jd�q1t
|j���ddh8��fd	d
�|��D�}t�||�t
�|_t|�|_|�|�|�|�|jj��|j_|��dS)N�package_data�src_root�dependency_links�setup_requires�distutils.setup_keywords�r&rsrtcsi|]\}}|�vr||�qSr0r0��.0rgrh�Z
metadata_onlyr0r1�
<dictcomp>.sz)Distribution.__init__.<locals>.<dictcomp>)�hasattrrZ
dist_files�popr�r~r�r�r�entry_points�vars�
setdefaultr%r^�_DISTUTILS_UNSUPPORTED_METADATArI�
_Distribution�__init__Z_referenced_filesr �set_defaults�_set_metadata_defaults�_normalize_version�_validate_versionru�_finalize_requires)r|r}Zhave_package_datar.Z
dist_attrsr0r�r1r�s,




�zDistribution.__init__cs@dh}�fdd�t�j�D�}||}|rd|��}t|��dS)Nr%cs"h|]
}t�j|d�dur|�qSrR)�getattrr)r��key�r|r0r1�	<setcomp>As
�z2Distribution._validate_metadata.<locals>.<setcomp>z&Required package metadata is missing: )r�rr)r|�requiredZprovided�missingrQr0r�r1�_validate_metadata?s
�
�zDistribution._validate_metadatacCs4|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�rIr�rr��get)r|r}�option�defaultr0r0r1r�Ls�z#Distribution._set_metadata_defaultscCsVddlm}t||�s|dur|Stt|��}||kr)t�d|�d|�d��|S|S)Nr��sicz
Normalizing 'z' to '�')r3r�r4rerr"rA)rur�Z
normalizedr0r0r1r�VszDistribution._normalize_versionc	Cstt|tj�r
t|�}|dur8zt|�W|Sttfy7ddlm}t	j
d|�d�dddd�||�YSw|S)	Nrr�zInvalid version: r:z�
                    The version specified is not a valid version according to PEP 440.
                    This may not work as expected with newer versions of
                    setuptools, pip, and PyPI.
                    z!https://peps.python.org/pep-0440/�i��	�)Zsee_url�due_date)r4�numbers�Numberrerrr(r3r�r#rA)rur�r0r0r1r�cs"
�
��zDistribution._validate_versioncCspt|dd�r|j|j_|��|j|j_|j|j_|jr4|j��D]}|�d�d}|r3|jj�	|�q!dSdS)z�
        Set `metadata.python_requires` and fix environment markers
        in `install_requires` and `extras_require`.
        �python_requiresNrKr)
r�r�r�_normalize_requiresrsrt�keys�splitrp�add)r|rOr0r0r1r�~s


��zDistribution._finalize_requirescCsNt|dd�pg}t|dd�pi}tttt�|���|_dd�|��D�|_dS)zAMake sure requirement-related attributes exist and are normalizedrsNrtc	Ss*i|]\}}|tttt�|pg����qSr0)r5�maprerrNr�r0r0r1r��s�z4Distribution._normalize_requires.<locals>.<dictcomp>)	r�r5r�rerrNrsrIrt)r|rsrtr0r0r1r��s�z Distribution._normalize_requirescCs`|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*)rrrrq�appendr5r�_expand_patterns)r|rr�patternsrqr0r0r1�_finalize_license_files�s
�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�r0r0r1�	<genexpr>�s�
��
��z0Distribution._expand_patterns.<locals>.<genexpr>r0)r�r0r0r1r��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_runr0)Zconfigparserr��sysr��base_prefix�	frozensetZfind_config_filesr	�announcereZoptionxform�io�openrU�localsZ	read_fileZsections�options�get_option_dictr��warn_dash_deprecation�make_option_lowercaser��command_optionsrI�negative_optr�setattrr)r
)r|�	filenamesr�Zignore_options�parser�filename�reader�sectionr�Zopt_dict�opt�val�src�aliasr/r0r0r1�_parse_config_files�sZ��
�

�


���z Distribution._parse_config_filescCsz|dvr|S|�dd�}tt�tjj|����}|�d�s'|dkr'||vr'|Sd|vr;t	j
dd|�d|�d	�d
dd�|S)
N)zoptions.extras_requirezoptions.data_files�-�_r�rzInvalid dash-separated optionsz)
                Usage of dash-separated zZ will not be supported in future
                versions. Please use the underscore name z instead.
                �!userguide/declarative_config.htmlr��r;r�)�replacer5rF�chainr>r�__all__�_setuptools_commands�
startswithr#rA)r|r�r�Zunderscore_optZcommandsr0r0r1r�s4������
z"Distribution.warn_dash_deprecationcCs*zt�d�jjWStjygYSw)NZ
setuptools)rrxr��namesrwr�r0r0r1r�.s
�z!Distribution._setuptools_commandsc	CsF|dks|��r
|S|��}tjdd|�d|�d|�d�ddd	�|S)
NrzInvalid uppercase configurationz$
            Usage of uppercase key z in zL will not be supported in
            future versions. Please use lowercase z instead.
            r�r�r�)�islowerrvr#rA)r|r�r�Z
lowercase_optr0r0r1r�5s ����
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)cSsg|]}t|��qSr0r)r��or0r0r1�
<listcomp>]sz5Distribution._set_command_options.<locals>.<listcomp>z1error in %s: command '%s' has no such option '%s')Zget_command_namer�r	r�rIZboolean_optionsr*r�r4rer�rr�r
r))r|Zcommand_objZoption_dictZcommand_namer��sourcer$Z	bool_opts�neg_optZ	is_stringr/r0r0r1�_set_command_optionsGsJ
�
�

���
���z!Distribution._set_command_optionscCsbg}t|jptjd�}|dur&tdd�|�}t|d�}t|d�}||fS|��r-|g}||fS)z/Add default file and split between INI and TOMLzpyproject.tomlNcSst|�jdkS)Nz.toml)r�suffix)�fr0r0r1rnzsz8Distribution._get_project_config_files.<locals>.<lambda>rr)rr�r��curdirrr5�exists)r|r��	tomlfilesZstandard_project_metadata�partsr0r0r1�_get_project_config_filesus�z&Distribution._get_project_config_filesFcCsX|�|�\}}|j|d�tj||j|d�|D]	}t�|||�q|��|��dS)zXParses configuration files from various levels
        and loads configuration.
        )r�)�ignore_option_errorsN)	r�r�rZparse_configurationr�rZapply_configurationr�r�)r|r�r�Zinifilesr�r�r0r0r1�parse_config_files�s�zDistribution.parse_config_filescC�ddlm}|||�S)zResolve pre-setup requirementsr)�_fetch_build_eggs)�	installerr�)r|Zrequiresr�r0r0r1�fetch_build_eggs��
zDistribution.fetch_build_eggscCsRd}dd�}tj|d�}t�|j|�}tdd�|�}t||d�D]}||�q dS)	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�)�hookr0r0r1�by_order�sz/Distribution.finalize_options.<locals>.by_orderr�cSs|��SrR)rb)r/r0r0r1rn�sz/Distribution.finalize_options.<locals>.<lambda>)r�N)rr�rF�filterfalse�_removedr�r�)r|r&r�ZdefinedZfilteredZloadedr.r0r0r1�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.Zremovedr0r0r1r�s
�
zDistribution._removedcCs>tjdd�D]}t||jd�}|dur|��||j|�qdS)Nr�r�)rr�r�r%rb)r|r.r$r0r0r1�_finalize_setup_keywords�s��z%Distribution._finalize_setup_keywordscCs�ddlm}tj�tjd�}tj�|�sJt�|�|�|�tj�|d�}t	|d��}|�
d�|�
d�|�
d�Wd�|S1sEwY|S)	Nr)�windows_supportz.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.

)r3rr�r�r7r�r��mkdirZ	hide_filer��write)r|rZ
egg_cache_dirZreadme_txt_filenamer�r0r0r1�get_egg_cache_dir�s$

��
��zDistribution.get_egg_cache_dircCr�)z Fetch an egg needed for buildingr)�fetch_build_egg)r�r	)r|Zreqr	r0r0r1r	�r�zDistribution.fetch_build_eggcCsP||jvr
|j|Stjd|d�}|D]}|��|j|<}|St�||�S)z(Pluggable version of get_command_class()�distutils.commands)r&r%)�cmdclassrr�rbr��get_command_class)r|rZepsr.rr0r0r1r�s

zDistribution.get_command_classcC�<tjdd�D]}|j|jvr|��}||j|j<qt�|�S�Nr
r�)rr�r%rrbr��print_commands�r|r.rr0r0r1r���
zDistribution.print_commandscCr
r)rr�r%rrbr��get_command_listrr0r0r1r�rzDistribution.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)rIr��
_include_misc)r|r}rgrh�includer0r0r1r�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|�qSr0�r��r��p��package�pfxr0r1r��z0Distribution.exclude_package.<locals>.<listcomp>crr0rrrr0r1r�rcs&g|]}|j�kr|j���s|�qSr0)r%r�rrr0r1r�s
�N)�packages�
py_modules�ext_modules)r|rr0rr1�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|rrrr0r0r1r<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|�qSr0r0�r��item�r$r0r1r�6�z.Distribution._exclude_misc.<locals>.<listcomp>�r4�sequencerr�r*r�)r|r%r$�oldr/r0r(r1�
_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)r#Nr$cr%r0r0r&�r,r0r1r�Hr)z.Distribution._include_misc.<locals>.<listcomp>r*)r|r%r$r/�newr0r.r1r8s 
��
�zDistribution._include_misccKr)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)rIr�r-)r|r}rgrh�excluder0r0r1r0Ks
�zDistribution.excludecCs,t|t�std|f��tt|j|��dS)Nz.packages: setting must be a list or tuple (%r))r4r+rr5r�r!)r|rr0r0r1�_exclude_packagesbs

�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��shlexr�r��_parse_command_optsrr�)
r|r�r4rr2r�r�r7�nargsZ	cmd_classr0r0r1r8is$


�
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.
        r3r�r�rr�NzShouldn't be able to get herer)
r�rIr�Zget_command_objr��copy�updater�r+r�)r|�d�cmd�optsr�r�r�Zcmdobjr��neg�posr0r0r1�get_cmdline_options�s.


���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 distributionr0�moduleNi����)rrr r4r6r%r�)r|ZpkgrB�extr%Z	buildinfor0r0r1r"�s�


�z$Distribution.iter_distribution_namesc	Cs�ddl}|jr
t�||�St|jtj�st�||�S|jj�	�dvr(t�||�S|jj}|jj
dd�zt�||�W|jj
|d�S|jj
|d�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��utf8r�r�)r�Z
help_commandsr��handle_display_optionsr4�stdoutr��
TextIOWrapperr�rv�reconfigure)r|Zoption_orderr�r�r0r0r1rE�s z#Distribution.handle_display_optionscs|��t��|�dSrR)r��super�run_command)r|r�r5r0r1rJ�szDistribution.run_commandrR)NF)1r��
__module__�__qualname__�__doc__r]rr5r�r{r~r�r�r��staticmethodr�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr	rrrrr!r<r-rr0r1r8rAr"rErJ�
__classcell__r0r0rKr1r�sj4�

!



	

O"
.


	&c@seZdZdZdS)rXzrClass for warning about deprecations in dist in
    setuptools. Not ignored by default, unlike DeprecationWarning.N)r�rLrMrNr0r0r0r1rX�srX)Ur�r�rFr�r�rjr��
contextlibr�globr�pathlibr�typingrrrZ
distutils.cmdr>Zdistutils.commandZdistutils.coreZdistutils.distZ
distutils.logZdistutils.debugr	Zdistutils.errorsr
rZdistutils.fancy_getoptr
Zdistutils.utilrZextern.more_itertoolsrrZextern.ordered_setrZextern.packaging.markersrrZextern.packaging.specifiersrrZextern.packaging.versionrrr3rrrrr�Z
_importlibrZconfigrrZ	discoveryr Zmonkeyr!�warningsr"r#r6r5r+r2r9rErJrHrMrWrZr`rardrfrirl�corerr�rXr0r0r0r1�<module>st