ž à’Re$c@s°dgZddlZddlZddlZddlZddlZddlZddlZddlm Z ddl m Z m Z mZddlmZddlmZmZddlZdd„Zee ƒZ eefZd d „Zd d „Zd d„Zdd„Zdd„Zdd„Zdd„Zdd„Z dd„Z!dd„Z"Gdd„de ƒZ x)ej#ej$ej%fD]Z&e e&_ q†WGdd„dƒZ'dS( u DistributioniN(u Distribution(uDistutilsOptionErroruDistutilsPlatformErroruDistutilsSetupError(uRequire(u numeric_typesu basestringcCsNx"|jjdƒr$|j\}qW|jjdƒsJtd|ƒ‚n|S(u•Protect against re-patching the distutils if reloaded Also ensures that no other distutils extension monkeypatched the distutils first. u setuptoolsu distutilsu(distutils has already been patched by %r(u __module__u startswithu __bases__uAssertionError(ucls((u(/tmp/pip-k8wh6o-build/setuptools/dist.pyu_get_unpatcheds u_get_unpatchedcCsey*tjjd|ƒ}|j s)t‚Wn4ttttfk r`td||fƒ‚YnXdS(Nux=u4%r must be importable 'module:attrs' string (got %r)( u pkg_resourcesu EntryPointuparseuextrasuAssertionErroru TypeErroru ValueErroruAttributeErroruDistutilsSetupError(udistuattruvalueuep((u(/tmp/pip-k8wh6o-build/setuptools/dist.pyucheck_importable$sucheck_importablecCsZydj|ƒ|kst‚Wn4ttttfk rUtd||fƒ‚YnXdS(u*Verify that value is a string list or Noneuu%%r must be a list of strings (got %r)N(ujoinuAssertionErroru TypeErroru ValueErroruAttributeErroruDistutilsSetupError(udistuattruvalue((u(/tmp/pip-k8wh6o-build/setuptools/dist.pyuassert_string_list/s uassert_string_listcCs¡t|||ƒxŠ|D]‚}|j|ƒsCtdd|ƒ‚nd|krdj|jdƒdd…ƒ}||kr™tjjd||ƒq™qqWdS(u(Verify that namespace packages are validu1Distribution contains no modules or packages for unamespace package %ru.Niu^WARNING: %r is declared as a package namespace, but %r is not: please correct this in setup.pyiÿÿÿÿ(uassert_string_listuhas_contents_foruDistutilsSetupErrorujoinusplitu distutilsuloguwarn(udistuattruvalueunspuparent((u(/tmp/pip-k8wh6o-build/setuptools/dist.pyu check_nsp7s  "  u check_nspc Cs«y}xv|jƒD]h\}}d|kre|jddƒ\}}tj|ƒretd|ƒ‚qenttj|ƒƒqWWn'ttt fk r¦tdƒ‚YnXdS(u+Verify that extras_require mapping is validu:iuInvalid environment marker: u‹'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.N( uitemsusplitu pkg_resourcesuinvalid_markeruDistutilsSetupErrorulistuparse_requirementsu TypeErroru ValueErroruAttributeError(udistuattruvalueukuvum((u(/tmp/pip-k8wh6o-build/setuptools/dist.pyu check_extrasHs u check_extrascCs/t|ƒ|kr+td||fƒ‚ndS(u)Verify that value is True, False, 0, or 1u#%r must be a boolean value (got %r)N(ubooluDistutilsSetupError(udistuattruvalue((u(/tmp/pip-k8wh6o-build/setuptools/dist.pyu assert_boolXsu assert_boolc CsIyttj|ƒƒWn+ttfk rDtd|fƒ‚YnXdS(u9Verify that install_requires is a valid requirements listu^%r must be a string or list of strings containing valid project/version requirement specifiersN(ulistu pkg_resourcesuparse_requirementsu TypeErroru ValueErroruDistutilsSetupError(udistuattruvalue((u(/tmp/pip-k8wh6o-build/setuptools/dist.pyucheck_requirements^s ucheck_requirementsc CsIytjj|ƒWn.tk rDtjƒd}t|ƒ‚YnXdS(u)Verify that entry_points map is parseableiN(u pkg_resourcesu EntryPointu parse_mapu ValueErrorusysuexc_infouDistutilsSetupError(udistuattruvalueue((u(/tmp/pip-k8wh6o-build/setuptools/dist.pyucheck_entry_pointsgs  ucheck_entry_pointscCs"t|tƒstdƒ‚ndS(Nutest_suite must be a string(u isinstanceu basestringuDistutilsSetupError(udistuattruvalue((u(/tmp/pip-k8wh6o-build/setuptools/dist.pyucheck_test_suiteosucheck_test_suitec Cs~t|tƒrjxX|jƒD]C\}}t|tƒs;Pnyt|ƒWqtk r^PYqXqWdSnt|dƒ‚dS(u@Verify that value is a dictionary of package names to glob listsNuI must be a dictionary mapping package names to lists of wildcard patterns(u isinstanceudictuitemsustruiteru TypeErroruDistutilsSetupError(udistuattruvalueukuv((u(/tmp/pip-k8wh6o-build/setuptools/dist.pyucheck_package_datass  ucheck_package_datacCs=x6|D].}tjd|ƒstjjd|ƒqqWdS(Nu \w+(\.\w+)*uZWARNING: %r not a valid package name; please use only.-separated package names in setup.py(ureumatchu distutilsuloguwarn(udistuattruvalueupkgname((u(/tmp/pip-k8wh6o-build/setuptools/dist.pyucheck_packages‚s   ucheck_packagescBsO|EeZdZdZd4Zdd„Zd4dd„Zdd„Zdd „Z d d „Z d d „Z dd„Z dd„Z dd„Zdd„Zdd„Zdd„Zdd„Zdd„Zdd„Zd d!„Zd"d#„Zd$d%„Zd&d'„Zd(d)„Zd*d+„Zd,d-„Zd.d/„Zd0d1„Zd2d3„Zd4S(5u DistributionuDistribution 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. cCsŸ| sd|ksd|kr#dStjt|dƒƒjƒ}tjjj|ƒ}|dk r›|jdƒ r›tj t|dƒƒ|_ ||_ ndS(NunameuversionuPKG-INFO( u pkg_resourcesu safe_nameustruloweru working_setuby_keyugetuNoneu has_metadatau safe_versionu_versionu _patched_dist(uselfuattrsukeyudist((u(/tmp/pip-k8wh6o-build/setuptools/dist.pyupatch_missing_pkg_infoÑsu#Distribution.patch_missing_pkg_infoc Cs}t|dƒ}|s!i|_n|p*i}d|ksEd|krRtjƒng|_i|_g|_|o‚|jddƒ|_ |j |ƒ|dk rÌ|jdgƒ|_ t |d|j ƒn|r÷d|kr÷|j |jdƒƒnx?tjdƒD].}t||jƒst||jdƒqqWtj||ƒt|jjtƒryt|jjƒ|j_ndS(Nu package_dataufeaturesurequire_featuresusrc_rootudependency_linksusetup_requiresudistutils.setup_keywords(uhasattru package_datauFeatureuwarn_deprecatedurequire_featuresufeaturesu dist_filesupopuNoneusrc_rootupatch_missing_pkg_infoudependency_linksuassert_string_listufetch_build_eggsu pkg_resourcesuiter_entry_pointsunameusetattru _Distributionu__init__u isinstanceumetadatauversionu numeric_typesustr(uselfuattrsuhave_package_datau _attrs_dictuep((u(/tmp/pip-k8wh6o-build/setuptools/dist.pyu__init__Þs,        uDistribution.__init__cCs)tj|ƒ}|jr%|jƒn|S(u3Process features after parsing command line options(u _Distributionuparse_command_lineufeaturesu_finalize_features(uselfuresult((u(/tmp/pip-k8wh6o-build/setuptools/dist.pyuparse_command_lineøs  uDistribution.parse_command_linecCsd|jddƒS(u;Convert feature name to corresponding option attribute nameuwith_u-u_(ureplace(uselfuname((u(/tmp/pip-k8wh6o-build/setuptools/dist.pyu_feature_attrnameÿsuDistribution._feature_attrnamecCsPddlm}m}x3|j||ƒd|jƒD]}|j|ƒq5WdS(uResolve pre-setup requirementsi(u working_setuparse_requirementsu installerN(u pkg_resourcesu working_setuparse_requirementsuresolveufetch_build_egguadd(uselfurequiresu working_setuparse_requirementsudist((u(/tmp/pip-k8wh6o-build/setuptools/dist.pyufetch_build_eggss uDistribution.fetch_build_eggscCsÈtj|ƒ|jr#|jƒnxgtjdƒD]V}t||jdƒ}|dk r3|j d|j ƒ|j ƒ||j|ƒq3q3Wt|ddƒr»dd„|j Dƒ|_ n g|_ dS(Nudistutils.setup_keywordsu installeruconvert_2to3_doctestscSs"g|]}tjj|ƒ‘qS((uosupathuabspath(u.0up((u(/tmp/pip-k8wh6o-build/setuptools/dist.pyu s u1Distribution.finalize_options..( u _Distributionufinalize_optionsufeaturesu_set_global_opts_from_featuresu pkg_resourcesuiter_entry_pointsugetattrunameuNoneurequireufetch_build_egguloaduconvert_2to3_doctests(uselfuepuvalue((u(/tmp/pip-k8wh6o-build/setuptools/dist.pyufinalize_options s     uDistribution.finalize_optionsc Csgy|j}g|j_Wn>tk rYddlm}|jidgd6ƒ}|jƒ|jdƒ}d}x*|j ƒD]}||kr~||=q~q~W|j rô|j d d …}d|krá|dd j ƒ|}nd |f|d¦s u0Distribution.exclude_package..cs2g|](}|ˆkr|jˆƒ r|‘qS((u startswith(u.0up(upackageupfx(u(/tmp/pip-k8wh6o-build/setuptools/dist.pyu ¬s cs8g|].}|jˆkr|jjˆƒ r|‘qS((unameu startswith(u.0up(upackageupfx(u(/tmp/pip-k8wh6o-build/setuptools/dist.pyu ²s N(upackagesu py_modulesu ext_modules(uselfupackage((upackageupfxu(/tmp/pip-k8wh6o-build/setuptools/dist.pyuexclude_package s  % % uDistribution.exclude_packagecCsD|d}x3|jƒD]%}||ks8|j|ƒrdSqWdS(u<Return true if 'exclude_package(package)' would do somethingu.NT(uiter_distribution_namesu startswithuTrue(uselfupackageupfxup((u(/tmp/pip-k8wh6o-build/setuptools/dist.pyuhas_contents_for¶s uDistribution.has_contents_forcs¿tˆtƒs(td|ˆfƒ‚nyt||ƒ}Wn"tk r_td|ƒ‚YnX|dk rt|tƒ rt|dƒ‚n,|r»t||‡fdd†|DƒƒndS(uAHandle 'exclude()' for list/tuple attrs without a special handleru(%s: setting must be a list or tuple (%r)u %s: No such distribution settingu4: this setting cannot be changed via include/excludecs"g|]}|ˆkr|‘qS(((u.0uitem(uvalue(u(/tmp/pip-k8wh6o-build/setuptools/dist.pyu Ðs u.Distribution._exclude_misc..N(u isinstanceusequenceuDistutilsSetupErrorugetattruAttributeErroruNoneusetattr(uselfunameuvalueuold((uvalueu(/tmp/pip-k8wh6o-build/setuptools/dist.pyu _exclude_misc¿s uDistribution._exclude_misccsÌt|tƒs(td||fƒ‚nyt||ƒ‰Wn"tk r_td|ƒ‚YnXˆdkrt|||ƒnItˆtƒs¡t|dƒ‚n't||ˆ‡fdd†|DƒƒdS(uAHandle 'include()' for list/tuple attrs without a special handleru%s: setting must be a list (%r)u %s: No such distribution settingu4: this setting cannot be changed via include/excludecs"g|]}|ˆkr|‘qS(((u.0uitem(uold(u(/tmp/pip-k8wh6o-build/setuptools/dist.pyu æs u.Distribution._include_misc..N(u isinstanceusequenceuDistutilsSetupErrorugetattruAttributeErroruNoneusetattr(uselfunameuvalue((uoldu(/tmp/pip-k8wh6o-build/setuptools/dist.pyu _include_miscÒs  uDistribution._include_misccKsZxS|jƒD]E\}}t|d|dƒ}|rB||ƒq |j||ƒq WdS(uRemove 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. u _exclude_N(uitemsugetattruNoneu _exclude_misc(uselfuattrsukuvuexclude((u(/tmp/pip-k8wh6o-build/setuptools/dist.pyuexcludeès  uDistribution.excludecCs?t|tƒs%td|fƒ‚ntt|j|ƒƒdS(Nu.packages: setting must be a list or tuple (%r)(u isinstanceusequenceuDistutilsSetupErrorulistumapuexclude_package(uselfupackages((u(/tmp/pip-k8wh6o-build/setuptools/dist.pyu_exclude_packagesÿsuDistribution._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õgSn|S(Niualiasesiucommand_consumes_argumentsu command lineuargsT( u __class__uglobal_optionsu negative_optuget_option_dictushlexusplituTrueu _Distributionu_parse_command_optsuget_command_classugetattruNone( uselfuparseruargsucommandualiasesusrcualiasushlexunargsu cmd_class((u(/tmp/pip-k8wh6o-build/setuptools/dist.pyu_parse_command_optss"   u Distribution._parse_command_optsc Cs'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ƒ|`_ 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'. cCstjdtddƒdS(NumFeatures are deprecated and will be removed in a future version. See http://bitbucket.org/pypa/setuptools/65.u stackleveli(uwarningsuwarnuDeprecationWarning(((u(/tmp/pip-k8wh6o-build/setuptools/dist.pyuwarn_deprecated¼suFeature.warn_deprecatedc Ksà|jƒ||_||_||_||_t|ttfƒrO|f}ndd„|Dƒ|_dd„|Dƒ}|r‹||dÑs u$Feature.__init__..cSs%g|]}t|tƒs|‘qS((u isinstanceustr(u.0ur((u(/tmp/pip-k8wh6o-build/setuptools/dist.pyu Ós urequire_featuresugFeature %s: must define 'require_features', 'remove', or at least one of 'packages', 'py_modules', etc.( uwarn_deprecatedu descriptionustandardu availableuoptionalu isinstanceustruRequireurequire_featuresuremoveuextrasuDistutilsSetupError( uselfu descriptionustandardu availableuoptionalurequire_featuresuremoveuextrasuer((u(/tmp/pip-k8wh6o-build/setuptools/dist.pyu__init__Ås$          uFeature.__init__cCs|jo|jS(u+Should this feature be included by default?(u availableustandard(uself((u(/tmp/pip-k8wh6o-build/setuptools/dist.pyuinclude_by_defaultásuFeature.include_by_defaultcCsT|jst|jdƒ‚n|j|jx|jD]}|j|ƒq9WdS(uEnsure 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. u2 is required,but is not available on this platformN(u availableuDistutilsPlatformErroru descriptionuincludeuextrasurequire_featuresuinclude_feature(uselfudistuf((u(/tmp/pip-k8wh6o-build/setuptools/dist.pyu include_inås uFeature.include_incCsA|j|j|jr=x!|jD]}|j|ƒq#WndS(u2Ensure 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(uexcludeuextrasuremoveuexclude_package(uselfudistuitem((u(/tmp/pip-k8wh6o-build/setuptools/dist.pyu exclude_fromús  uFeature.exclude_fromcCsFx?|jD]4}|j|ƒs td|j||fƒ‚q q WdS(uç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. ug%s wants to be able to remove %s, but the distribution doesn't contain any packages or modules under %sN(uremoveuhas_contents_foruDistutilsSetupErroru description(uselfudistuitem((u(/tmp/pip-k8wh6o-build/setuptools/dist.pyuvalidate s uFeature.validateNFT( u__name__u __module__u __qualname__u__doc__u staticmethoduwarn_deprecateduFalseuTrueu__init__uinclude_by_defaultu include_inu exclude_fromuvalidate(u __locals__((u(/tmp/pip-k8wh6o-build/setuptools/dist.pyuFeatureƒs7    uFeature((u__all__ureuosusysuwarningsu distutils.logu distutilsudistutils.coreu distutils.cmdu Distributionu _Distributionudistutils.errorsuDistutilsOptionErroruDistutilsPlatformErroruDistutilsSetupErrorusetuptools.dependsuRequireusetuptools.compatu numeric_typesu basestringu pkg_resourcesu_get_unpatchedutupleulistusequenceucheck_importableuassert_string_listu check_nspu check_extrasu assert_boolucheck_requirementsucheck_entry_pointsucheck_test_suiteucheck_package_dataucheck_packagesudistucoreucmdumoduleuFeature(((u(/tmp/pip-k8wh6o-build/setuptools/dist.pyus<                    ÿõ