Ë îËãáªfÔ÷ãó,—dZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z mZmZmZmZddlZddlZddlmZddlmZddlmZdd l mZdd lmZgd ¢Zej<d d «j?«Z de jCdd«vZ"Gd„de#«Z$Gd„dejJjL«Z&ejNd„«Z(d„Z)d„Z*d„Z+ejNd„«Z,ee e-ee-ee-dffZ. Gd„d«Z/Gd„de/«Z0Gd„de0«Z1e0«Z2e2jfZ3e2jhZ4e2jjZ5e2jlZ6e2jnZ7e"s$e2jpZ8e2jrZ9e2jtZ:e1«Z;y) a-A PEP 517 interface to setuptools Previously, when a user or a command line tool (let's call it a "frontend") needed to make a request of setuptools to take a certain action, for example, generating a list of installation requirements, the frontend would would call "setup.py egg_info" or "setup.py bdist_wheel" on the command line. PEP 517 defines a different method of interfacing with setuptools. Rather than calling "setup.py" directly, the frontend should: 1. Set the current directory to the directory with a setup.py file 2. Import this module into a safe python interpreter (one in which setuptools can potentially set global variables or crash hard). 3. Call one of the functions defined in PEP 517. What each function does is defined in PEP 517. However, here is a "casual" definition of the functions (this definition should not be relied on for bug reports or API stability): - `build_wheel`: build a wheel in the folder and return the basename - `get_requires_for_build_wheel`: get the `setup_requires` to build - `prepare_metadata_for_build_wheel`: get the `install_requires` - `build_sdist`: build an sdist in the folder and return the basename - `get_requires_for_build_sdist`: get the `setup_requires` to build Again, this is not a formal definition! Just a "taste" of the module. éN)ÚPath)ÚDictÚIteratorÚListÚOptionalÚUnioné)Úerrors)Ú same_path)Ú parse_strings)ÚSetuptoolsDeprecationWarning)Ú strtobool) Úget_requires_for_build_sdistÚget_requires_for_build_wheelÚ prepare_metadata_for_build_wheelÚ build_wheelÚ build_sdistÚget_requires_for_build_editableÚ#prepare_metadata_for_build_editableÚbuild_editableÚ __legacy__ÚSetupRequirementsErrorÚSETUPTOOLS_ENABLE_FEATURESÚzlegacy-editableÚ_Ú-có—eZdZd„Zy)rcó—||_y©N)Ú specifiers)Úselfr s ú:/usr/lib/python3.12/site-packages/setuptools/build_meta.pyÚ__init__zSetupRequirementsError.__init__Ds €Ø$ˆ�óN)Ú__name__Ú __module__Ú __qualname__r#©r$r"rrCs„ó%r$rcó@—eZdZd„Zeej d„««Zy)Ú Distributioncó@—tt|««}t|«‚r)Úlistr r)r!r Úspecifier_lists r"Úfetch_build_eggszDistribution.fetch_build_eggsIs€Üœm¨JÓ7Ó8ˆä$ ^Ó4Ð4r$c#óÒK—tjj}|tj_ d–—|tj_y#|tj_wxYw­w)zw Replace distutils.dist.Distribution with this class for the duration of this context. N)Ú distutilsÚcorer*)ÚclsÚorigs r"ÚpatchzDistribution.patchNsCèø€ô�~‰~×*Ñ*ˆØ&)Œ �‰Ô#ð /Û à*.ŒI�N‰NÕ 'ø¨$ŒI�N‰NÕ 'üs‚0A'³A ·A'Á A$Á$A'N)r%r&r'r.Ú classmethodÚ contextlibÚcontextmanagerr4r(r$r"r*r*Hs)„ò5ð Ø×Ññ /óóñ /r$r*c#ó„K—tj}d„t_ d–—|t_y#|t_wxYw­w)a Temporarily disable installing setup_requires Under PEP 517, the backend reports build dependencies to the frontend, and the frontend is responsible for ensuring they're installed. So setuptools (acting as a backend) should not try to install them. có—yrr()Úattrss r"Úz+no_install_setup_requires..gs€°tr$N)Ú setuptoolsÚ_install_setup_requires)r3s r"Úno_install_setup_requiresr>^s3èø€ô × -Ñ -€DÙ);„JÔ&ð2Û à-1Œ Õ*ø¨TŒ Õ*üs‚A 0¤ A° =½Ac óΗtj|«D�cgc]B}tjjtjj ||««sŒA|‘ŒDc}Scc}wr)ÚosÚlistdirÚpathÚisdirÚjoin)Úa_dirÚnames r"Ú_get_immediate_subdirectoriesrGnsL€äŸ™ EÔ*ó Ù*�¬b¯g©g¯m©m¼B¿G¹G¿L¹LÈÐPTÓz'_file_with_extension..usøèø€ÐJÑ0�a°A·J±J¸yÕ4I”Ñ0ùsƒ!š!z[No distribution was found. Ensure that `setup.py` is not empty and that it calls `setup()`.)r@rAÚ ValueError)Ú directoryrMÚmatchingÚfiles ` r"Ú_file_with_extensionrStsQø€ÛJœ2Ÿ:™: iÔ0ÓJ€HðØ‰ˆð €Køô òÜð 8ó ðð ðús¡'§=có”—tjj|«stjd«St j |«S)Nz%from setuptools import setup; setup())r@rBÚexistsÚioÚStringIOÚtokenizeÚopen©Ú setup_scripts r"Ú_open_setup_scriptr\€s1€Ü �7‰7�>‰>˜,Ô 'ä�{‰{ÐBÓCÐCä �=‰=˜Ó &Ð&r$c#ó’K—tj«5tjdd«d–—ddd«y#1swYyxYw­w)NÚignorezsetup.py install is deprecated)ÚwarningsÚcatch_warningsÚfilterwarningsr(r$r"Úsuppress_known_deprecationrbˆs1èø€ä × Ñ Õ "Ü×Ñ Ð*JÔKÛ ÷ #× "Ñ "üs‚A—;² A»AÁAcó‚—eZdZdZdededeefd„Zdedeefd„Z dedeefd„Z dedeefd„Z dedeefd „Z y ) Ú_ConfigSettingsTranslatorz‡Translate ``config_settings`` into distutils-style command arguments. Only a limited number of options is currently supported. ÚkeyÚconfig_settingsÚreturncó†—|xsi}|j|«xsg}t|t«rtj|«S|S)aA Get the value of a specific key in ``config_settings`` as a list of strings. >>> fn = _ConfigSettingsTranslator()._get_config >>> fn("--global-option", None) [] >>> fn("--global-option", {}) [] >>> fn("--global-option", {'--global-option': 'foo'}) ['foo'] >>> fn("--global-option", {'--global-option': ['foo']}) ['foo'] >>> fn("--global-option", {'--global-option': 'foo'}) ['foo'] >>> fn("--global-option", {'--global-option': 'foo bar'}) ['foo', 'bar'] )ÚgetÚ isinstanceÚstrÚshlexÚsplit)r!rerfÚcfgÚoptss r"Ú _get_configz%_ConfigSettingsTranslator._get_config¦s=€ð$Ò# ˆØ�w‰w�s‹|Ò!˜rˆÜ$.¨t´SÔ$9Œu�{‰{˜4Ó ÐC¸tÐCr$c#óœK—|xsi}hd£}d|vsd|vrIt|jd«xs|jd«xsd«}|j«|vrdnd–—d|vsd|vrIt|jd«xs|jd«xsd«}|j«|vrdnd–—|jd |«Ed {–—†y 7Œ­w) a¯ Let the user specify ``verbose`` or ``quiet`` + escape hatch via ``--global-option``. Note: ``-v``, ``-vv``, ``-vvv`` have similar effects in setuptools, so we just have to cover the basic scenario ``-v``. >>> fn = _ConfigSettingsTranslator()._global_args >>> list(fn(None)) [] >>> list(fn({"verbose": "False"})) ['-q'] >>> list(fn({"verbose": "1"})) ['-v'] >>> list(fn({"--verbose": None})) ['-v'] >>> list(fn({"verbose": "true", "--global-option": "-q --no-user-cfg"})) ['-v', '-q', '--no-user-cfg'] >>> list(fn({"--quiet": None})) ['-q'] >Ú0ÚnoÚoffÚfalseÚverbosez --verboseÚ1z-qz-vÚquietz--quietz--global-optionN)rkriÚlowerrp)r!rfrnÚfalseyÚlevels r"Ú _global_argsz&_ConfigSettingsTranslator._global_args¼sÁèø€ð*Ò# ˆÚ,ˆØ ˜Ñ ˜{¨cÑ1ܘŸ™  Ó*ÒI¨c¯g©g°kÓ.BÒIÀcÓJˆEØ Ÿ;™;›=¨FÑ2‘4¸Ò =Ø �c‰>˜Y¨#Ñ-ܘŸ™ Ó(ÒE¨C¯G©G°IÓ,>ÒEÀ#ÓFˆEØ Ÿ;™;›=¨FÑ2‘4¸Ò =à×#Ñ#Ð$5°ÓG×GÒGús‚CC ÃC ÃC c#ó¤K—|xsi}d|vr#tt|dxsd««}|rdnd–—d|vrdt|d«gEd{–—†yy7Œ­w)aÀ The ``dist_info`` command accepts ``tag-date`` and ``tag-build``. .. warning:: We cannot use this yet as it requires the ``sdist`` and ``bdist_wheel`` commands run in ``build_sdist`` and ``build_wheel`` to reuse the egg-info directory created in ``prepare_metadata_for_build_wheel``. >>> fn = _ConfigSettingsTranslator()._ConfigSettingsTranslator__dist_info_args >>> list(fn(None)) [] >>> list(fn({"tag-date": "False"})) ['--no-date'] >>> list(fn({"tag-date": None})) ['--no-date'] >>> list(fn({"tag-date": "true", "tag-build": ".a"})) ['--tag-date', '--tag-build', '.a'] ztag-dateruz --tag-datez --no-datez tag-buildz --tag-buildN)rrk)r!rfrnÚvals r"Ú__dist_info_argsz*_ConfigSettingsTranslator.__dist_info_argsÜsdèø€ð&Ò# ˆØ ˜Ñ ÜœC  J¡Ò :°7Ó;Ó<ˆCÙ#&‘<¨KÒ 8Ø ˜#Ñ Ø%¤s¨3¨{Ñ+;Ó'<Ð=× =Ñ =ð Ø =ús‚AAÁAÁAc#ó”K—|xsi}|jd«xs|jd«}|sydt|«gEd{–—†y7Œ­w)a The ``editable_wheel`` command accepts ``editable-mode=strict``. >>> fn = _ConfigSettingsTranslator()._editable_args >>> list(fn(None)) [] >>> list(fn({"editable-mode": "strict"})) ['--mode', 'strict'] z editable-modeÚ editable_modeNz--mode)rirk)r!rfrnÚmodes r"Ú_editable_argsz(_ConfigSettingsTranslator._editable_argsösFèø€ðÒ# ˆØ�w‰w�Ó'ÒC¨3¯7©7°?Ó+CˆÙØ Øœc $›iÐ(×(Ò(ús‚>AÁAÁAc#óDK—|jd|«Ed{–—†y7Œ­w)av Users may expect to pass arbitrary lists of arguments to a command via "--global-option" (example provided in PEP 517 of a "escape hatch"). >>> fn = _ConfigSettingsTranslator()._arbitrary_args >>> list(fn(None)) [] >>> list(fn({})) [] >>> list(fn({'--build-option': 'foo'})) ['foo'] >>> list(fn({'--build-option': ['foo']})) ['foo'] >>> list(fn({'--build-option': 'foo'})) ['foo'] >>> list(fn({'--build-option': 'foo bar'})) ['foo', 'bar'] >>> list(fn({'--global-option': 'foo'})) [] z--build-optionN)rp©r!rfs r"Ú_arbitrary_argsz)_ConfigSettingsTranslator._arbitrary_argssèø€ð*×#Ñ#Ð$4°oÓF×FÒFús ‚ ˜™ N) r%r&r'Ú__doc__rkÚ_ConfigSettingsrrprr|Ú)_ConfigSettingsTranslator__dist_info_argsrƒr†r(r$r"rdrdŸsŒ„ñð D˜sðD°_ðDÈÈcÉóDð,H¨OðHÀÈÁ óHð@>°ð>ÀHÈSÁMó>ð4)¨oð)À(È3Á-ó)ð G¨ðGÀ8ÈCÁ=ôGr$rdcó¶—eZdZd„Zdd„Zdd„Zdd„Zdededefd „Zdedede fd „Z dd „Z dd „Z dd „Z dd„Zdeedeefd„Zes dd„Zdd„Z dd„Zyy)Ú_BuildMetaBackendcó*—gtjdd¢|j|«¢d‘t_ tj «5|j «ddd«|S#1swY|SxYw#t $r}||jz }Yd}~|Sd}~wwxYw)Nr Úegg_info)ÚsysÚargvr|r*r4Ú run_setuprr )r!rfÚ requirementsÚes r"Ú_get_build_requiresz%_BuildMetaBackend._get_build_requiress•€ð Ü �X‰X�b�qˆ\ð à × Ñ ˜Ó /ð ð 𠌌ð  )Ü×#Ñ#Õ%Ø—‘Ô ÷&ð Ð÷ &ð Ðûô&ò )Ø ˜AŸL™LÑ (ŒLàÐûð )ús5³A/ÁA"ÁA/Á"A,Á'A/Á,A/Á/ BÁ8B  Bcóf—tjj|«}d}t|«5}|j «j dd«}ddd« t t««y#1swYŒxYw#t$r/}|jr‚tjddd¬«Yd}~yd}~wwxYw)NÚ__main__z\r\nz\nz6Running `setup.py` directly as CLI tool is deprecated.znPlease avoid using `sys.exit(0)` or similar statements that don't fit in the paradigm of a configuration file.zAhttps://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html)Úsee_url) r@rBÚabspathr\ÚreadÚreplaceÚexecÚlocalsÚ SystemExitÚcoder Úemit)r!r[Ú__file__r%rLr�r’s r"r�z_BuildMetaBackend.run_setup-s˜€ô—7‘7—?‘? <Ó0ˆØˆä  Ô )¨QØ—6‘6“8×#Ñ# G¨UÓ3ˆD÷*ð Ü �”v“xÕ ÷ *Ð )ûô ò Ø�vŠvØä (× -Ñ -ØHðJð+÷  ò ûð ús#­!A,ÁA8Á,A5Á8 B0Â%B+Â+B0Ncó*—|j|dg¬«S)NÚwheel©r‘©r“r…s r"rz._BuildMetaBackend.get_requires_for_build_wheelDs€Ø×'Ñ'¨ÀwÀiÐ'ÓPÐPr$có(—|j|g¬«S)Nr¢r£r…s r"rz._BuildMetaBackend.get_requires_for_build_sdistGs€Ø×'Ñ'¨ÀbÐ'ÓIÐIr$Úmetadata_directoryÚsuffixrgcó¨—|j||«}t|j|«stjt |«|«|j S)zò PEP 517 requires that the .dist-info directory be placed in the metadata_directory. To comply, we MUST copy the directory to the root. Returns the basename of the info directory, e.g. `proj-0.0.0.dist-info`. )Ú_find_info_directoryr ÚparentÚshutilÚmoverkrF)r!r¥r¦Úinfo_dirs r"Ú_bubble_up_info_directoryz+_BuildMetaBackend._bubble_up_info_directoryJsC€ð×,Ñ,Ð-?ÀÓHˆÜ˜Ÿ™Ð*<Ô=Ü �K‰Kœ˜H› Ð'9Ô :à�}‰}Ðr$cóP—tj|«D]m\}}}|D�cgc]}|j|«sŒ|‘Œ}}t|«dk7st|«dk7sŒEt|«dk(s Jd|›d�«‚t ||d«cSd|›d|›�}t j |«‚cc}w)Nrr z Multiple z directories foundzNo z directory found in )r@ÚwalkrJÚlenrr Ú InternalError) r!r¥r¦r©ÚdirsrrLÚ candidatesÚmsgs r"r¨z&_BuildMetaBackend._find_info_directoryWs±€Ü!Ÿw™wÐ'9Ö:‰OˆF�D˜!Ù%)Ó@¡T ¨Q¯Z©Z¸Õ-?š! TˆJÐ@ä�:‹ !Ò#¤s¨4£y°A£~ܘ:“¨!Ò+ÐS¨y¸¸Ð@RÐ-SÓSÐ+ܘF J¨q¡MÓ2Ò2ð ;ð�F�8Ð/Ð0BÐ/CÐDˆÜ×"Ñ" 3Ó'Ð'ùòAs ¡B#¸B#có—gtjdd¢|j|«¢d‘d‘|‘d‘t_t«5|j «ddd«|j |d«|j |d«S#1swYŒ-xYw)Nr Ú dist_infoz --output-dirz--keep-egg-infoz .egg-infoz .dist-info)rŽr�r|r>r�r­©r!r¥rfs r"rz2_BuildMetaBackend.prepare_metadata_for_build_wheelbsŸ€ð Ü �X‰X�b�qˆ\ð à × Ñ ˜Ó /ð ð ð ð ð  ð ð  ð ð  ŒŒô'Õ (Ø �N‰NÔ ÷)ð ×&Ñ&Ð'9¸;ÔGØ×-Ñ-Ð.@À,ÓOÐO÷ )Ð (ús ÁA?Á?BcóÆ—tjj|«}tj|d¬«d|dœ}t j di|¤Ž5}gt jdd¢|j|«¢|¢d‘|‘|¢t _t«5|j«ddd«t||«}tjj||«} tjj| «rtj| «tjtjj||«| «ddd«|S#1swYŒ§xYw#1swYSxYw)NT)Úexist_okz.tmp-)ÚprefixÚdirr z --dist-dirr()r@rBr—ÚmakedirsÚtempfileÚTemporaryDirectoryrŽr�r|r>r�rSrDrUÚremoveÚrename) r!Ú setup_commandÚresult_extensionÚresult_directoryrfÚarbitrary_argsÚ temp_optsÚ tmp_dist_dirÚresult_basenameÚ result_paths r"Ú_build_with_temp_dirz&_BuildMetaBackend._build_with_temp_dirss5€ôŸ7™7Ÿ?™?Ð+;Ó<Ðô � ‰ Ð$¨tÕ4Ø&Ð/?Ñ@ˆ ä × (Ñ (Ñ 5¨9Ò 5¸ðÜ—‘˜"˜1�ðà×"Ñ" ?Ó3ððððð ð ð ð  ð ŒCŒHô+Õ,Ø—‘Ô ÷-ô3°<ÐAQÓRˆOÜŸ'™'Ÿ,™,Ð'7¸ÓIˆKÜ�w‰w�~‰~˜kÔ*ä— ‘ ˜+Ô&Ü �I‰I”b—g‘g—l‘l <°ÓAÀ;Ô O÷#6ð&Ð÷-Ð,ú÷6ð&Ðús&ÁAEÂE Â$BEÅ E ÅEÅE c óŒ—t«5|jdgd|||j|««cddd«S#1swYyxYw)NÚ bdist_wheelú.whl)rbrÉr†)r!Úwheel_directoryrfr¥s r"rz_BuildMetaBackend.build_wheel–s@€ô(Õ )Ø×,Ñ,Ø�ØØØØ×$Ñ$ _Ó5ó ÷*× )Ò )ús ‹%:ºAcó.—|jgd¢d||«S)N)Úsdistz --formatsÚgztarz.tar.gz)rÉ)r!Úsdist_directoryrfs r"rz_BuildMetaBackend.build_sdist¢s€Ø×(Ñ(Ú +¨Y¸Èó ð r$có’—|sytt|«jd««}t|«dksJ‚|rt |d«SdS)Nz *.dist-infor r)r,rÚglobr°rk)r!r¥Údist_info_candidatess r"Ú_get_dist_info_dirz$_BuildMetaBackend._get_dist_info_dir§sP€Ù!ØÜ#¤DÐ);Ó$<×$AÑ$AÀ-Ó$PÓQÐÜÐ'Ó(¨AÒ-Ð-Ð-Ù/CŒsÐ'¨Ñ*Ó+ÐMÈÐMr$cóÈ—|j|«}|rd|gng}dg|¢|j|«¢}t«5|j|d||«cddd«S#1swYyxYw)Nz--dist-info-dirÚeditable_wheelrÌ)rÕrƒrbrÉ)r!rÍrfr¥r¬roÚcmds r"rz _BuildMetaBackend.build_editable³sj€ð×.Ñ.Ð/AÓBˆHÙ4<Ð% xÑ0À"ˆDØ#ÐR dÐR¨T×-@Ñ-@ÀÓ-QÐRˆCÜ+Õ-Ø×0Ñ0ؘ °/ó÷.×-Ò-ús ºAÁA!có$—|j|«Sr)rr…s r"rz1_BuildMetaBackend.get_requires_for_build_editable¿s€Ø×4Ñ4°_ÓEÐ Er$có&—|j||«Sr)rr·s r"rz5_BuildMetaBackend.prepare_metadata_for_build_editableÂs€ð×8Ñ8Ø" Oóð r$©zsetup.pyr)r()NN)r%r&r'r“r�rrrkr­rr¨rrÉrrrrÕÚLEGACY_EDITABLErrrr(r$r"r‹r‹s¹„ò óó.QóJð ¸Cð Èð ÐQTó ð (°sð (ÀCð (ÈDó (ð37óPð.ó !ðHIMó ó ð N°X¸c±]ðNÀxÐPSÁ}óNñ ð MQó ó Fð7;ô ð) r$r‹có$‡—eZdZdZdˆfd„ ZˆxZS)Ú_BuildMetaLegacyBackendaOCompatibility backend for setuptools This is a version of setuptools.build_meta that endeavors to maintain backwards compatibility with pre-PEP 517 modes of invocation. It exists as a temporary bridge between the old packaging mechanism and the new packaging mechanism, and will eventually be removed. có$•—ttj«}tjj tjj |««}|tjvr tjj d|«tjd}|tjd< t‰|�%|¬«|tjdd|tjd<y#|tjdd|tjd<wxYw)NrrZ) r,rŽrBr@Údirnamer—Úinsertr�Úsuperr�)r!r[Úsys_pathÚ script_dirÚ sys_argv_0Ú __class__s €r"r�z!_BuildMetaLegacyBackend.run_setupÖsºø€ôœŸ™“>ˆä—W‘W—_‘_¤R§W¡W§_¡_°\Ó%BÓCˆ Ø œSŸX™XÑ %Ü �H‰H�O‰O˜A˜zÔ *ô —X‘X˜a‘[ˆ Ø"Œ�‰�‰ ð %Ü ‰GÑ ¨<Ð Ô 8ð#ŒC�H‰H‘QˆKØ$ŒC�H‰H�QŠKøð#ŒC�H‰H‘QˆKØ$ŒC�H‰H�QŠKús Â0C'Ã'(DrÛ)r%r&r'r‡r�Ú __classcell__)ræs@r"rÞrÞÊsø„ñ ÷%ñ%r$rÞ)rGrSr\rbrkrˆrdr‹rÞÚ_BACKENDrrrrrrrrrr(r$r"Úròs´ðñó8 Û Û Û ÛÛ ÛÛÛÝß8Õ8ãÛÝÝÝ Ý2Ý$ò €ð'˜RŸY™YÐ'CÀRÓH×NÑNÓPÐØ#Ð'A×'IÑ'IÈ#ÈsÓ'SÐS€ô%˜]ô%ô /�:—?‘?×/Ñ/ô/ð, ×Ññ 2óð 2òò ò'ð ×Ññóðð ˜4  U¨3°°S± ¸4Ð+?Ñ%@Ð @ÑAÑB€ð ÷|Gñ|Gô~iÐ1ôiôX%%Ð/ô%%ñR Ó €à'×DÑDÐØ'×DÑDÐØ#+×#LÑ#LÐ Ø×"Ñ"€ Ø×"Ñ"€ áØ&.×&NÑ&NÐ#Ø*2×*VÑ*VÐ'Ø×,Ñ,€Nñ%Ó &� r$