Current File : //proc/3/task/3/cwd/usr/lib/python2.7/site-packages/setuptools/dist.pyc
�
b-�Qc@s�dgZddlZddlZddlmZddlmZddlm Z ddl
mZddlm
Z
ddlmZmZdd lmZmZdd
lmZddlZddlZddlZddlZddlZddlZddlZd�Zee�ZeefZd�Z d
�Z!d�Z"d�Z#d�Z$d�Z%d�Z&d�Z'd�Z(d�Z)defd��YZx)ej*ej+ej,fD]Z-ee-_q�Wdfd��YZ.dS(tDistributioni����N(R(tRequire(tinstall(tsdist(tinstall_lib(t
numeric_typest
basestring(tDistutilsOptionErrortDistutilsPlatformError(tDistutilsSetupErrorcCsNx"|jjd�r$|j\}qW|jjd�sJtd|��n|S(s�Protect against re-patching the distutils if reloaded
Also ensures that no other distutils extension monkeypatched the distutils
first.
t
setuptoolst distutilss(distutils has already been patched by %r(t
__module__t
startswitht __bases__tAssertionError(tcls((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyt_get_unpatchedscCsdy*tjjd|�}|js)t�Wn3ttttfk
r_td||f��nXdS(Nsx=s4%r must be importable 'module:attrs' string (got %r)( t
pkg_resourcest
EntryPointtparsetextrasRt TypeErrort
ValueErrortAttributeErrorR (tdisttattrtvaluetep((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytcheck_importable"scCsYydj|�|kst�Wn3ttttfk
rTtd||f��nXdS(s*Verify that value is a string list or Nonets%%r must be a list of strings (got %r)N(tjoinRRRRR (RRR((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytassert_string_list-s
cCs�t|||�x�|D]|}|j|�sCtdd|��nd|krdj|jd�d �}||kr�tjjd||�q�qqWdS(s(Verify that namespace packages are valids1Distribution contains no modules or packages for snamespace package %rt.i����s^WARNING: %r is declared as a package namespace, but %r is not: please correct this in setup.pyN(R thas_contents_forR RtsplitRtlogtwarn(RRRtnsptparent((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyt check_nsp5s
cCs�y}xv|j�D]h\}}d|kre|jdd�\}}tj|�retd|��qenttj|��qWWn&ttt fk
r�td��nXdS(s+Verify that extras_require mapping is validt:isInvalid environment marker: s�'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.N(
titemsR#Rtinvalid_markerR tlisttparse_requirementsRRR(RRRtktvtm((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytcheck_extrasFscCs/t|�|kr+td||f��ndS(s)Verify that value is True, False, 0, or 1s#%r must be a boolean value (got %r)N(tboolR (RRR((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytassert_boolVscCsHyttj|��Wn*ttfk
rCtd|f��nXdS(s9Verify that install_requires is a valid requirements lists^%r must be a string or list of strings containing valid project/version requirement specifiersN(R,RR-RRR (RRR((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytcheck_requirements\scCsHytjj|�Wn-tk
rCtj�d}t|��nXdS(s)Verify that entry_points map is parseableiN(RRt parse_mapRtsystexc_infoR (RRRte((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytcheck_entry_pointses
cCs"t|t�std��ndS(Nstest_suite must be a string(t
isinstanceRR (RRR((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytcheck_test_suitemscCs}t|t�rixW|j�D]B\}}t|t�s;Pnyt|�Wqtk
r]PqXqWdSnt|d��dS(s@Verify that value is a dictionary of package names to glob listsNsI must be a dictionary mapping package names to lists of wildcard patterns(R:tdictR*tstrtiterRR (RRRR.R/((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytcheck_package_dataqs
cCs=x6|D].}tjd|�stjjd|�qqWdS(Ns\w+(\.\w+)*sZWARNING: %r not a valid package name; please use only.-separated package names in setup.py(tretmatchRR$R%(RRRtpkgname((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytcheck_packages�s
cBs�eZdZdZd�Zdd�Zd�Zd�Zd�Z d�Z
d�Zd�Zd �Z
d
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(sxDistribution 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' -- 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.
cCs�|sd|ksd|kr#dStjt|d��j�}tjjj|�}|dk r�|jd�r�tj t|d��|_
||_ndS(NtnametversionsPKG-INFO(Rt safe_nameR=tlowertworking_settby_keytgettNonethas_metadatatsafe_versiont_versiont
_patched_dist(tselftattrstkeyR((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytpatch_missing_pkg_info�scCsLt|d�}|s!i|_ng|_i|_g|_|oQ|jdd�|_|j|�|dk r�|jdg�|_ t
|d|j �n|r�d|kr�|j|jd��nx?tj
d�D].}t||j�s�t||jd�q�q�Wtj||�t|jjt�rHt|jj�|j_ndS(Ntpackage_datatsrc_roottdependency_linkstsetup_requiressdistutils.setup_keywords(thasattrRTtrequire_featurestfeaturest
dist_filestpopRKRURSRVR tfetch_build_eggsRtiter_entry_pointsRDtsetattrt
_Distributiont__init__R:tmetadataRERR=(RPRQthave_package_dataR((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyRa�s&
cCs)tj|�}|jr%|j�n|S(s3Process features after parsing command line options(R`tparse_command_lineRZt_finalize_features(RPtresult((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyRds
cCsd|jdd�S(s;Convert feature name to corresponding option attribute nametwith_t-t_(treplace(RPRD((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyt_feature_attrnamescCsPddlm}m}x3|j||�d|j�D]}|j|�q5WdS(sResolve pre-setup requirementsi����(RHR-t installerN(RRHR-tresolvetfetch_build_eggtadd(RPtrequiresRHR-R((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyR]s cCs�tj|�|jr#|j�nxgtjd�D]V}t||jd�}|dk r3|j d|j
�|j�||j|�q3q3Wt|dd�r�g|jD]}t
jj|�^q�|_n g|_dS(Nsdistutils.setup_keywordsRltconvert_2to3_doctests(R`tfinalize_optionsRZt_set_global_opts_from_featuresRR^tgetattrRDRKtrequireRntloadRqtostpathtabspath(RPRRtp((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyRr%s
.c Cs]y|j}g|j_Wn4tk
rOddlm}|jidgd6�}|j�|jd�}d}x*|j �D]}||kr~||=q~q~W|j
r�|j
}d|kr�|dd
j�|}nd|f|d<n||dd
gdtj
dtdtdddtdtdtdtdt�
}|j�||_nX|j|�S(s Fetch an egg needed for buildingi����(teasy_installR{tscript_argst
find_linkst site_dirst index_urltoptimizetallow_hostsitsetuptargstxtinstall_dirtexclude_scriptstalways_copytbuild_directoryteditabletupgradet
multi_versiont no_reporttuser(R}R~RsoptimizeR~R�N(t_egg_fetchert
package_indextto_scanRtsetuptools.command.easy_installR{t __class__tparse_config_filestget_option_dicttkeysRVR#RwtcurdirtTruetFalseRKtensure_finalized( RPtreqtcmdR{RtoptstkeepRRtlinks((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyRn5s2
cCsg}|jj�}x�|jj�D]�\}}|j|d�|j|�|jr%|j}d}d}|j �s�||}}n|j
d|dd||f�|j
d|dd||f�d||d|<q%q%W||j|_|_||_|_
dS(s;Add --with-X/--without-X options based on optional featuress
(default)Rswith-sinclude swithout-sexclude N(tnegative_opttcopyRZR*t_set_featureRKtvalidatetoptionaltdescriptiontinclude_by_defaulttappendtglobal_optionstfeature_optionstfeature_negopt(RPtgotnoRDtfeaturetdescrtincdeftexcdef((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyRsUs
""cCs�xj|jj�D]Y\}}|j|�}|sI|dkr|j�r|j|�|j|d�qqWxL|jj�D];\}}|j|�s}|j|�|j|d�q}q}WdS(s9Add/remove features and resolve dependencies between themiiN(RZR*tfeature_is_includedRKR�t
include_inR�texclude_from(RPRDR�tenabled((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyRe~s
cCsv||jkr|j|SxUtjd|�D]1}|jd|j�|j�|j|<}|SWtj||�SdS(s(Pluggable version of get_command_class()sdistutils.commandsRlN(tcmdclassRR^RuRnRvR`tget_command_class(RPtcommandRR�((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyR��scCs[xKtjd�D]:}|j|jkr|jt�}||j|j<qqWtj|�S(Nsdistutils.commands(RR^RDR�RvR�R`tprint_commands(RPRR�((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyR��s
cCst||j|�|�dS(sSet feature's inclusion statusN(R_Rk(RPRDtstatus((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyR��scCst||j|��S(sAReturn 1 if feature is included, 0 if excluded, 'None' if unknown(RtRk(RPRD((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyR��scCs`|j|�dkr8|j|j}t|d��n|j|j|�|j|d�dS(s)Request inclusion of feature named 'name'is2 is required, but was excluded or is not availableiN(R�RZR�RR�R�(RPRDR�((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytinclude_feature�scKsZxS|j�D]E\}}t|d|d�}|rB||�q
|j||�q
WdS(s�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.
t _include_N(R*RtRKt
_include_misc(RPRQR.R/tinclude((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyR��s
cCs�|d}|jrQg|jD](}||kr|j|�r|^q|_n|jr�g|jD](}||krd|j|�rd|^qd|_n|jr�g|jD].}|j|kr�|jj|�r�|^q�|_ndS(s9Remove packages, modules, and extensions in named packageR!N(tpackagesR
t
py_modulestext_modulesRD(RPtpackagetpfxRz((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytexclude_package�s
. . cCsD|d}x3|j�D]%}||ks8|j|�rtSqWdS(s<Return true if 'exclude_package(package)' would do somethingR!N(titer_distribution_namesR
R�(RPR�R�Rz((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyR"�s
cCs�t|t�s(td||f��nyt||�}Wn!tk
r^td|��nX|dk r�t|t�r�t|d��n8|r�t||g|D]}||kr�|^q��ndS(sAHandle 'exclude()' for list/tuple attrs without a special handlers(%s: setting must be a list or tuple (%r)s %s: No such distribution settings4: this setting cannot be changed via include/excludeN(R:tsequenceR RtRRKR_(RPRDRtoldtitem((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyt
_exclude_misc�s
cCs�t|t�s(td||f��nyt||�}Wn!tk
r^td|��nX|dkr~t|||�nUt|t�s�t|d��n3t|||g|D]}||kr�|^q��dS(sAHandle 'include()' for list/tuple attrs without a special handlers%s: setting must be a list (%r)s %s: No such distribution settings4: this setting cannot be changed via include/excludeN(R:R�R RtRRKR_(RPRDRR�R�((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyR�s
cKsZxS|j�D]E\}}t|d|d�}|rB||�q
|j||�q
WdS(sRemove 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.
t _exclude_N(R*RtRKR�(RPRQR.R/texclude((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyR�"s
cCs?t|t�s%td|f��ntt|j|��dS(Ns.packages: setting must be a list or tuple (%r)(R:R�R R,tmapR�(RPR�((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyt_exclude_packages9sc
Cs�|jj|_|jj|_|d}|jd�}xS||kr�||\}}||=ddl}|j|t�|d*|d}q:Wtj|||�}|j |�} t
| dd�r�d|f|j|�d<|dk r�gSn|S(Nitaliasesi����itcommand_consumes_argumentsscommand lineR�(R�R�R�R�tshlexR#R�R`t_parse_command_optsR�RtRK(
RPtparserR�R�R�tsrctaliasR�tnargst cmd_class((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyR�Ks"
cCs'i}x|jj�D] \}}x�|j�D]�\}\}}|dkrSq/n|jdd�}|dkr�|j|�}|jj�}|jt|di��xZ|j�D](\} }
|
|kr�| }d}Pq�q�Wt d��n|dkrd}n||j
|i�|<q/WqW|S( shReturn 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.
scommand lineRiRhiR�sShouldn't be able to get hereiN(tcommand_optionsR*Rjtget_command_objR�R�tupdateRtRKRt
setdefault(RPtdR�R�toptR�tvaltcmdobjtneg_opttnegtpos((s3/usr/lib/python2.7/site-packages/setuptools/dist.pytget_cmdline_optionsts(
ccs�x|jpdD]}|VqWx|jp.dD]}|Vq/Wx_|jpMdD]N}t|t�rr|\}}n |j}|jd�r�|d }n|VqNWdS(s@Yield all packages, modules, and extension names in distributiontmodulei����N((((R�R�R�R:ttupleRDtendswith(RPtpkgR�textRDt buildinfo((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyR��s
cCs6ddl}|jdks$|jr4tj||�Sddl}t|j|j�setj||�S|jj j
�d kr�tj||�S|jj }|jj}|jdkr�dp�d}|jj}|j|jj�d|||�|_ztj||�SWd|j|jj�||||�|_XdS(
s�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.
i����Nisutf-8tutf8twin32s
(i(sutf-8sutf8(R6tversion_infot
help_commandsR`thandle_display_optionstioR:tstdoutt
TextIOWrappertencodingRGterrorstplatformRKtline_bufferingtdetach(RPtoption_orderR6R�R�R�tnewlineR�((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyR��s$!N(t__name__Rt__doc__RKRORSRaRdRkR]RrRnRsReR�R�R�R�R�R�R�R"R�R�R�R�R�R�R�R�(((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyR�s6A
) ) ) tFeaturecBsJeZdZeeeddd�Zd�Zd�Zd�Zd�Z RS(sA 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'.
c
Ks||_||_||_||_t|ttf�rE|f}ng|D]}t|t�rL|^qL|_g|D]}t|t�sw|^qw} | r�| |d<nt|t�r�|f}n||_||_ |r�|r�|r�t
d��ndS(NRYsgFeature %s: must define 'require_features', 'remove', or at least one of 'packages', 'py_modules', etc.(R�tstandardt availableR�R:R=RRYtremoveRR (
RPR�R�R�R�RYR�Rtrter((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyRas" +(
cCs|jo|jS(s+Should this feature be included by default?(R�R�(RP((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyR�9scCsT|jst|jd��n|j|j�x|jD]}|j|�q9WdS(sEnsure 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.
s2 is required,but is not available on this platformN(R�RR�R�RRYR�(RPRtf((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyR�=s
cCsA|j|j�|jr=x!|jD]}|j|�q#WndS(s2Ensure 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�RR�R�(RPRR�((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyR�Ts
cCsFx?|jD]4}|j|�s
td|j||f��q
q
WdS(s�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.
sg%s wants to be able to remove %s, but the distribution doesn't contain any packages or modules under %sN(R�R"R R�(RPRR�((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyR�fs
(((
R�RR�R�R�RaR�R�R�R�(((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyR��s1 (/t__all__R@R6tdistutils.coreRR`tsetuptools.dependsRtsetuptools.command.installRtsetuptools.command.sdistRtsetuptools.command.install_libRtsetuptools.compatRRtdistutils.errorsRRR R
RRtdistutils.distt
distutils.cmdRwt
distutils.logRR�R,R�RR R(R1R3R4R9R;R?RCRtcoreR�R�R�(((s3/usr/lib/python2.7/site-packages/setuptools/dist.pyt<module>s> < )��.