zmc
2023-12-22 9fdbf60165db0400c2e8e6be2dc6e88138ac719a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
U
G=®dUã@s&ddlmZmZddlZddlZddlZddlZddlZddlZddl    Z    ddl
m Z ddlm Z ddlm Z ddlZddlmZmZddlmZmZddlmZdd    lmZmZeZGd
d „d ƒZejd d „ƒZddd„Zdd„Z dd„Z!ddd„Z"Gdd„dƒZ#Gdd„de#ƒZ$Gdd„de#ƒZ%dS)é)Úabsolute_importÚunicode_literalsN)Ú defaultdict)Úpartial©Úwraps)ÚDistutilsOptionErrorÚDistutilsFileError)Ú LegacyVersionÚparse)Ú SpecifierSet)Ú string_typesÚPY3c@s eZdZdZdd„Zdd„ZdS)Ú StaticModulez0
    Attempt to load the module by the name
    c    CsLtj |¡}t|jƒ}| ¡}W5QRXt |¡}t|ƒ     t
ƒ¡|` dS©N) Ú    importlibÚutilÚ    find_specÚopenÚoriginÚreadÚastr ÚvarsÚupdateÚlocalsÚself)rÚnameÚspecÚstrmÚsrcÚmodule©r!úHD:\z\workplace\VsCode\pyvenv\venv\Lib\site-packages\setuptools/config.pyÚ__init__s   
zStaticModule.__init__c
sXzt‡fdd„|jjDƒƒWStk
rR}ztdjftƒŽƒ|‚W5d}~XYnXdS)Nc3sH|]@}t|tjƒr|jD](}t|tjƒr|jˆkrt |j¡VqqdSr)Ú
isinstancerZAssignÚtargetsÚNameÚidÚ literal_evalÚvalue)Ú.0Z    statementÚtarget©Úattrr!r"Ú    <genexpr>&s 
üz+StaticModule.__getattr__.<locals>.<genexpr>z#{self.name} has no attribute {attr})Únextr ÚbodyÚ    ExceptionÚAttributeErrorÚformatr)rr-Úer!r,r"Ú __getattr__$s þ
 ÿþzStaticModule.__getattr__N)Ú__name__Ú
__module__Ú __qualname__Ú__doc__r#r5r!r!r!r"rsrc    cs,ztj d|¡dVW5tj |¡XdS)zH
    Add path to front of sys.path for the duration of the context.
    rN)ÚsysÚpathÚremoveÚinsert)r;r!r!r"Ú
patch_path3s
r>Fc        Cs®ddlm}m}tj |¡}tj |¡s4td|ƒ‚t ¡}t     tj 
|¡¡zJ|ƒ}|rb|  ¡ng}||krx|  |¡|j ||dt||j|d}W5t     |¡Xt|ƒ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)Ú DistributionÚ _Distributionz%Configuration file %s does not exist.)Ú    filenames)Úignore_option_errors)Zsetuptools.distr?r@Úosr;ÚabspathÚisfiler    ÚgetcwdÚchdirÚdirnameÚfind_config_filesÚappendÚparse_config_filesÚparse_configurationÚcommand_optionsÚconfiguration_to_dict)    ÚfilepathZ find_othersrBr?r@Zcurrent_directoryÚdistrAÚhandlersr!r!r"Úread_configuration?s*  ÿ
þ
 rRcCs.djftƒŽ}t t||¡}t|||ƒ}|ƒ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})r3rÚ    functoolsrÚgetattr)Ú
target_objÚkeyZ getter_nameZ by_attributeÚgetterr!r!r"Ú _get_optionns rXcCs<ttƒ}|D]*}|jD]}t|j|ƒ}|||j|<qq |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ÚdictÚ set_optionsrXrUÚsection_prefix)rQZ config_dictÚhandlerÚoptionr)r!r!r"rNzs 
 rNcCs6t|||ƒ}| ¡t|j|||jƒ}| ¡||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
    )ÚConfigOptionsHandlerr ÚConfigMetadataHandlerÚmetadataÚ package_dir)Ú distributionrMrBÚoptionsÚmetar!r!r"rLŒsÿþrLc@sÌeZdZdZdZiZd%dd„Zedd„ƒZdd    „Z    e
d&d d „ƒZ e
d d„ƒZ e
dd„ƒZ e
dd„ƒZe
dd„ƒZedd„ƒZedd„ƒZe
d'dd„ƒZe
dd„ƒZe
d(dd„ƒZdd „Zd!d"„Zd#d$„ZdS))Ú ConfigHandlerz1Handles metadata supplied in configuration files.NFcCs^i}|j}| ¡D].\}}| |¡s&q| |d¡ d¡}|||<q||_||_||_g|_dS)NÚÚ.)    r[ÚitemsÚ
startswithÚreplaceÚstriprBrUÚsectionsrZ)rrUrcrBrlr[Ú section_nameÚsection_optionsr!r!r"r#·s
 
zConfigHandler.__init__cCstd|jjƒ‚dS)ú.Metadata item name to parser function mapping.z!%s must provide .parsers propertyN)ÚNotImplementedErrorÚ    __class__r6)rr!r!r"ÚparsersÇs
ÿzConfigHandler.parsersc    CsÆtƒ}|j}|j ||¡}t|||ƒ}||kr6t|ƒ‚|r>dSd}|j |¡}|r€z ||ƒ}Wn tk
r~d}|jsz‚YnX|rˆdSt|d|dƒ}|dkr®t    |||ƒn||ƒ|j
  |¡dS)NFTzset_%s) ÚtuplerUÚaliasesÚgetrTÚKeyErrorrrr1rBÚsetattrrZrJ)    rZ option_namer)ÚunknownrUZ current_valueZ skip_optionÚparserÚsetterr!r!r"Ú __setitem__Ís0   zConfigHandler.__setitem__ú,cCs8t|tƒr|Sd|kr | ¡}n
| |¡}dd„|Dƒ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
        Ú
cSsg|]}| ¡r| ¡‘qSr!)rk)r*Úchunkr!r!r"Ú
<listcomp>sz-ConfigHandler._parse_list.<locals>.<listcomp>)r$ÚlistÚ
splitlinesÚsplit)Úclsr)Ú    separatorr!r!r"Ú _parse_listós
 
 
 
zConfigHandler._parse_listcCsPd}i}| |¡D]8}| |¡\}}}||kr:td|ƒ‚| ¡|| ¡<q|S)zPRepresents value as a dict.
 
        :param value:
        :rtype: dict
        ú=z(Unable to parse option value to dict: %s)r…Ú    partitionrrk)rƒr)r„ÚresultÚlinerVÚsepÚvalr!r!r"Ú _parse_dictsÿzConfigHandler._parse_dictcCs| ¡}|dkS)zQRepresents value as boolean.
 
        :param value:
        :rtype: bool
        )Ú1ÚtrueÚyes)Úlower)rƒr)r!r!r"Ú _parse_boolszConfigHandler._parse_boolcs‡fdd„}|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}| |¡rtd ˆ¡ƒ‚|S)Núfile:zCOnly strings are accepted for the {0} field, files are not accepted)riÚ
ValueErrorr3)r)Zexclude_directive©rVr!r"ry.s
ÿÿz3ConfigHandler._exclude_files_parser.<locals>.parserr!)rƒrVryr!r”r"Ú_exclude_files_parser#s z#ConfigHandler._exclude_files_parsercs\d}t|tƒs|S| |¡s |S|t|ƒd…}dd„| d¡Dƒ}d ‡fdd„|Dƒ¡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
        r’Ncss|]}tj | ¡¡VqdSr)rCr;rDrk©r*r;r!r!r"r.Nsz,ConfigHandler._parse_file.<locals>.<genexpr>r|r}c3s.|]&}ˆ |¡stj |¡rˆ |¡VqdS)TN)Ú _assert_localrCr;rEÚ
_read_filer–©rƒr!r"r.Os
 
 ý)r$r riÚlenr‚Újoin)rƒr)Zinclude_directiverZ    filepathsr!r™r"Ú _parse_file7s
 
þzConfigHandler._parse_filecCs| t ¡¡std|ƒ‚dS)Nz#`file:` directive can not access %s)rirCrFr)rOr!r!r"r—VsÿzConfigHandler._assert_localc
Cs.tj|dd}| ¡W5QR£SQRXdS)Nzutf-8)Úencoding)Úiorr)rOÚfr!r!r"r˜\szConfigHandler._read_filec
Csd}| |¡s|S| |d¡ ¡ d¡}| ¡}d |¡}|p@d}t ¡}|rÂ|d|kr¤||d}| dd¡}    t    |    ƒdkržtj
 t ¡|    d¡}|    d}qÂ|}nd|krÂtj
 t ¡|d¡}t |ƒDzt t |ƒ|ƒWW5QR£Stk
rt |¡}
YnXW5QRXt |
|ƒS)z·Represents value as a module attribute.
 
        Examples:
            attr: package.attr
            attr: package.module.attr
 
        :param str value:
        :rtype: str
        zattr:rfrgr#rú/é)rirjrkr‚Úpopr›rCrFÚrsplitršr;r>rTrr1rÚ import_module) rƒr)raZattr_directiveZ
attrs_pathÚ    attr_nameÚ module_nameÚ parent_pathZ custom_pathÚpartsr r!r!r"Ú _parse_attras0 
 
 
 
zConfigHandler._parse_attrcs‡fdd„}|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|}ˆD] }||ƒ}q|Srr!)r)ÚparsedÚmethod©Ú parse_methodsr!r"r ˜s
z1ConfigHandler._get_parser_compound.<locals>.parser!)rƒr­r r!r¬r"Ú_get_parser_compounds     z"ConfigHandler._get_parser_compoundcCs6i}|pdd„}| ¡D]\}\}}||ƒ||<q|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|Srr!)r‹r!r!r"Ú<lambda>­óz6ConfigHandler._parse_section_to_dict.<locals>.<lambda>)rh)rƒrnZ values_parserr)rVÚ_r‹r!r!r"Ú_parse_section_to_dict¢s
 
 z$ConfigHandler._parse_section_to_dictc    Cs<| ¡D].\}\}}z |||<Wqtk
r4YqXqdS)zQParses configuration file section.
 
        :param dict section_options:
        N)rhrv)rrnrr±r)r!r!r"Ú parse_section²s
 zConfigHandler.parse_sectioncCsb|j ¡D]R\}}d}|r"d|}t|d| dd¡dƒ}|dkrTtd|j|fƒ‚||ƒq
dS)zTParses configuration file items from one
        or more related sections.
 
        rfz_%szparse_section%srgÚ__Nz0Unsupported distribution option section: [%s.%s])rlrhrTrjrr[)rrmrnZmethod_postfixZsection_parser_methodr!r!r"r ¾s"üÿÿzConfigHandler.parsecstˆƒ‡‡‡fdd„ƒ}|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 ˆˆ¡ˆ||ŽSr)ÚwarningsÚwarn)ÚargsÚkwargs©ÚfuncÚmsgÚ warning_classr!r"Úconfig_handlerÝs z@ConfigHandler._deprecated_config_handler.<locals>.config_handlerr)rrºr»r¼r½r!r¹r"Ú_deprecated_config_handlerÖsz(ConfigHandler._deprecated_config_handler)F)r|)N)N)r6r7r8r9r[rtr#Úpropertyrrr{Ú classmethodr…rŒr‘r•rœÚ staticmethodr—r˜r©r®r²r³r r¾r!r!r!r"re§s<
 
& 
 
    
 
 
 
 -
  recsHeZdZdZdddddœZdZd‡fd    d
„    Zed d „ƒZd d„Z    ‡Z
S)r_r`ÚurlÚ descriptionÚ classifiersÚ    platforms)Z    home_pageÚsummaryÚ
classifierÚplatformFNcstt|ƒ |||¡||_dSr)Úsuperr_r#ra)rrUrcrBra©rqr!r"r#ösÿzConfigMetadataHandler.__init__c CsN|j}|j}|j}|j}|||| |dt¡|| ||¡|dƒ||||j|dœ S)roz[The requires parameter is deprecated, please use install_requires for runtime dependencies.Úlicense) rÅÚkeywordsÚprovidesÚrequiresÚ    obsoletesrÄrËZ license_filesrÃÚlong_descriptionÚversionÚ project_urls)r…rœrŒr•r¾ÚDeprecationWarningr®Ú_parse_version)rÚ
parse_listZ
parse_fileÚ
parse_dictZexclude_files_parserr!r!r"rrüs*ü
ðzConfigMetadataHandler.parserscCs| |¡}||krB| ¡}tt|ƒtƒr>d}t|jftƒŽƒ‚|S| ||j    ¡}t
|ƒr^|ƒ}t|t ƒsŒt |dƒr„d  tt|ƒ¡}nd|}|S)zSParses `version` option value.
 
        :param value:
        :rtype: str
 
        zCVersion loaded from {value} does not comply with PEP 440: {version}Ú__iter__rgz%s)rœrkr$r r
rr3rr©raÚcallabler Úhasattrr›ÚmapÚstr)rr)rÑÚtmplr!r!r"rÔs 
ÿ
 
z$ConfigMetadataHandler._parse_version)FN) r6r7r8r[rtZ strict_moder#r¿rrrÔÚ __classcell__r!r!rÊr"r_åsüÿ
r_c@s\eZdZdZedd„ƒZdd„Zdd„Zdd    „Zd
d „Z    d d „Z
dd„Z dd„Z dd„Z dS)r^rccCsN|j}t|jdd}|j}|j}|||||||||||||||j|j|tdœS)roú;©r„)Zzip_safeZuse_2to3Zinclude_package_dataraZuse_2to3_fixersZuse_2to3_exclude_fixersZconvert_2to3_doctestsÚscriptsZeager_resourcesZdependency_linksZnamespace_packagesZinstall_requiresZsetup_requiresZ tests_requireÚpackagesÚ entry_pointsÚ
py_modulesZpython_requires)r…rr‘rŒÚ_parse_packagesrœr )rrÕZparse_list_semicolonZ
parse_boolrÖr!r!r"rr?s.îzConfigOptionsHandler.parserscCszddg}| ¡}||kr"| |¡S||dk}|r>ts>tdƒ‚| |j di¡¡}|rdddlm}n ddlm    }|f|ŽS)    zTParses `packages` option value.
 
        :param value:
        :rtype: list
        zfind:zfind_namespace:r¡z8find_namespace: directive is unsupported on Python < 3.3z packages.findr)Úfind_namespace_packages)Ú find_packages)
rkr…rrÚparse_section_packages__findrlruÚ
setuptoolsråræ)rr)Zfind_directivesZ trimmed_valueZfindnsÚ find_kwargsrær!r!r"rä\s 
 ÿ ÿ z$ConfigOptionsHandler._parse_packagescsT| ||j¡}dddg‰t‡fdd„| ¡Dƒƒ}| d¡}|dk    rP|d|d<|S)zœParses `packages.find` configuration file section.
 
        To be used in conjunction with _parse_packages().
 
        :param dict section_options:
        ÚwhereÚincludeÚexcludecs$g|]\}}|ˆkr|r||f‘qSr!r!©r*ÚkÚv©Z
valid_keysr!r"r…szEConfigOptionsHandler.parse_section_packages__find.<locals>.<listcomp>Nr)r²r…rYrhru)rrnZ section_datarérêr!rðr"rçxsÿ
ÿ
 z1ConfigOptionsHandler.parse_section_packages__findcCs| ||j¡}||d<dS)z`Parses `entry_points` configuration file section.
 
        :param dict section_options:
        râN)r²r…©rrnrªr!r!r"Úparse_section_entry_pointssz/ConfigOptionsHandler.parse_section_entry_pointscCs.| ||j¡}| d¡}|r*||d<|d=|S)NÚ*rf)r²r…ru)rrnrªÚrootr!r!r"Ú_parse_package_data•s 
z(ConfigOptionsHandler._parse_package_datacCs| |¡|d<dS)z`Parses `package_data` configuration file section.
 
        :param dict section_options:
        Ú package_dataN©rõ©rrnr!r!r"Úparse_section_package_dataŸsz/ConfigOptionsHandler.parse_section_package_datacCs| |¡|d<dS)zhParses `exclude_package_data` configuration file section.
 
        :param dict section_options:
        Zexclude_package_dataNr÷rør!r!r"Ú"parse_section_exclude_package_data¦sÿz7ConfigOptionsHandler.parse_section_exclude_package_datacCs"t|jdd}| ||¡|d<dS)zbParses `extras_require` configuration file section.
 
        :param dict section_options:
        rÞrßZextras_requireN)rr…r²)rrnrÕr!r!r"Úparse_section_extras_require®s
ÿz1ConfigOptionsHandler.parse_section_extras_requirecCs(| ||j¡}dd„| ¡Dƒ|d<dS)z^Parses `data_files` configuration file section.
 
        :param dict section_options:
        cSsg|]\}}||f‘qSr!r!rír!r!r"r½szAConfigOptionsHandler.parse_section_data_files.<locals>.<listcomp>Ú
data_filesN)r²r…rhrñr!r!r"Úparse_section_data_files·sz-ConfigOptionsHandler.parse_section_data_filesN)r6r7r8r[r¿rrrärçròrõrùrúrûrýr!r!r!r"r^;s
 
    r^)FF)F)&Ú
__future__rrrržrCr:rµrSrÚ collectionsrrrÚ
contextlibÚdistutils.errorsrr    Z#setuptools.extern.packaging.versionr
r Z&setuptools.extern.packaging.specifiersr Zsetuptools.extern.sixr rÚtypeÚ __metaclass__rÚcontextmanagerr>rRrXrNrLrer_r^r!r!r!r"Ú<module>s>    
ÿ
/ ÿ
@V