Files
old-nlp/venv/lib/python3.7/site-packages/setuptools/__pycache__/config.cpython-37.pyc

225 lines
17 KiB
Plaintext
Raw Normal View History

2019-10-20 13:16:49 +02:00
B
<00>$<24>]6P<00>@s<>ddlmZmZddlZddlZddlZddlZddlZddlm Z ddlm
Z
ddlm Z ddl m Z ddlmZmZddlmZmZdd lmZdd
lmZmZeZdd d <0A>Zdd<0F>Zdd<11>Zddd<13>ZGdd<15>d<15>ZGdd<17>de<1F>Z Gdd<19>de<1F>Z!dS)<1C>)<02>absolute_import<72>unicode_literalsN)<01> defaultdict)<01>partial)<01>wraps)<01> import_module)<02>DistutilsOptionError<6F>DistutilsFileError)<02> LegacyVersion<6F>parse)<01> SpecifierSet)<02> string_types<65>PY3Fc Cs<>ddlm}m}tj<04>|<00>}tj<04>|<00>s4td|<00><01>t<03><08>}t<03> tj<04>
|<00><01>zJ|<03>}|rb|<06> <0B>ng}||krx|<07> |<00>|j ||d<04>t||j|d<05>}Wdt<03> |<05>Xt|<08>S)a,Read given configuration file and returns options from it as a dict.
:param str|unicode filepath: Path to configuration file
to get options from.
:param bool find_others: Whether to search for other configuration files
which could be on in various places.
:param bool ignore_option_errors: Whether to silently ignore
options, values of which could not be resolved (e.g. due to exceptions
in directives such as file:, attr:, etc.).
If False exceptions are propagated as expected.
:rtype: dict
r)<02> Distribution<6F> _Distributionz%Configuration file %s does not exist.)<01> filenames)<01>ignore_option_errorsN)Zsetuptools.distrr<00>os<6F>path<74>abspath<74>isfiler <00>getcwd<77>chdir<69>dirname<6D>find_config_files<65>append<6E>parse_config_files<65>parse_configuration<6F>command_options<6E>configuration_to_dict) <09>filepathZ find_othersrrrZcurrent_directory<72>distr<00>handlers<72>r#<00>9/tmp/pip-install-zytfk_me/setuptools/setuptools/config.py<70>read_configurations$  

  r%cCs.djft<01><00>}t<02>t||<01>}t|||<03>}|<04>S)z<>
Given a target object and option key, get that option from
the target object, either through a get_{key} method or
from an attribute directly.
z get_{key})<05>format<61>locals<6C> functoolsr<00>getattr)<05>
target_obj<EFBFBD>keyZ getter_nameZ by_attribute<74>getterr#r#r$<00> _get_optionEs r-cCsDtt<01>}x6|D].}x(|jD]}t|j|<03>}|||j|<qWqW|S)z<>Returns configuration data gathered by given handlers as a dict.
:param list[ConfigHandler] handlers: Handlers list,
usually from parse_configuration()
:rtype: dict
)r<00>dict<63> set_optionsr-r*<00>section_prefix)r"Z config_dict<63>handler<65>option<6F>valuer#r#r$rQs 
  rcCs6t|||<02>}|<03><01>t|j|||j<04>}|<04><01>||fS)a<>Performs additional parsing of configuration options
for a distribution.
Returns a list of used option handlers.
:param Distribution distribution:
:param dict command_options:
:param bool ignore_option_errors: Whether to silently ignore
options, values of which could not be resolved (e.g. due to exceptions
in directives such as file:, attr:, etc.).
If False exceptions are propagated as expected.
:rtype: list
)<05>ConfigOptionsHandlerr <00>ConfigMetadataHandler<65>metadata<74> package_dir)<05> distributionrr<00>options<6E>metar#r#r$rcs
rc@s<>eZdZdZdZiZd%dd<05>Zedd<07><00>Zdd <09>Z e
d&d d <0C><01>Z e
d d<0E><00>Z e
dd<10><00>Z e
dd<12><00>Ze
dd<14><00>Zedd<16><00>Zedd<18><00>Ze
d'dd<1A><01>Ze
dd<1C><00>Ze
d(dd<1E><01>Zdd <20>Zd!d"<22>Zd#d$<24>ZdS))<29> ConfigHandlerz1Handles metadata supplied in configuration files.NFcCsbi}|j}x:|<02><01>D].\}}|<06>|<05>s(q|<06>|d<01><02>d<02>}|||<qW||_||_||_g|_dS)N<><00>.) r0<00>items<6D>
startswith<EFBFBD>replace<63>striprr*<00>sectionsr/)<08>selfr*r9rrBr0<00> section_name<6D>section_optionsr#r#r$<00>__init__<5F>s
 zConfigHandler.__init__cCstd|jj<00><01>dS)z.Metadata item name to parser function mapping.z!%s must provide .parsers propertyN)<03>NotImplementedError<6F> __class__<5F>__name__)rCr#r#r$<00>parsers<72>szConfigHandler.parsersc Cs<>t<00>}|j}|j<02>||<01>}t|||<03>}||kr6t|<01><01>|r>dSd}|j<06>|<01>}|r<>y ||<02>}Wn tk
r~d}|jsz<73>YnX|r<>dSt|d|d<00>}|dkr<>t |||<02>n||<02>|j
<EFBFBD> |<01>dS)NFTzset_%s) <0C>tupler*<00>aliases<65>getr)<00>KeyErrorrJ<00> Exceptionr<00>setattrr/r) rCZ option_namer3<00>unknownr*Z current_valueZ skip_option<6F>parser<65>setterr#r#r$<00> __setitem__<5F>s0   zConfigHandler.__setitem__<5F>,cCs8t|t<01>r|Sd|kr |<01><02>}n
|<01>|<02>}dd<03>|D<00>S)z<>Represents value as a list.
Value is split either by separator (defaults to comma) or by lines.
:param value:
:param separator: List items separator character.
:rtype: list
<20>
cSsg|]}|<01><00>r|<01><00><00>qSr#)rA)<02>.0<EFBFBD>chunkr#r#r$<00>
<listcomp><3E>sz-ConfigHandler._parse_list.<locals>.<listcomp>)<04>
isinstance<EFBFBD>list<73>
splitlines<EFBFBD>split)<03>clsr3<00> separatorr#r#r$<00> _parse_list<73>s


zConfigHandler._parse_listcCsTd}i}xF|<00>|<01>D]8}|<04>|<02>\}}}||kr<td|<00><01>|<07><03>||<05><03><qW|S)zPRepresents value as a dict.
:param value:
:rtype: dict
<20>=z(Unable to parse option value to dict: %s)r`<00> partitionrrA)r^r3r_<00>result<6C>liner+<00>sep<65>valr#r#r$<00> _parse_dict<63>s
zConfigHandler._parse_dictcCs|<01><00>}|dkS)zQRepresents value as boolean.
:param value:
:rtype: bool
)<03>1<>true<75>yes)<01>lower)r^r3r#r#r$<00> _parse_bool<6F>szConfigHandler._parse_boolcs<00>fdd<02>}|S)z<>Returns a parser function to make sure field inputs
are not files.
Parses a value after getting the key so error messages are
more informative.
:param key:
:rtype: callable
cs d}|<00>|<01>rtd<02><02><00><01><01>|S)Nzfile:zCOnly strings are accepted for the {0} field, files are not accepted)r?<00>
ValueErrorr&)r3Zexclude_directive)r+r#r$rRs 
z3ConfigHandler._exclude_files_parser.<locals>.parserr#)r^r+rRr#)r+r$<00>_exclude_files_parser<65>s z#ConfigHandler._exclude_files_parsercs\d}t|t<01>s|S|<01>|<02>s |S|t|<02>d<02>}dd<04>|<03>d<05>D<00>}d<06><05>fdd<04>|D<00><01>S)aORepresents value as a string, allowing including text
from nearest files using `file:` directive.
Directive is sandboxed and won't reach anything outside
directory with setup.py.
Examples:
file: README.rst, CHANGELOG.md, src/file.txt
:param str value:
:rtype: str
zfile:Ncss|]}tj<01>|<01><03><00>VqdS)N)rrrrA)rWrr#r#r$<00> <genexpr>%sz,ConfigHandler._parse_file.<locals>.<genexpr>rUrVc3s.|]&}<01><00>|<01>stj<02>|<01>r<02><00>|<01>VqdS)TN)<05> _assert_localrrr<00>
_read_file)rWr)r^r#r$ro's
)rZr r?<00>lenr]<00>join)r^r3Zinclude_directive<76>specZ filepathsr#)r^r$<00> _parse_files


zConfigHandler._parse_filecCs|<00>t<01><02><00>std|<00><01>dS)Nz#`file:` directive can not access %s)r?rrr)r r#r#r$rp-szConfigHandler._assert_localc Cs"tj|dd<02><02>
}|<01><02>SQRXdS)Nzutf-8)<01>encoding)<03>io<69>open<65>read)r <00>fr#r#r$rq3szConfigHandler._read_filec Cs<>d}|<01>|<03>s|S|<01>|d<02><02><02><00>d<03>}|<04><04>}d<03>|<04>}|p@d}t<06><07>}|r<>|d|kr<>||d}|<08>dd<07>} t | <09>dkr<>tj
<EFBFBD>t<06><07>| d<00>}| d}q<>|}nd|kr<>tj
<EFBFBD>t<06><07>|d<00>}t j
<EFBFBD> d|<07>zt |<06>}
t|
|<05>}Wdt j
dd<08>t _
X|S) z<>Represents value as a module attribute.
Examples:
attr: package.attr
attr: package.module.attr
:param str value:
:rtype: str
zattr:r<r=rFr<00>/<2F>N)r?r@rAr]<00>poprsrr<00>rsplitrrr<00>sys<79>insertrr)) r^r3r7Zattr_directiveZ
attrs_path<EFBFBD> attr_name<6D> module_name<6D> parent_pathZ custom_path<74>parts<74>moduler#r#r$<00> _parse_attr8s0 

    
zConfigHandler._parse_attrcs<00>fdd<02>}|S)z<>Returns parser function to represents value as a list.
Parses a value applying given methods one after another.
:param parse_methods:
:rtype: callable
cs|}x<14>D] }||<01>}q
W|S)Nr#)r3<00>parsed<65>method)<01> parse_methodsr#r$r ns
 z1ConfigHandler._get_parser_compound.<locals>.parser#)r^r<>r r#)r<>r$<00>_get_parser_compoundes z"ConfigHandler._get_parser_compoundcCs:i}|pdd<02>}x$|<01><00>D]\}\}}||<06>||<qW|S)z<>Parses section options into a dictionary.
Optionally applies a given parser to values.
:param dict section_options:
:param callable values_parser:
:rtype: dict
cSs|S)Nr#)rfr#r#r$<00><lambda><3E><00>z6ConfigHandler._parse_section_to_dict.<locals>.<lambda>)r>)r^rEZ values_parserr3r+<00>_rfr#r#r$<00>_parse_section_to_dictxs
 z$ConfigHandler._parse_section_to_dictc Cs@x:|<01><00>D].\}\}}y |||<Wq
tk
r6Yq
Xq
WdS)zQParses configuration file section.
:param dict section_options:
N)r>rN)rCrE<00>namer<65>r3r#r#r$<00> parse_section<6F>s
 zConfigHandler.parse_sectioncCsfx`|j<00><01>D]R\}}d}|r$d|}t|d|<00>dd<05>d<06>}|dkrVtd|j|f<00><01>||<02>q WdS)zTParses configuration file items from one
or more related sections.
r<z_%szparse_section%sr=<00>__Nz0Unsupported distribution option section: [%s.%s])rBr>r)r@rr0)rCrDrEZmethod_postfixZsection_parser_methodr#r#r$r <00>szConfigHandler.parsecst<00><00><01><00><01>fdd<02><08>}|S)z<> this function will wrap around parameters that are deprecated
:param msg: deprecation message
:param warning_class: class of warning exception to be raised
:param func: function to be wrapped around
cst<00><01><01><02><00>||<01>S)N)<02>warnings<67>warn)<02>args<67>kwargs)<03>func<6E>msg<73> warning_classr#r$<00>config_handler<65>s z@ConfigHandler._deprecated_config_handler.<locals>.config_handler)r)rCr<>r<>r<>r<>r#)r<>r<>r<>r$<00>_deprecated_config_handler<65>sz(ConfigHandler._deprecated_config_handler)F)rU)N)N)rI<00>
__module__<EFBFBD> __qualname__<5F>__doc__r0rLrF<00>propertyrJrT<00> classmethodr`rgrlrnru<00> staticmethodrprqr<>r<>r<>r<>r r<>r#r#r#r$r;~s,
 &  
    ,   r;csHeZdZdZddddd<06>ZdZd<0F>fd d
<EFBFBD> Zed d <0C><00>Zd d<0E>Z <09>Z
S)r5r6<00>url<72> description<6F> classifiers<72> platforms)Z home_page<67>summary<72>
classifier<EFBFBD>platformFNcstt|<00><02>|||<03>||_dS)N)<04>superr5rFr7)rCr*r9rr7)rHr#r$rF<00>szConfigMetadataHandler.__init__c CsL|j}|j}|j}|j}||||<00>|dt<05>||<00>||<01>|d<02>|||j|d<03> S)z.Metadata item name to parser function mapping.z[The requires parameter is deprecated, please use install_requires for runtime dependencies.<2E>license) r<><00>keywords<64>provides<65>requires<65> obsoletesr<73>r<>r<><00>long_description<6F>versionZ project_urls)r`rurgrnr<><00>DeprecationWarningr<67><00>_parse_version)rC<00>
parse_listZ
parse_file<EFBFBD>
parse_dictZexclude_files_parserr#r#r$rJ<00>s$
zConfigMetadataHandler.parserscCs<>|<00>|<01>}||krB|<02><01>}tt|<02>t<04>r>d}t|jft<07><00><01><01>|S|<00>||j <09>}t
|<02>r^|<02>}t|t <0B>s<>t |d<02>r<>d<03> tt|<02><02>}nd|}|S)zSParses `version` option value.
:param value:
:rtype: str
zCVersion loaded from {value} does not comply with PEP 440: {version}<7D>__iter__r=z%s)rurArZr r
rr&r'r<>r7<00>callabler <00>hasattrrs<00>map<61>str)rCr3r<><00>tmplr#r#r$r<><00>s


z$ConfigMetadataHandler._parse_version)FN) rIr<>r<>r0rLZ strict_moderFr<>rJr<><00> __classcell__r#r#)rHr$r5<00>s r5c@s\eZdZdZedd<03><00>Zdd<05>Zdd<07>Zdd <09>Zd
d <0B>Z d d <0A>Z
dd<0F>Z dd<11>Z dd<13>Z dS)r4r9cCsN|j}t|jdd<02>}|j}|j}|||||||||||||||j|j|td<03>S)z.Metadata item name to parser function mapping.<2E>;)r_)Zzip_safeZuse_2to3Zinclude_package_datar7Zuse_2to3_fixersZuse_2to3_exclude_fixersZconvert_2to3_doctests<74>scriptsZeager_resources<65>dependency_linksZnamespace_packagesZinstall_requiresZsetup_requiresZ tests_require<72>packages<65> entry_points<74>
py_modulesZpython_requires)r`rrlrg<00>_parse_packagesrur )rCr<>Zparse_list_semicolonZ
parse_boolr<EFBFBD>r#r#r$rJs,zConfigOptionsHandler.parserscCszddg}|<01><00>}||kr"|<00>|<01>S||dk}|r>ts>td<04><01>|<00>|j<05>di<00><02>}|rdddlm}n ddlm }|f|<05>S) zTParses `packages` option value.
:param value:
:rtype: list
zfind:zfind_namespace:r|z8find_namespace: directive is unsupported on Python < 3.3z packages.findr)<01>find_namespace_packages)<01> find_packages)
rAr`rr<00>parse_section_packages__findrBrM<00>
setuptoolsr<EFBFBD>r<>)rCr3Zfind_directivesZ trimmed_valueZfindns<6E> find_kwargsr<73>r#r#r$r<>1s
  z$ConfigOptionsHandler._parse_packagescsT|<00>||j<01>}dddg<03>t<02>fdd<05>|<02><03>D<00><01>}|<03>d<01>}|dk rP|d|d<|S)z<>Parses `packages.find` configuration file section.
To be used in conjunction with _parse_packages().
:param dict section_options:
<20>where<72>include<64>excludecs$g|]\}}|<01>kr|r||f<02>qSr#r#)rW<00>k<>v)<01>
valid_keysr#r$rYZszEConfigOptionsHandler.parse_section_packages__find.<locals>.<listcomp>Nr)r<>r`r.r>rM)rCrEZ section_datar<61>r<>r#)r<>r$r<>Ms


 z1ConfigOptionsHandler.parse_section_packages__findcCs|<00>||j<01>}||d<dS)z`Parses `entry_points` configuration file section.
:param dict section_options:
r<>N)r<>r`)rCrEr<>r#r#r$<00>parse_section_entry_pointsbsz/ConfigOptionsHandler.parse_section_entry_pointscCs.|<00>||j<01>}|<02>d<01>}|r*||d<|d=|S)N<>*r<)r<>r`rM)rCrEr<><00>rootr#r#r$<00>_parse_package_datajs 
z(ConfigOptionsHandler._parse_package_datacCs|<00>|<01>|d<dS)z`Parses `package_data` configuration file section.
:param dict section_options:
<20> package_dataN)r<>)rCrEr#r#r$<00>parse_section_package_datatsz/ConfigOptionsHandler.parse_section_package_datacCs|<00>|<01>|d<dS)zhParses `exclude_package_data` configuration file section.
:param dict section_options:
Zexclude_package_dataN)r<>)rCrEr#r#r$<00>"parse_section_exclude_package_data{sz7ConfigOptionsHandler.parse_section_exclude_package_datacCs"t|jdd<02>}|<00>||<02>|d<dS)zbParses `extras_require` configuration file section.
:param dict section_options:
r<>)r_Zextras_requireN)rr`r<>)rCrEr<>r#r#r$<00>parse_section_extras_require<72>sz1ConfigOptionsHandler.parse_section_extras_requirecCs(|<00>||j<01>}dd<02>|<02><02>D<00>|d<dS)z^Parses `data_files` configuration file section.
:param dict section_options:
cSsg|]\}}||f<02>qSr#r#)rWr<>r<>r#r#r$rY<00>szAConfigOptionsHandler.parse_section_data_files.<locals>.<listcomp><3E>
data_filesN)r<>r`r>)rCrEr<>r#r#r$<00>parse_section_data_files<65>sz-ConfigOptionsHandler.parse_section_data_filesN)rIr<>r<>r0r<>rJr<>r<>r<>r<>r<>r<>r<>r<>r#r#r#r$r4s 
 r4)FF)F)"<22>
__future__rrrwrrr<>r(<00> collectionsrrr<00> importlibr<00>distutils.errorsrr Z#setuptools.extern.packaging.versionr
r Z&setuptools.extern.packaging.specifiersr Zsetuptools.extern.sixr r<00>type<70> __metaclass__r%r-rrr;r5r4r#r#r#r$<00><module>s.     
. 
?U