a „oeƒ9ã@sêUdZddlZddlZddlmZddlmZddlmZm Z ddl m Z ddl m Z ddlmZdd lmZmZmZmZmZmZmZmZmZmZmZd d lmZd d lmZerÊdd l m!Z!ddl"m#Z#eiƒZ$ee%d<eej&e'fZ(ee)e'fZ*edee(gdfZ+ee'e+fZ,e -e.¡Z/de)e(ddœdd„Z0de)e(dœdd„Z1de)e(dœdd„Z2de)dœdd„Z3e'e'dœdd„Z4de'ed œd!d"„Z5d#d$d%d&œZ6e'ee'd'œd(d)„Z7de*e(d*œd+d,„Z8de)e(d*œd-d.„Z9dee)e(e'd/œd0d1„Z:de)d2œd3d4„Z;de)d2œd5d6„Zde)d2œd9d:„Z?e)d;œdœd?d@„ZAe$feee'ee'fdAœdBdC„ZBdDeee'efdEœdFdG„ZCe'e'dHœdIdJ„ZDeee'ee'e'fee'dKœdLdM„ZEdee'e=fdNœdOdP„ZFdee=dNœdQdR„ZGdee=dNœdSdT„ZHdUdV„ZIdWdX„ZJe8e9ee:dYdZ�ee:d[dZ�e;e>e?e\}}t|ƒ}t ||¡}t|ƒrd||||ƒq2t|||ƒq2dS)NÚproject) ÚgetÚcopyÚ_handle_missing_dynamicÚ_unify_entry_pointsÚitemsÚjson_compatible_keyÚPYPROJECT_CORRESPONDENCEÚcallableÚ _set_config)rrr(Ú project_tableÚfieldÚvalueÚnorm_keyZcorrespr)r)r*r$Fs  r$)rrrc Cs”| di¡ di¡}|sdS| ¡D]^\}}t|ƒ}|tvrjtt|ƒ}d|›d�}td t|ƒ|g¡ƒ‚t ||¡}t|||ƒq$t |||ƒdS)NÚtoolÚ setuptoolsz, The parameter `tool.setuptools.zZ` was long deprecated and has been removed from `pyproject.toml`. Ú ) r-r1r2ÚTOOL_TABLE_REMOVALSrrÚjoinÚTOOL_TABLE_RENAMESr5Ú_copy_command_options) rrrÚ tool_tabler7r8r9Z suggestionÚmsgr)r)r*r%Ws ÿ r%)rr6cCs^t| dg¡ƒ}t ¡D]@\}}||vs||vs||ƒ}|rtj||d�t |¡||<qdS)zJBe temporarily forgiving with ``dynamic`` fields not listed in ``dynamic``Údynamic©r7r8N)Úsetr-Ú_PREVIOUSLY_DEFINEDr1Ú_MissingDynamicÚemitÚ_RESET_PREVIOUSLY_DEFINED)rr6rCr7Úgetterr8r)r)r*r/msr/)ÚkeyrcCs| ¡ dd¡S)z1As defined in :pep:`566#json-compatible-metadata`ú-Ú_)ÚlowerÚreplace)rKr)r)r*r2xsr2)rr7r8cCsVt|jd|›�dƒ}|r"||ƒn0t|j|ƒs6|tvrFt|j||ƒn t|||ƒdS)NZset_)ÚgetattrrÚhasattrÚSETUPTOOLS_PATCHESÚsetattr)rr7r8Úsetterr)r)r*r5}s  r5z text/markdownz text/x-rstz text/plain)z.mdz.rstz.txt)ÚfilercCshtj | ¡¡\}}|sdS|tvr,t|Sd dd„t ¡Dƒ¡}d|›d�}td|›d|›�ƒ‚dS)Nú, css"|]\}}|›d|›d�VqdS)z (ú)Nr)©Ú.0ÚkÚvr)r)r*Ú –óz&_guess_content_type..z3only the following file extensions are recognized: r zUndefined content type for )r!r"ÚsplitextrNÚ_CONTENT_TYPESr>r1Ú ValueError)rUrMÚextÚvalidrBr)r)r*Ú_guess_content_typeŽs rc)rÚvalr(cCs’ddlm}t|tƒr0|}| ||¡}t|ƒ}n,| d¡p)rrdrrrsr7Z email_fieldZpersonZaddrr)r)r*Ú_peopleºsrv)rrdcCst|d|ƒdS)NÚ project_urls)r5)rrdrrr)r)r*Ú _project_urlsÌsrxcCs ddlm}t|d||ƒƒdS)Nr)Ú SpecifierSetÚpython_requires)Z&setuptools.extern.packaging.specifiersryr5)rrdrrryr)r)r*Ú_python_requiresÐs r{cCs$t|dgƒrd}t |¡||_dS)NÚinstall_requireszA`install_requires` overwritten in `pyproject.toml` (dependencies))rPrrHr|)rrdrrrBr)r)r*Ú _dependenciesÖs  r}cCs"t|ddƒpi}i|¥|¥|_dS)NÚextras_require)rPr~)rrdrrÚexistingr)r)r*Ú_optional_dependenciesÝsr€)r6cCsx|}| d| di¡¡}dddœ}t| ¡ƒD]*\}}t|ƒ}||vr.| |¡|||<q.|rtdd„| ¡Dƒ|d<dS)Nú entry-pointsÚ entry_pointsÚconsole_scriptsÚ gui_scripts)Úscriptsr„cSs(i|] \}}|r|dd„| ¡Dƒ“qS)cSsg|]\}}|›d|›�‘qS)z = r)rXr)r)r*Ú îr]z2_unify_entry_points...©r1)rYrtÚgroupr)r)r*Ú ísþz'_unify_entry_points..)ÚpopÚlistr1r2)r6r,r‚ZrenamingrKr8r9r)r)r*r0âs þr0)Ú pyprojectrrc CsÄ| di¡}| di¡ di¡}t|ƒ}|j}| di¡ di¡ ¡D]x\}}t|ƒ}| |tƒ¡} | |i¡| ¡D]D\} } t| ƒ} t|ƒ| f||| <| | vrxt  d|›d| ›d�¡qxqFdS)Nr:r;ÚcmdclassZ distutilszCommand option r z is not defined) r-Ú_valid_command_optionsZcommand_optionsr1r2rEÚ setdefaultrkÚ_loggerÚwarning) rŒrrrAr�Ú valid_optionsZcmd_optsÚcmdrrbrKr8r)r)r*r@ös   r@)r�rc Cs”ddlm}ddlm}dt|jƒi}|jdd�}dd „|Dƒ}d d „|Dƒ}t|| ¡ƒD]2\}}|  |t ƒ¡} | tt |d gƒƒB} | ||<q\|S) NrrrrÚglobalzdistutils.commands)rˆcss|]}t|ƒVqdS©N)Ú_load_ep©rYÚepr)r)r*r\r]z)_valid_command_options..css|]}|r|VqdSr•r)r—r)r)r*r\r]Z user_options) Z _importlibrÚsetuptools.distrÚ_normalise_cmd_optionsZglobal_optionsr‚rr1r-rErP) r�rrr’Zunloaded_entry_pointsZloaded_entry_pointsr‚r“Z cmd_classZoptsr)r)r*rŽ s    rŽzmetadata.EntryPoint)r˜rc Csdz|j| ¡fWSty^}z6|jj›d|j›�}t |›d|›�¡WYd}~dSd}~00dS)Nz" while trying to load entry-point z: )rtÚloadÚ ExceptionÚ __class__Ú__name__r�r‘)r˜ÚexrBr)r)r*r–s r–)rtrcCst|ƒ d¡S)Nz_=)r2Ústrip)rtr)r)r*Ú_normalise_cmd_option_key$sr¡)ÚdescrcCsdd„|DƒS)NcSsh|]}t|dƒ’qS)r)r¡)rYZ fancy_optionr)r)r*Ú )r]z)_normalise_cmd_options..r))r¢r)r)r*rš(srš)rrcs*d‰t|ddƒpi}‡fdd„| ¡DƒS)N)rƒr„r‚csi|]\}}|ˆvr||“qSr)r)rX©Úignorer)r*r‰/r]z-_get_previous_entrypoints..)rPr1©rr8r)r¤r*Ú_get_previous_entrypoints,sr§cCst|ddƒpi}| d¡S)Nr‚rƒ©rPr-r¦r)r)r*Ú_get_previous_scripts2sr©cCst|ddƒpi}| d¡S)Nr‚r„r¨r¦r)r)r*Ú_get_previous_gui_scripts7srªcCsttdd„| d¡ƒS)a8 Similar to ``operator.attrgetter`` but returns None if ``attr`` is not found >>> from types import SimpleNamespace >>> obj = SimpleNamespace(a=42, b=SimpleNamespace(c=13)) >>> _attrgetter("a")(obj) 42 >>> _attrgetter("b.c")(obj) 13 >>> _attrgetter("d")(obj) is None True cSs t||dƒSr•)rP)ZaccÚxr)r)r*ÚHr]z_attrgetter..r )rrÚsplit)Úattrr)r)r*Ú _attrgetter<s r¯cs‡fdd„}|S)aL Return the first "truth-y" attribute or None >>> from types import SimpleNamespace >>> obj = SimpleNamespace(a=42, b=SimpleNamespace(c=13)) >>> _some_attrgetter("d", "a", "b.c")(obj) 42 >>> _some_attrgetter("d", "e", "b.c", "a")(obj) 13 >>> _some_attrgetter("d", "e", "f")(obj) is None True cs&‡fdd„ˆDƒ}tdd„|DƒdƒS)Nc3s|]}t|ƒˆƒVqdSr•)r¯©rYÚi©Úobjr)r*r\Yr]z5_some_attrgetter.._acessor..css|]}|dur|VqdSr•r)r°r)r)r*r\Zr])Únext)r³Úvaluesr‡r²r*Ú_acessorXsz"_some_attrgetter.._acessorr))r1r¶r)r‡r*Ú_some_attrgetterKs r·Zauthor)rsZ maintainer)ÚreadmerpÚauthorsÚ maintainersÚurlsÚ dependenciesZoptional_dependenciesZrequires_pythonr3Z script_filesr…Znamespace_packagesz  Please migrate to implicit native namespaces instead. See https://packaging.python.org/en/latest/guides/packaging-namespace-packages/. >rhZ license_filesZprovides_extrasZ license_filerwz metadata.namezmetadata.versionzmetadata.descriptionzmetadata.long_descriptionrzzmetadata.python_requireszmetadata.licensezmetadata.authorzmetadata.author_emailzmetadata.maintainerzmetadata.maintainer_emailzmetadata.keywordszmetadata.classifierszmetadata.project_urlsr|r~)rtÚversionÚ descriptionr¸zrequires-pythonrpr¹rºÚkeywordsÚ classifiersr»r�r…ú gui-scriptsr¼úoptional-dependencies) rpr¹rºr¿rÀr»r�r…rÁr¼rÂrIc@s*eZdZdZdZeeeedœdd„ƒZdS)rGz9`{field}` defined outside of `pyproject.toml` is ignored.a The following seems to be defined outside of `pyproject.toml`: `{field} = {value!r}` According to the spec (see the link below), however, setuptools CANNOT consider this value unless `{field}` is listed as `dynamic`. https://packaging.python.org/en/latest/specifications/declaring-project-metadata/ To prevent this problem, you can list `{field}` under `dynamic` or alternatively remove the `[project]` table from your file and rely entirely on other means of configuration. )r7r8rcCs|jj||d�S)NrD)Ú_DETAILSÚformat)Úclsr7r8r)r)r*Údetails´sz_MissingDynamic.detailsN) ržÚ __module__Ú __qualname__Z_SUMMARYrÃÚ classmethodrkr rÆr)r)r)r*rGŸsrG)RÚ__doc__Zloggingr!Úcollections.abcrZemail.headerregistryrÚ functoolsrrÚinspectrÚ itertoolsrÚtypesrÚtypingr r r r r rrrrrrÚerrorsrÚwarningsrZsetuptools._importlibrr™rrÚ__annotations__ÚPathLikerkZ_PathÚdictZ _DictOrStrZ _CorrespFnZ_CorrespondenceZ getLoggerržr�r+r$r%r/r2r5r_rcrorqrvrxr{r‹r}r€r0r@rŽr–r¡ršr§r©rªr¯r·r3r?r=rRrFrIrGr)r)r)r*Ús¸      4         ý    &  ø ÿ ðó