Spade
Mini Shell
| Directory:~$ /proc/self/root/usr/lib/python3.6/site-packages/setuptools/__pycache__/ |
| [Home] [System Details] [Kill Me] |
3
J$�\u��@s�dgZddlZddlZddlZddlZddlZddlZddlZddl Zddl
Z
ddlmZddl
mZmZmZddlmZddlmZddlmZddlmZdd lmZmZmZdd
lmZddlmZddl
m!Z!dd
l"m#Z#ddl$Z$ddl%m&Z&e'd�e'd�dd�Z(dd�Z)dd�Z*e+e,fZ-dd�Z.dd�Z/dd�Z0dd�Z1d
d!�Z2d"d#�Z3d$d%�Z4d&d'�Z5d(d)�Z6d*d+�Z7d,d-�Z8d.d/�Z9e!ej:j;�Z<Gd0d�de&e<�Z;Gd1d2�d2�Z=dS)3�Distribution�N)�defaultdict)�DistutilsOptionError�DistutilsPlatformError�DistutilsSetupError)�
rfc822_escape)�
StrictVersion)�six)� packaging)�map�filter�filterfalse)�Require)�windows_support)�
get_unpatched)�parse_configuration�)�Distribution_parse_config_filesz&setuptools.extern.packaging.specifiersz#setuptools.extern.packaging.versioncCstjdt�t|�S)NzDo
not call this
function)�warnings�warn�DeprecationWarningr)�cls�r�/usr/lib/python3.6/dist.py�_get_unpatched#srcCsn|js|jrtd�S|jdk s8|jdk s8t|dd�dk r@td�S|js^|js^|js^|j s^|j
rftd�Std�S)Nz2.1�python_requiresz1.2z1.1z1.0)�long_description_content_type�provides_extrasr�
maintainer�maintainer_email�getattrZprovides�requiresZ obsoletesZclassifiers�download_url)Zdist_mdrrr�get_metadata_version(s
r#cCsPt|�}|jd|�|jd|j��|jd|j��|jd|j��|jd|j��|td�kr�|jd|j��|jd|j��nJd'}xD|D]<\}}t ||�}t
jr�|j|�}|dk r�|jd||f�q�W|jd|j
��|j�r|jd|j�x"|jj�D]}|jd|��qWt|j��}|jd|�dj|j��} | �rd|jd| �|td�k�r�x4|j�D]}
|jd|
��q|Wn|j|d|j��|j|d|j��|j|d|j��|j|d|j��|j|d|j��t|d��r|jd
|j�|j�r$|jd!|j�|j�rLx|jD]}|jd"|��q4WdS)(z5Write
the PKG-INFO format data to a file object.
zMetadata-Version: %s
z Name: %s
zVersion: %s
zSummary: %s
zHome-page: %s
z1.2zAuthor: %s
zAuthor-email: %s
�Author�author�Author-email�author_email�
Maintainerr�Maintainer-emailrNz%s: %s
zLicense: %s
zDownload-URL: %s
zProject-URL: %s, %s
zDescription: %s
�,z
Keywords: %s
z
Platform: %s
ZPlatformZ
ClassifierZRequiresZProvidesZ ObsoletesrzRequires-Python: %s
zDescription-Content-Type: %s
zProvides-Extra: %s
�r$r%�r&r'�r(r�r)r)r+r,r-r.)r#�writeZget_nameZget_versionZget_descriptionZget_urlrZget_contactZget_contact_emailr
r �PY2Z
_encode_fieldZget_licenser"�project_urls�itemsrZget_long_description�joinZget_keywordsZ
get_platformsZ_write_listZget_classifiersZget_requiresZget_providesZ
get_obsoletes�hasattrrrr)�self�file�versionZoptional_fieldsZfield�attrZattr_valZproject_urlZ long_desc�keywords�platform�extrarrr�write_pkg_file7s\
r<cCsFytjjd|�}Wn,ttttfk
r@td||f��YnXdS)Nzx=z4%r must be importable
'module:attrs' string (got %r))�
pkg_resources�
EntryPoint�parse� TypeError�
ValueError�AttributeError�AssertionErrorr)�distr8�value�eprrr�check_importable�srGcCs6yWn,ttttfk
r0td||f��YnXdS)z*Verify that value is a string list or
Nonez%%r must be a list of strings (got
%r)N)r@rArBrCr)rDr8rErrr�assert_string_list�s
rHcCsh|}t|||�xR|D]J}|j|�s4tdd|��|jd�\}}}|r||krtjjd||�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)rH�has_contents_forr�
rpartition� distutils�logr)rDr8rEZns_packagesZnsp�parent�sepZchildrrr� check_nsp�s
rPc
Cs@yttjt|j���Wn"tttfk
r:td��YnXdS)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) �list� itertools�starmap�_check_extrar2r@rArBr)rDr8rErrr�check_extras�s
rUcCs<|jd�\}}}|r*tj|�r*td|��ttj|��dS)N�:zInvalid
environment marker:
)� partitionr=Zinvalid_markerrrQ�parse_requirements)r;Zreqs�namerO�markerrrrrT�srTcCs&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}))r8rEN)�boolr�format)rDr8rE�tmplrrr�assert_bool�sr^cCsjy(ttj|��t|ttf�r&td��Wn<ttfk
rd}zd}t|j ||d���WYdd}~XnXdS)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})r8�errorN)
rQr=rX�
isinstance�dict�setr@rArr\)rDr8rEr_r]rrr�check_requirements�srccCsRytjj|�Wn<tjjk
rL}zd}t|j||d���WYdd}~XnXdS)z.Verify that value
is a valid version specifierzF{attr!r} must be a string containing valid
version specifiers; {error})r8r_N)r
Z
specifiersZSpecifierSetZInvalidSpecifierrr\)rDr8rEr_r]rrr�check_specifier�s
rdcCs@ytjj|�Wn*tk
r:}zt|��WYdd}~XnXdS)z)Verify that entry_points map is
parseableN)r=r>Z parse_maprAr)rDr8rE�errr�check_entry_points�srfcCst|tj�std��dS)Nztest_suite
must be a
string)r`r Zstring_typesr)rDr8rErrr�check_test_suite�srgcCsdt|t�rTxH|j�D]8\}}t|t�s(Pyt|�Wqtk
rJPYqXqWdSt|d��dS)z@Verify that value is a dictionary of
package names to glob listsNzI must be a dictionary mapping package names
to lists of wildcard
patterns)r`rar2�str�iterr@r)rDr8rE�k�vrrr�check_package_data�s
rlcCs,x&|D]}tjd|�stjjd|�qWdS)Nz\w+(\.\w+)*z[WARNING:
%r not a valid package name; please use only .-separated package names in
setup.py)�re�matchrLrMr)rDr8rEZpkgnamerrr�check_packages�s
roc@s0eZdZdZdeed�ZdZdd�ZdGdd�Z dd �Z
d
d�Zedd
��Z
dd�Zdd�ZdHdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd
�Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Z
d5d6�Z!d7d8�Z"d9d:�Z#d;d<�Z$d=d>�Z%d?d@�Z&dAdB�Z'dCdD�Z(dEdF�Z)dS)Ira�Distribution
with support for features, 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.
'features' **deprecated** -- a dictionary mapping option
names to
'setuptools.Feature'
objects. Features are a portion of the distribution that can be
included or excluded based on user options, inter-feature
dependencies,
and availability on the current system. Excluded features are
omitted
from all setup commands, including source and binary distributions,
so
you can create multiple distributions from the same source tree.
Feature names should be valid Python identifiers, except that they
may
contain the '-' (minus) sign. Features can be included
or excluded
via the command line options '--with-X' and
'--without-X', where 'X' is
the name of the feature. Whether a feature is included by default,
and
whether you are allowed to control this from the command line, is
determined by the Feature object. See the 'Feature'
class for more
information.
'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. They are used by the feature subsystem to configure
the
distribution for the included and excluded features.
N)rr1rcCsp|sd|ksd|krdStjt|d��j�}tjjj|�}|dk rl|jd�rltjt|d��|_ ||_
dS)NrYr7zPKG-INFO)r=Z safe_namerh�lower�working_setZby_key�getZhas_metadataZsafe_versionZ_version�
_patched_dist)r5�attrs�keyrDrrr�patch_missing_pkg_infoSsz#Distribution.patch_missing_pkg_infoc
s�t�d�}|si�_|pi}d|ks,d|kr4tj�g�_i�_g�_|jdd��_�j |�|jdg��_
|jdg��_x$tj
d�D]}t��j|jd�q�Wtj��fdd �|j�D��x\�jj�D]N\}}x6�jj|fD]}||kr�||}Pq�W|�r|�nd}t�j||�q�Wt�jjtj��r>t�jj��j_�jjdk �r�yHtjj�jj�}t|�} �jj| k�r�tj
d
�jj| f�| �j_Wn0tjj!t"fk
�r�tj
d�jj�YnX�j#�dS)N�package_data�features�require_features�src_root�dependency_links�setup_requireszdistutils.setup_keywordscs
i|]\}}|�jkr||�qSr)�_DISTUTILS_UNSUPPORTED_METADATA)�.0rjrk)r5rr�
<dictcomp>qsz)Distribution.__init__.<locals>.<dictcomp>zNormalizing
'%s' to '%s'z�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.)$r4rw�Feature�warn_deprecatedryrxZ
dist_files�poprzrvr{r|r=�iter_entry_points�vars�
setdefaultrY�
_Distribution�__init__r2r}�metadata�__dict__�setattrr`r7�numbers�Numberrhr
ZVersionrrZInvalidVersionr@�_finalize_requires)
r5rtZhave_package_datarFZoption�default�sourcerEZverZnormalized_versionr)r5rr�`sR
zDistribution.__init__cCsjt|dd�r|j|j_t|dd�rVx2|jj�D]$}|jd�d}|r.|jjj|�q.W|j�|j �dS)z�
Set `metadata.python_requires` and fix environment markers
in `install_requires` and `extras_require`.
rN�extras_requirerVr)
r
rr�r��keys�splitr�add�_convert_extras_requirements�"_move_install_requirements_markers)r5r;rrrr��s
zDistribution._finalize_requirescCspt|dd�pi}tt�|_xP|j�D]D\}}|j|x0tj|�D]"}|j|�}|j||j|�qBWq$WdS)z�
Convert requirements in `extras_require` of the form
`"extra": ["barbazquux; {marker}"]` to
`"extra:{marker}": ["barbazquux"]`.
r�N) r
rrQ�_tmp_extras_requirer2r=rX�_suffix_for�append)r5Z
spec_ext_reqsZsectionrk�r�suffixrrrr��s
z)Distribution._convert_extras_requirementscCs|jrdt|j�SdS)ze
For a requirement, return the 'extras_require' suffix for
that requirement.
rV�)rZrh)�reqrrrr��szDistribution._suffix_forcs�dd�}t�dd�pf}ttj|��}t||�}t||�}ttt|���_x&|D]}�j dt|j
�j|�qPWt�fdd��j j
�D���_dS)zv
Move requirements in `install_requires` that are using environment
markers `extras_require`.
cSs|jS)N)rZ)r�rrr�
is_simple_req�szFDistribution._move_install_requirements_markers.<locals>.is_simple_req�install_requiresNrVc3s,|]$\}}|dd�t�j|�D�fVqdS)cSsg|]}t|��qSr)rh)r~r�rrr�
<listcomp>�szMDistribution._move_install_requirements_markers.<locals>.<genexpr>.<listcomp>N)r�
_clean_req)r~rjrk)r5rr� <genexpr>�szBDistribution._move_install_requirements_markers.<locals>.<genexpr>)r
rQr=rXrr
rrhr�r�rZr�rar2r�)r5r�Zspec_inst_reqsZ inst_reqsZsimple_reqsZcomplex_reqsr�r)r5rr��s
z/Distribution._move_install_requirements_markerscCs
d|_|S)zP
Given a Requirement, remove environment markers and return it.
N)rZ)r5r�rrrr��szDistribution._clean_reqFcCs*tj||d�t||j|d�|j�dS)zYParses
configuration files from various levels
and loads configuration.
)� filenames)�ignore_option_errorsN)r��parse_config_filesr�command_optionsr�)r5r�r�rrrr��szDistribution.parse_config_filescCstj|�}|jr|j�|S)z3Process
features after parsing command line
options)r��parse_command_linerx�_finalize_features)r5�resultrrrr��s
zDistribution.parse_command_linecCsd|jdd�S)z;Convert
feature name to corresponding option attribute
nameZwith_�-�_)�replace)r5rYrrr�_feature_attrname�szDistribution._feature_attrnamecCs<tjjtj|�|jdd�}x|D]}tjj|dd�q
W|S)zResolve pre-setup
requirementsT)� installerZreplace_conflicting)r�)r=rq�resolverX�fetch_build_eggr�)r5r!Zresolved_distsrDrrr�fetch_build_eggs�s
zDistribution.fetch_build_eggscCs�tj|�|jr|j�xHtjd�D]:}t||jd�}|dk r$|j|j d�|j
�||j|�q$Wt|dd�r�dd�|jD�|_ng|_dS)Nzdistutils.setup_keywords)r��convert_2to3_doctestscSsg|]}tjj|��qSr)�os�path�abspath)r~�prrrr�sz1Distribution.finalize_options.<locals>.<listcomp>)r��finalize_optionsrx�_set_global_opts_from_featuresr=r�r
rY�requirer��loadr�)r5rFrErrrr�s
zDistribution.finalize_optionsc Csvtjjtjd�}tjj|�srtj|�tj|�tjj|d�}t|d��$}|j d�|j d�|j 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�r3�curdir�exists�mkdirrZ hide_file�openr/)r5Z
egg_cache_dirZreadme_txt_filename�frrr�get_egg_cache_dirs
zDistribution.get_egg_cache_dirc
Cs�ddlm}|jddgi�}|jd�}|j�|jdd�|jd�j�D��|jr�|jdd�}d|krx|dd |}d
|f|d<|j�}||dg|dd
dd
d
ddd
d�}|j �|j|�S)z
Fetch an egg needed for
buildingr)�easy_installZscript_argsr�css"|]\}}|dkr||fVqdS)�
find_links� site_dirs� index_url�optimize�allow_hostsN)r�r�r�r�r�r�r)r~rjrkrrrr�1sz/Distribution.fetch_build_egg.<locals>.<genexpr>Nr�rZsetup�xTF)
�args�install_dirZexclude_scriptsZalways_copyZbuild_directoryZeditableZupgradeZ
multi_versionZ no_report�user)
Zsetuptools.command.easy_installr�� __class__�get_option_dict�clear�updater2r{r�Zensure_finalized)r5r�r�rD�optsZlinksr��cmdrrrr�*s(
zDistribution.fetch_build_eggc Cs�g}|jj�}x�|jj�D]�\}}|j|d�|j|�|jr|j}d}d}|j�s^||}}d|dd||fd|dd||ff}|j |�d||d|<qW||j
|_
|_||_|_dS)z;Add --with-X/--without-X options based on optional
featuresNz
(default)r�zwith-zinclude zwithout-zexclude
)
�negative_opt�copyrxr2�_set_feature�validate�optional�description�include_by_default�extend�global_optionsZfeature_optionsZfeature_negopt) r5Zgo�norY�feature�descrZincdefZexcdef�newrrrr�Gs"
z+Distribution._set_global_opts_from_featurescCs�xJ|jj�D]<\}}|j|�}|s2|dkr|j�r|j|�|j|d�qWx6|jj�D](\}}|j|�sX|j|�|j|d�qXWdS)z9Add/remove
features and resolve dependencies between
themNrr)rxr2�feature_is_includedr��
include_inr��exclude_from)r5rYr�Zenabledrrrr�bs
zDistribution._finalize_featurescCs`||jkr|j|Stjd|�}x:|D]&}|j|jd�|j�|j|<}|SWtj||�SdS)z(Pluggable
version of
get_command_class()zdistutils.commands)r�N)�cmdclassr=r�r�r�r�r��get_command_class)r5�commandZepsrFr�rrrr�ss
zDistribution.get_command_classcCs>x2tjd�D]$}|j|jkr|j�}||j|j<qWtj|�S)Nzdistutils.commands)r=r�rYr�r�r��print_commands)r5rFr�rrrr��s
zDistribution.print_commandscCs>x2tjd�D]$}|j|jkr|j�}||j|j<qWtj|�S)Nzdistutils.commands)r=r�rYr�r�r��get_command_list)r5rFr�rrrr��s
zDistribution.get_command_listcCst||j|�|�dS)zSet
feature's inclusion
statusN)r�r�)r5rYZstatusrrrr��szDistribution._set_featurecCst||j|��S)zAReturn
1 if feature is included, 0 if excluded, 'None' if unknown)r
r�)r5rYrrrr��sz
Distribution.feature_is_includedcCsF|j|�dkr&|j|j}t|d��|j|j|�|j|d�dS)z)Request
inclusion of feature named 'name'rz2 is required, but was
excluded or is not
availablerN)r�rxr�rr�r�)r5rYr�rrr�include_feature�s
zDistribution.include_featurecKsDx>|j�D]2\}}t|d|d�}|r0||�q
|j||�q
WdS)a�Add items to distribution that are named in keyword arguments
For example, 'dist.exclude(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)r2r
�
_include_misc)r5rtrjrk�includerrrr��s
zDistribution.includecsf�d�|jr&��fdd�|jD�|_|jrD��fdd�|jD�|_|jrb��fdd�|jD�|_dS)z9Remove
packages, modules, and extensions in named
packagerIcs$g|]}|�kr|j��r|�qSr)�
startswith)r~r�)�package�pfxrrr��sz0Distribution.exclude_package.<locals>.<listcomp>cs$g|]}|�kr|j��r|�qSr)r�)r~r�)r�r�rrr��scs(g|]
}|j�kr|jj��r|�qSr)rYr�)r~r�)r�r�rrr��sN)�packages�
py_modules�ext_modules)r5r�r)r�r�r�exclude_package�szDistribution.exclude_packagecCs4|d}x&|j�D]}||ks(|j|�rdSqWdS)z<Return
true if 'exclude_package(package)' would do
somethingrITN)�iter_distribution_namesr�)r5r�r�r�rrrrJ�szDistribution.has_contents_forcs�t�t�std|�f��yt||�}Wn
tk
rHtd|��YnX|dk rlt|t�rlt|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)rErrr��sz.Distribution._exclude_misc.<locals>.<listcomp>)r`�sequencerr
rBr�)r5rYrE�oldr)rEr�
_exclude_misc�s
zDistribution._exclude_miscc
s�t|t�std||f��yt||��Wn
tk
rHtd|��YnX�dkr`t|||�n:t�t�sxt|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~r�)r�rrr��sz.Distribution._include_misc.<locals>.<listcomp>)r`r�rr
rBr�)r5rYrEr�r)r�rr��s
zDistribution._include_misccKsDx>|j�D]2\}}t|d|d�}|r0||�q
|j||�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)r2r r�)r5rtrjrk�excluderrrr�s
zDistribution.excludecCs,t|t�std|f��tt|j|��dS)Nz.packages:
setting must be a list or tuple
(%r))r`r�rrQrr�)r5r�rrr�_exclude_packagess
zDistribution._exclude_packagesc
Cs�|jj|_|jj|_|d}|jd�}xB||krh||\}}||=ddl}|j|d�|dd�<|d}q(Wtj|||�}|j|�} t | dd�r�d|f|j|�d<|dk r�gS|S)Nr�aliasesTrZcommand_consumes_argumentszcommand
liner�)
r�r�r�r��shlexr�r��_parse_command_optsr�r )
r5�parserr�r�r��src�aliasr��nargsZ cmd_classrrrr�
s"
z
Distribution._parse_command_optscCs�i}x�|jj�D]�\}}x�|j�D]�\}\}}|dkr8q"|jdd�}|dkr�|j|�}|jj�}|jt|di��x<|j�D]\} }
|
|kr|| }d}Pq|Wtd��n|dkr�d}||j |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.
zcommand liner�r�rr�NzShouldn't be able to get
herer)
r�r2r�Zget_command_objr�r�r�r
rCr�)r5�dr�r��optr��valZcmdobjZneg_opt�neg�posrrr�get_cmdline_options:s(
z Distribution.get_cmdline_optionsccs�x|jp
fD]
}|VqWx|jp$fD]
}|Vq&WxH|jp>fD]:}t|t�rX|\}}n|j}|jd�rt|dd�}|Vq@WdS)z@Yield
all packages, modules, and extension names in
distribution�moduleN�i����)r�r�r�r`�tuplerY�endswith)r5ZpkgrZextrYZ buildinforrrr�bs
z$Distribution.iter_distribution_namescCs�ddl}tjs|jr
tj||�Sddl}t|j|j �sBtj||�S|jj
j�dkr^tj||�S|jj
}|jj}|j
dkr|dp~d}|jj}|j |jj�d|||�|_ztj||�S|j |jj�||||�|_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�utf-8�utf8Zwin32�
)rr )�sysr r0Z
help_commandsr��handle_display_options�ior`�stdout�
TextIOWrapper�encodingrp�errorsr:�line_buffering�detach)r5Zoption_orderrr
rr�newlinerrrrrts$z#Distribution.handle_display_options)N)NF)*�__name__�
__module__�__qualname__�__doc__rarbr}rsrvr�r�r��staticmethodr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rJr�r�r�r�r�rr�rrrrrrsLB
;
(c@sPeZdZdZedd��Zdddfffdd�Zdd �Zd
d�Zdd
�Z dd�Z
dS)r�a�
**deprecated** -- The `Feature` facility was never completely
implemented
or supported, `has reported issues
<https://github.com/pypa/setuptools/issues/58>`_ and will be
removed in
a future version.
A subset of the distribution that can be excluded if unneeded/wanted
Features are created using these keyword arguments:
'description' -- a short, human readable description of the
feature, to
be used in error messages, and option help messages.
'standard' -- if true, the feature is included by default
if it is
available on the current system. Otherwise, the feature is only
included if requested via a command line '--with-X'
option, or if
another included feature requires it. The default setting is
'False'.
'available' -- if true, the feature is available for
installation on the
current system. The default setting is 'True'.
'optional' -- if true, the feature's inclusion can be
controlled from the
command line, using the '--with-X' or
'--without-X' options. If
false, the feature's inclusion status is determined
automatically,
based on 'availabile', 'standard', and whether
any other feature
requires it. The default setting is 'True'.
'require_features' -- a string or sequence of strings
naming features
that should also be included if this feature is included.
Defaults to
empty list. May also contain 'Require' objects that
should be
added/removed from the distribution.
'remove' -- a string or list of strings naming packages to
be removed
from the distribution if this feature is *not* included. If the
feature *is* included, this argument is ignored. This argument
exists
to support removing features that "crosscut" a
distribution, such as
defining a 'tests' feature that removes all the
'tests' subpackages
provided by other features. The default for this argument is an
empty
list. (Note: the named package(s) or modules must exist in the
base
distribution when the 'setup()' function is initially
called.)
other keywords -- any other keyword arguments are saved, and passed
to
the distribution's 'include()' and
'exclude()' methods when the
feature is included or excluded, respectively. So, for example,
you
could pass 'packages=["a","b"]' to
cause packages 'a' and 'b' to be
added or removed from the distribution as appropriate.
A feature must include at least one 'requires',
'remove', or other
keyword argument. Otherwise, it can't affect the distribution in
any way.
Note also that you can subclass 'Feature' to create your own
specialized
feature types that modify the distribution in other ways when included
or
excluded. See the docstrings for the various methods here for more
detail.
Aside from the methods, the only feature attributes that distributions
look
at are 'description' and 'optional'.
cCsd}tj|tdd�dS)NzrFeatures are deprecated and will be
removed in a future version. See
https://github.com/pypa/setuptools/issues/65.�)�
stacklevel)rrr)�msgrrrr��szFeature.warn_deprecatedFTc Ks�|j�||_||_||_||_t|ttf�r4|f}dd�|D�|_dd�|D�}|r^||d<t|t�rn|f}||_ ||_
|r�|r�|r�td��dS)NcSsg|]}t|t�r|�qSr)r`rh)r~r�rrrr��sz$Feature.__init__.<locals>.<listcomp>cSsg|]}t|t�s|�qSr)r`rh)r~r�rrrr��sryzgFeature
%s: must define 'require_features', 'remove', or at
least one of 'packages', 'py_modules',
etc.)r�r��standard� availabler�r`rhrry�remove�extrasr) r5r�rrr�ryrr
Zerrrrr��s$
zFeature.__init__cCs|jo
|jS)z+Should this feature be included by
default?)rr)r5rrrr��szFeature.include_by_defaultcCs@|jst|jd��|jf|j�x|jD]}|j|�q*WdS)aEnsure
feature and its requirements are included in distribution
You may override this in a subclass to perform additional
operations on
the distribution. Note that this method may be called more than
once
per feature, and so should be idempotent.
z3 is required, but is not available on this
platformN)rrr�r�r
ryr�)r5rDr�rrrr��s zFeature.include_incCs2|jf|j�|jr.x|jD]}|j|�qWdS)a2Ensure
feature is excluded from distribution
You may override this in a subclass to perform additional
operations on
the distribution. This method will be called at most once per
feature, and only after all included features have been asked to
include themselves.
N)r�r
rr�)r5rDr�rrrr�s zFeature.exclude_fromcCs2x,|jD]"}|j|�std|j||f��qWdS)a�Verify
that feature makes sense in context of distribution
This method is called by the distribution just before it parses its
command line. It checks to ensure that the 'remove'
attribute, if any,
contains only valid package/module names that are present in the
base
distribution when 'setup()' is called. You may override
it in a
subclass to perform any other required validation of the feature
against a target distribution.
zg%s wants to be able to remove %s, but the distribution
doesn't contain any packages or modules under
%sN)rrJrr�)r5rDr�rrrr�s
zFeature.validateN)rrrrrr�r�r�r�r�r�rrrrr��s7 r�)>�__all__rmr�rr�Z
distutils.logrLZdistutils.coreZ
distutils.cmdZdistutils.distrR�collectionsrZdistutils.errorsrrrZdistutils.utilrZdistutils.versionrZsetuptools.externr r
Zsetuptools.extern.six.movesrrr
Zsetuptools.dependsrZ
setuptoolsrZsetuptools.monkeyrZsetuptools.configrr=Z
py36compatr�
__import__rr#r<rrQr�rGrHrPrUrTr^rcrdrfrgrlroZcorerr�r�rrrr�<module>s`G