AlkantarClanX12

Your IP : 18.117.70.58


Current Path : /opt/alt/python35/lib/python3.5/site-packages/setuptools/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib/python3.5/site-packages/setuptools/__pycache__/dist.cpython-35.pyc



�Rep��@s_dgZddlZddlZddlZddlZddlZddlZddlZddl	Zddl
Z
ddlmZddl
mZmZmZddlmZddlmZddlmZmZmZddlmZdd	lmZdd
lmZddlm Z ddl!m"Z"ddl#Z#d
dl$m%Z%e&d�e&d�dd�Z'dd�Z(dd�Z)e*e+fZ,dd�Z-dd�Z.dd�Z/dd�Z0dd �Z1d!d"�Z2d#d$�Z3d%d&�Z4d'd(�Z5d)d*�Z6d+d,�Z7d-d.�Z8e ej9j:�Z;Gd/d�de%e;�Z:Gd0d1�d1�Z<dS)2�Distribution�N)�defaultdict)�DistutilsOptionError�DistutilsPlatformError�DistutilsSetupError)�
rfc822_escape)�six)�map�filter�filterfalse)�	packaging)�Require)�windows_support)�
get_unpatched)�parse_configuration�)�Distribution_parse_config_filesz)pkg_resources.extern.packaging.specifiersz&pkg_resources.extern.packaging.versioncCstjdt�t|�S)NzDo not call this function)�warnings�warn�DeprecationWarningr)�cls�r��/builddir/build/BUILDROOT/alt-python35-setuptools-36.3.0-4.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/setuptools/dist.py�_get_unpatched!srcCsd}|js3|js3|js3|js3|jr9d}t|d�rNd}|jd|�|jd|j��|jd|j��|jd|j	��|jd	|j
��|jd
|j��|jd|j��|jd|j
��|jr|jd
|j�t|j��}|jd|�dj|j��}|rl|jd|�|j|d|j��|j|d|j��|j|d|j��|j|d|j��|j|d|j��t|d�r|jd|j�dS)z5Write the PKG-INFO format data to a file object.
    z1.0z1.1�python_requiresz1.2zMetadata-Version: %s
z	Name: %s
zVersion: %s
zSummary: %s
zHome-page: %s
zAuthor: %s
zAuthor-email: %s
zLicense: %s
zDownload-URL: %s
zDescription: %s
�,z
Keywords: %s
�Platform�
Classifier�Requires�Provides�	ObsoleteszRequires-Python: %s
N)�provides�requires�	obsoletes�classifiers�download_url�hasattr�write�get_name�get_version�get_description�get_url�get_contact�get_contact_email�get_licenser�get_long_description�join�get_keywords�_write_list�
get_platforms�get_classifiers�get_requires�get_provides�
get_obsoletesr)�self�file�version�	long_desc�keywordsrrr�write_pkg_file's8	r=c	Cs?ttjj|d�ddd��}|j|�WdQRXdS)z3Write the PKG-INFO file into the release tree.
    zPKG-INFO�w�encodingzUTF-8N)�open�os�pathr0r=)r8�base_dir�pkg_inforrr�write_pkg_infoRsrEcCsey*tjjd|�}|js)t�Wn4ttttfk
r`td||f��YnXdS)Nzx=z4%r must be importable 'module:attrs' string (got %r))	�
pkg_resources�
EntryPoint�parse�extras�AssertionError�	TypeError�
ValueError�AttributeErrorr)�dist�attr�value�eprrr�check_importable]srRcCsZydj|�|kst�Wn4ttttfk
rUtd||f��YnXdS)z*Verify that value is a string list or None�z%%r must be a list of strings (got %r)N)r0rJrKrLrMr)rNrOrPrrr�assert_string_lisths
rTcCs�|}t|||�xq|D]i}|j|�sFtdd|��|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)rT�has_contents_forr�
rpartition�	distutils�logr)rNrOrPZns_packages�nsp�parent�sep�childrrr�	check_nsprs
	r^c
CsNy ttjt|j���Wn'tttfk
rItd��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_extra�itemsrKrLrMr)rNrOrPrrr�check_extras�s
 rdcCsT|jd�\}}}|r=tj|�r=td|��ttj|��dS)N�:zInvalid environment marker: )�	partitionrF�invalid_markerrr_�parse_requirements)�extra�reqs�namer\�markerrrrrb�srbcCs:t|�|kr6d}t|jd|d|���dS)z)Verify that value is True, False, 0, or 1z0{attr!r} must be a boolean value (got {value!r})rOrPN)�boolr�format)rNrOrP�tmplrrr�assert_bool�srpcCsmyttj|��WnOttfk
rh}z)d}t|jd|d|���WYdd}~XnXdS)z9Verify that install_requires is a valid requirements listzm{attr!r} must be a string or list of strings containing valid project/version requirement specifiers; {error}rO�errorN)r_rFrhrKrLrrn)rNrOrPrqrorrr�check_requirements�s
rrcCsjytjj|�WnOtjjk
re}z)d}t|jd|d|���WYdd}~XnXdS)z.Verify that value is a valid version specifierzF{attr!r} must be a string containing valid version specifiers; {error}rOrqN)r�
specifiers�SpecifierSet�InvalidSpecifierrrn)rNrOrPrqrorrr�check_specifier�s
rvcCsLytjj|�Wn1tk
rG}zt|��WYdd}~XnXdS)z)Verify that entry_points map is parseableN)rFrG�	parse_maprLr)rNrOrP�errr�check_entry_points�srycCs"t|tj�std��dS)Nztest_suite must be a string)�
isinstancer�string_typesr)rNrOrPrrr�check_test_suite�sr|cCsxt|t�rdxR|j�D]@\}}t|t�s8Pyt|�Wqtk
r[PYqXqWdSt|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)rz�dictrc�str�iterrKr)rNrOrP�k�vrrr�check_package_data�s

r�cCs:x3|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�matchrXrYr)rNrOrP�pkgnamerrr�check_packages�s

	r�c@s�eZdZdZdZdd�Zddd�Zdd�Zd	d
�Ze	dd��Z
d
d�Zdd�Zddd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Z d9d:�Z!d;d<�Z"d=d>�Z#d?d@�Z$dAdB�Z%dCdD�Z&dS)Era�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.
    NcCs�|sd|ksd|kr#dStjt|d��j�}tjjj|�}|dk	r�|jd�r�tjt|d��|_	||_
dS)Nrkr:zPKG-INFO)rF�	safe_namer~�lower�working_set�by_key�get�has_metadata�safe_version�_version�
_patched_dist)r8�attrs�keyrNrrr�patch_missing_pkg_info'sz#Distribution.patch_missing_pkg_infocCst|d�}|si|_|p'i}d|ksBd|krLtj�g|_i|_g|_|o||jdd�|_|j	|�|dk	r�|jdg�|_
t|d|j
�|r�d|kr�|j|d�x0t
jd�D]}t|�j|jd�q�Wtj||�t|jjtj�rYt|jj�|j_|jjdk	ryctjj|jj�}t|�}|jj|kr�tjd|jj|f�||j_Wn5tjjtfk
rtjd	|jj�YnX|j �dS)
N�package_data�features�require_features�src_root�dependency_linksZsetup_requireszdistutils.setup_keywordszNormalizing '%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.)!r&r��Feature�warn_deprecatedr�r��
dist_files�popr�r�r�rT�fetch_build_eggsrF�iter_entry_points�vars�
setdefaultrk�
_Distribution�__init__rz�metadatar:�numbers�Numberr~r�Versionrr�InvalidVersionrK�_finalize_requires)r8r�Zhave_package_dataZ_attrs_dictrQ�verZnormalized_versionrrrr�4sH	
			
	zDistribution.__init__cCs9t|dd�r!|j|j_|j�|j�dS)z�
        Set `metadata.python_requires` and fix environment markers
        in `install_requires` and `extras_require`.
        rN)�getattrrr��_convert_extras_requirements�"_move_install_requirements_markers)r8rrrr�bs
zDistribution._finalize_requirescCs�t|dd�pi}tt�|_xf|j�D]X\}}|j|x>tj|�D]-}|j|�}|j||j|�q[Wq4WdS)z�
        Convert requirements in `extras_require` of the form
        `"extra": ["barbazquux; {marker}"]` to
        `"extra:{marker}": ["barbazquux"]`.
        �extras_requireN)	r�rr_�_tmp_extras_requirercrFrh�_suffix_for�append)r8Z
spec_ext_reqs�sectionr��r�suffixrrrr�lsz)Distribution._convert_extras_requirementscCs|jrdt|j�SdS)ze
        For a requirement, return the 'extras_require' suffix for
        that requirement.
        rerS)rlr~)�reqrrrr�{szDistribution._suffix_forcs�dd�}t�dd�p!f}ttj|��}t||�}t||�}ttt|���_x/|D]'}�j	dt|j
�j|�qvWt�fdd��j	j
�D���_dS)zv
        Move requirements in `install_requires` that are using environment
        markers `extras_require`.
        cSs|jS)N)rl)r�rrr�
is_simple_req�szFDistribution._move_install_requirements_markers.<locals>.is_simple_req�install_requiresNrec3s:|]0\}}|dd�t�j|�D�fVqdS)cSsg|]}t|��qSr)r~)�.0r�rrr�
<listcomp>�s	zMDistribution._move_install_requirements_markers.<locals>.<genexpr>.<listcomp>N)r	�
_clean_req)r�r�r�)r8rr�	<genexpr>�szBDistribution._move_install_requirements_markers.<locals>.<genexpr>)r�r_rFrhr
rr	r~r�r�rlr�r}rcr�)r8r�Zspec_inst_reqsZ	inst_reqsZsimple_reqsZcomplex_reqsr�r)r8rr��s

%z/Distribution._move_install_requirements_markerscCs
d|_|S)zP
        Given a Requirement, remove environment markers and return it.
        N)rl)r8r�rrrr��s	zDistribution._clean_reqcCs1tj|d|�t||j�|j�dS)zYParses configuration files from various levels
        and loads configuration.

        �	filenamesN)r��parse_config_filesr�command_optionsr�)r8r�rrrr��szDistribution.parse_config_filescCs&tj|�}|jr"|j�|S)z3Process features after parsing command line options)r��parse_command_liner��_finalize_features)r8�resultrrrr��s	
zDistribution.parse_command_linecCsd|jdd�S)z;Convert feature name to corresponding option attribute nameZwith_�-�_)�replace)r8rkrrr�_feature_attrname�szDistribution._feature_attrnamecCsUtjjtj|�d|jdd�}x$|D]}tjj|dd�q1W|S)zResolve pre-setup requirements�	installer�replace_conflictingTr�)rFr��resolverh�fetch_build_egg�add)r8r"Zresolved_distsrNrrrr��s			
zDistribution.fetch_build_eggscCs�tj|�|jr |j�xdtjd�D]S}t||jd�}|dk	r0|jd|j	�|j
�||j|�q0Wt|dd�r�dd�|jD�|_n	g|_dS)Nzdistutils.setup_keywordsr��convert_2to3_doctestscSs"g|]}tjj|��qSr)rArB�abspath)r��prrrr��s	z1Distribution.finalize_options.<locals>.<listcomp>)r��finalize_optionsr��_set_global_opts_from_featuresrFr�r�rk�requirer��loadr�)r8rQrPrrrr��s
	
	zDistribution.finalize_optionsc	Cs�tjjtjd�}tjj|�s�tj|�tj|�tjj|d�}t|d��.}|j	d�|j	d�|j	d�WdQRX|S)Nz.eggsz
README.txtr>zcThis 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.

)
rArBr0�curdir�exists�mkdirrZ	hide_filer@r')r8Z
egg_cache_dirZreadme_txt_filename�frrr�get_egg_cache_dir�s



zDistribution.get_egg_cache_dirc
Csfy|j}g|j_Wn=tk
rXddlm}|jddgi�}|j�|jd�}d}x't	|�D]}||kr}||=q}W|j
r�|j
d
d
�}d|kr�|ddj�|}d|f|d<|j�}	||d
dgd|	dddddd
dddddddddd�
}|j
�||_YnX|j|�S)z Fetch an egg needed for buildingr)�easy_install�script_argsr��
find_links�	site_dirs�	index_url�optimize�allow_hostsNr�setup�args�x�install_dirZexclude_scriptsTZalways_copyFZbuild_directory�editable�upgradeZ
multi_versionZ	no_report�user)r�r�r�r�r�r�)Z_egg_fetcherZ
package_indexZto_scanrMZsetuptools.command.easy_installr��	__class__r��get_option_dictr_r��splitr��ensure_finalized)
r8r��cmdr�rN�optsZkeepr��linksr�rrrr��s6	

	
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|<q%W||j
|_
|_||_|_dS)z;Add --with-X/--without-X options based on optional featuresNz
 (default)rSzwith-zinclude zwithout-zexclude )
�negative_opt�copyr�rc�_set_feature�validate�optional�description�include_by_default�extend�global_optionsZfeature_optionsZfeature_negopt)	r8Zgo�nork�feature�descrZincdefZexcdef�newrrrr�s"
		

z+Distribution._set_global_opts_from_featurescCs�xg|jj�D]V\}}|j|�}|sI|dkr|j�r|j|�|j|d�qWxI|jj�D]8\}}|j|�sz|j|�|j|d�qzWdS)z9Add/remove features and resolve dependencies between themNrr)r�rc�feature_is_includedr��
include_inr��exclude_from)r8rkr�Zenabledrrrr�#s

zDistribution._finalize_featurescCs|||jkr|j|Stjd|�}xI|D]1}|jd|j�|j�|j|<}|SWtj||�SdS)z(Pluggable version of get_command_class()zdistutils.commandsr�N)�cmdclassrFr�r�r�r�r��get_command_class)r8�commandZepsrQr�rrrr�4s
zDistribution.get_command_classcCsUxEtjd�D]4}|j|jkr|j�}||j|j<qWtj|�S)Nzdistutils.commands)rFr�rkr�r�r��print_commands)r8rQr�rrrr�As
zDistribution.print_commandscCsUxEtjd�D]4}|j|jkr|j�}||j|j<qWtj|�S)Nzdistutils.commands)rFr�rkr�r�r��get_command_list)r8rQr�rrrr�Is
zDistribution.get_command_listcCst||j|�|�dS)zSet feature's inclusion statusN)�setattrr�)r8rk�statusrrrr�QszDistribution._set_featurecCst||j|��S)zAReturn 1 if feature is included, 0 if excluded, 'None' if unknown)r�r�)r8rkrrrr�Usz Distribution.feature_is_includedcCs]|j|�dkr5|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�r�r�rr�r�)r8rkr�rrr�include_featureYs
zDistribution.include_featurecKsZxS|j�D]E\}}t|d|d�}|rB||�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)rcr��
_include_misc)r8r�r�r��includerrrrds

zDistribution.includecs��d�|jr5��fdd�|jD�|_|jr`��fdd�|jD�|_|jr���fdd�|jD�|_dS)z9Remove packages, modules, and extensions in named packagerUcs2g|](}|�kr|j��r|�qSr)�
startswith)r�r�)�package�pfxrrr��s	z0Distribution.exclude_package.<locals>.<listcomp>cs2g|](}|�kr|j��r|�qSr)r)r�r�)rrrrr��s	cs8g|].}|j�kr|jj��r|�qSr)rkr)r�r�)rrrrr��s	N)�packages�
py_modules�ext_modules)r8rr)rrr�exclude_packagezs
	"	"	zDistribution.exclude_packagecCsD|d}x3|j�D]%}||ks8|j|�rdSqWdS)z<Return true if 'exclude_package(package)' would do somethingrUTN)�iter_distribution_namesr)r8rrr�rrrrV�s
zDistribution.has_contents_forcs�t�t�s%td|�f��yt||�}Wn"tk
r\td|��YnX|dk	r�t|t�r�t|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/excludecs"g|]}|�kr|�qSrr)r��item)rPrrr��s	z.Distribution._exclude_misc.<locals>.<listcomp>)rz�sequencerr�rMr�)r8rkrP�oldr)rPr�
_exclude_misc�s
zDistribution._exclude_miscc
s�t|t�s%td||f��yt||��Wn"tk
r\td|��YnX�dkr|t|||�nOt�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/excludecs"g|]}|�kr|�qSrr)r�r)rrrr��s	z.Distribution._include_misc.<locals>.<listcomp>)rzr
rr�rMr�)r8rkrPr�r)rrr�s
zDistribution._include_misccKsZxS|j�D]E\}}t|d|d�}|rB||�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)rcr�r)r8r�r�r��excluderrrr�s

zDistribution.excludecCs<t|t�s"td|f��tt|j|��dS)Nz.packages: setting must be a list or tuple (%r))rzr
rr_r	r
)r8rrrr�_exclude_packages�szDistribution._exclude_packagesc
Cs�|jj|_|jj|_|d}|jd�}xY||kr�||\}}||=ddl}|j|d�|dd�<|d}q:Wtj|||�}|j|�}	t	|	dd�r�d|f|j|�d<|dk	r�gS|S)Nr�aliasesTrZcommand_consumes_argumentszcommand liner�)
r�r�r�r��shlexr�r��_parse_command_optsr�r�)
r8�parserr�r�r�src�aliasr�nargs�	cmd_classrrrr�s"
z Distribution._parse_command_optscCsi}x|jj�D]\}}x�|j�D]�\}\}}|dkrPq/|jdd�}|dkr�|j|�}|jj�}|jt|di��xT|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.
        zcommand liner�r�rr�NzShouldn't be able to get herer)
r�rcr��get_command_objr�r��updater�rJr�)r8�dr�r��optr�valZcmdobj�neg_opt�neg�posrrr�get_cmdline_options�s(
z Distribution.get_cmdline_optionsccs�x|jpfD]}|VqWx|jp.fD]}|Vq/Wxb|jpMfD]Q}t|t�rr|\}}n	|j}|jd�r�|dd�}|VqNWdS)z@Yield all packages, modules, and extension names in distribution�moduleN�i����)rrr	rz�tuplerk�endswith)r8�pkgr#�extrkZ	buildinforrrr#s			z$Distribution.iter_distribution_namescCs0ddl}tjs|jr.tj||�Sddl}t|j|j	�s_tj||�S|jj
j�dkr�tj||�S|jj
}|jj}|j
dkr�dp�d}|jj}|j	|jj�d|||�|_ztj||�SWd|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�utf8�win32�
)r)r*)�sysr�PY2�
help_commandsr��handle_display_options�iorz�stdout�
TextIOWrapperr?r��errors�platform�line_buffering�detach)r8�option_orderr-r1r?r4�newliner6rrrr05s$!z#Distribution.handle_display_options)'�__name__�
__module__�__qualname__�__doc__r�r�r�r�r��staticmethodr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr
rVrrrrrr"rr0rrrrr�sFB
.

"
	(c@sseZdZdZedd��Zdddffdd�Zdd	�Zd
d�Zdd
�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'.
    cCs d}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�rL|f}dd�|D�|_dd�|D�}|r�||d<t|t�r�|f}||_	||_
|r�|r�|r�td��dS)NcSs%g|]}t|t�r|�qSr)rzr~)r�r�rrrr��s	z$Feature.__init__.<locals>.<listcomp>cSs%g|]}t|t�s|�qSr)rzr~)r�r�rrrr��s	r�zgFeature %s: must define 'require_features', 'remove', or at least one of 'packages', 'py_modules', etc.)r�r��standard�	availabler�rzr~r
r��removerIr)	r8r�rBrCr�r�rDrIZerrrrr��s$
					
			zFeature.__init__cCs|jo|jS)z+Should this feature be included by default?)rCrB)r8rrrr��szFeature.include_by_defaultcCsQ|jst|jd��|j|j�x|jD]}|j|�q6WdS)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)rCrr�rrIr�r)r8rNr�rrrr��s		zFeature.include_incCs>|j|j�|jr:x|jD]}|j|�q#WdS)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)rrIrDr
)r8rNrrrrr��s		zFeature.exclude_fromcCsCx<|jD]1}|j|�s
td|j||f��q
WdS)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)rDrVrr�)r8rNrrrrr��s
zFeature.validateN)r:r;r<r=r>r�r�r�r�r�r�rrrrr�Ys7	r�)=�__all__r�rArr�Z
distutils.logrX�distutils.core�
distutils.cmd�distutils.distr`�collectionsr�distutils.errorsrrr�distutils.utilrZsetuptools.externrZsetuptools.extern.six.movesr	r
rZpkg_resources.externrZsetuptools.dependsr
�
setuptoolsrZsetuptools.monkeyrZsetuptools.configrrFZ
py36compatr�
__import__rr=rEr%r_r
rRrTr^rdrbrprrrvryr|r�r��corerr�r�rrrr�<module>sX	

+
	��z