\bgOfUdZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl m Z mZmZddlmZddlmZmZddlZddlmZdd lmZmZdd lmZdd l mZddlZdd lm Z erdd l!m"Z"gdZ#ej$dd%Z&de&'ddvZ(Gdde)Z*Gddej+j,Z,ej-dZ.dZ/d+dZ0dZ1ej-d Z2eee3ee3e4e3dffdfZ5d!e6d"< Gd#d$Z7Gd%d&e7Z8Gd'd(e8Z9Gd)d*eZ:e8Z;e;j<ZZ>e;j?Z?e;j@Z@e(se;jAZAe;jBZBe;jCZCe9ZDdS),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 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. ) annotationsN)IterableIteratorMapping)Path) TYPE_CHECKINGUnion)errors)StrPath same_path) parse_strings)SetuptoolsDeprecationWarning) strtobool) TypeAlias) get_requires_for_build_sdistget_requires_for_build_wheel prepare_metadata_for_build_wheel build_wheel build_sdistget_requires_for_build_editable#prepare_metadata_for_build_editablebuild_editable __legacy__SetupRequirementsErrorSETUPTOOLS_ENABLE_FEATURESzlegacy-editable_-ceZdZddZdS)rreturnNonec||_dSN) specifiers)selfr%s f/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/setuptools/build_meta.py__init__zSetupRequirementsError.__init__Ks $N)r!r")__name__ __module__ __qualname__r(r)r'rrJs(%%%%%%r)rcDeZdZdZeejdZdS) DistributioncXtt|}t|r$)listrr)r&r%specifier_lists r'fetch_build_eggszDistribution.fetch_build_eggsPs%mJ7788$^444r)c#Ktjj}|tj_ dV|tj_dS#|tj_wxYw)zw Replace distutils.dist.Distribution with this class for the duration of this context. N) distutilscorer/)clsorigs r'patchzDistribution.patchUsP~*&) # / EEE*.IN ' ' '$IN ' . . . .s =AN)r*r+r,r3 classmethod contextlibcontextmanagerr9r-r)r'r/r/OsL555  / /[ / / /r)r/c#Ktj}dt_ dV|t_dS#|t_wxYw)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. cdSr$r-)attrss r'z+no_install_setup_requires..nstr)N) setuptools_install_setup_requires)r8s r'no_install_setup_requiresrCesK  -D););J&2 -1 ***T *1111s/=cDfdtjDS)Ncg|]A}tjtj|?|BSr-)ospathisdirjoin).0namea_dirs r' z1_get_immediate_subdirectories..vsM   bgmmBGLLPTz'_file_with_extension..|s4JJaAJJy4I4IJJJJJJJr)z[No distribution was found. Ensure that `setup.py` is not empty and that it calls `setup()`.)rFrN ValueError)rPrQmatchingfiles ` r'_file_with_extensionr\{srJJJJ2:i00JJJH  8    Ks (Actj|stjdSt j|S)Nz%from setuptools import setup; setup())rFrGexistsioStringIOtokenizeopen setup_scripts r'_open_setup_scriptres: 7>>, ' 'D{BCCC = & &&r)c#Ktj5tjdddVddddS#1swxYwYdS)Nignorezsetup.py install is deprecated)warningscatch_warningsfilterwarningsr-r)r'suppress_known_deprecationrks  " "*JKKK s=AAr_ConfigSettingsc:eZdZdZddZdd Zdd Zdd Zdd ZdS)_ConfigSettingsTranslatorzTranslate ``config_settings`` into distutils-style command arguments. Only a limited number of options is currently supported. keystrconfig_settingsrlr! list[str]c|pi}||pg}t|trtj|n|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 isinstancerpshlexsplit)r&rorqcfgoptss r' _get_configz%_ConfigSettingsTranslator._get_configsF$#wws||!r$.tS$9$9Cu{4   tCr) Iterator[str]c#K|pi}hd}d|vsd|vrUt|dp|dpd}||vrdndVd|vsd|vrUt|dp|dpd}||vrdndV|d |Ed {Vd S) 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'] >0noofffalseverbosez --verbose1z-qz-vquietz--quietz--global-optionN)rprtlowerrz)r&rqrxfalseylevels r' _global_argsz&_ConfigSettingsTranslator._global_argss*#,,,   {c11 **Icggk.B.BIcJJE ;;==F2244 = = = c>>Y#--((ECGGI,>,>E#FFE ;;==F2244 = = =##$5GGGGGGGGGGGr)c#K|pi}d|vr,tt|dpd}|rdndVd|vrdt|dgEd{VdSdS)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-daterz --tag-datez --no-datez tag-buildz --tag-buildN)rrp)r&rqrxvals r'__dist_info_argsz*_ConfigSettingsTranslator.__dist_info_argss&#   CJ :7;;<>> fn = _ConfigSettingsTranslator()._editable_args >>> list(fn(None)) [] >>> list(fn({"editable-mode": "strict"})) ['--mode', 'strict'] z editable-mode editable_modeNz--mode)rtrp)r&rqrxmodes r'_editable_argsz(_ConfigSettingsTranslator._editable_argssj#ww''C377?+C+C  Fc$ii((((((((((r)c#BK|d|Ed{VdS)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)rzr&rqs r'_arbitrary_argsz)_ConfigSettingsTranslator._arbitrary_args s7*##$4oFFFFFFFFFFFr)N)rorprqrlr!rr)rqrlr!r{) r*r+r,__doc__rzr)_ConfigSettingsTranslator__dist_info_argsrrr-r)r'rnrns DDDD,HHHH@>>>>4)))) GGGGGGr)rnceZdZd'dZd(d)d Zd*d+d Zd*d+d Zd,dZd-dZ d*d.dZ d/d0dZ d1d2dZ d*d3d!Z d4d#Z es d1d2d$Z d*d+d%Z d*d.d&Zd Sd S)5_BuildMetaBackendrqrl requirementsrrcDgtjdd||dt_ t5|dddn #1swxYwYn!#t $r}||jz }Yd}~nd}~wwxYw|S)Nr egg_info)sysargvrr/r9 run_setuprr%)r&rqres r'_get_build_requiresz%_BuildMetaBackend._get_build_requires&s Xbqb\    / /     )##%% ! !    ! ! ! ! ! ! ! ! ! ! ! ! ! ! !% ) ) ) AL (LLLLLL )s;A?A3' A?3A77A?:A7;A?? B BBsetup.pyrdrpctj|}d}t|5}|dd}dddn #1swxYwY t |tdS#t$r*}|j rtj dddYd}~dSd}~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) rFrGabspathrereadreplaceexeclocals SystemExitcoderemit)r&rd__file__r*rWrrs r'rz_BuildMetaBackend.run_setup6s*7??<00  ) ) 4Q6688##GU33D 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4  vxx    v  ( -HJ+            s))A&&A*-A*2B CB??CNc0||gSN)rrrs r'rz._BuildMetaBackend.get_requires_for_build_wheelM''b'IIIr)c0||gSrrrs r'rz._BuildMetaBackend.get_requires_for_build_sdistPrr)metadata_directoryr suffixr!c|||}t|j|s"tjt |||jS)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 parentshutilmoverprK)r&rrinfo_dirs r'_bubble_up_info_directoryz+_BuildMetaBackend._bubble_up_info_directorySsP,,-?HH*<== ; KH '9 : : :}r)rcLtj|D]s\}}}fd|D}t|dkst|dkr9t|dksJddt||dcStdd|}t j|)Nc>g|]}||Sr-rU)rJrWrs r'rMz:_BuildMetaBackend._find_info_directory..ds*@@@QZZ-?-?@!@@@r)rr z Multiple z directories foundzNo z directory found in )rFwalklenrr InternalError)r&rrrdirsr candidatesmsgs ` r'rz&_BuildMetaBackend._find_info_directorybs!w'9:: 3 3OFD!@@@@T@@@J:!##s4yyA~~:!+++-S-S-S-S+++FJqM22222(6EFDD0BDD"3'''r)cbgtjdd||ddt|dt_t 5|dddn #1swxYwY||d||dS)Nr dist_infoz --output-dirz--keep-egg-infoz .egg-infoz .dist-info)rrrrprCrrr&rrqs r'rz2_BuildMetaBackend.prepare_metadata_for_build_wheelms Xbqb\    / /      " # #    ' ( (   NN                   &&'9;GGG--.@,OOOsA::A>A>r- setup_command Iterable[str]result_extensionrRresult_directoryarbitrary_argsctj|}tj|dt jd|5}gt jdd|||d||t _t5| dddn #1swxYwYt||}tj ||}tj |rtj|tjtj |||dddn #1swxYwY|S)NT)exist_okz.tmp-)prefixdirr z --dist-dir)rFrGrmakedirstempfileTemporaryDirectoryrrrrCrr\rIr^removerename) r&rrrrqr tmp_dist_dirresult_basename result_paths r'_build_with_temp_dirz&_BuildMetaBackend._build_with_temp_dir~s7??+;<< $t4444  ( 0    P "1"""?33     CH+,, ! !    ! ! ! ! ! ! ! ! ! ! ! ! ! ! !3._builds+--  00##((99                   s,A  A A  bdist_wheel--dist-info-dirz--dist-info-dir not recognized)rrr)rpr_IncompatibleBdistWheelr)r&rrqrrexs``` r'rz_BuildMetaBackend.build_wheels           %6=/** * +6=*;SAS=T=TUVV V + + +/s2ww>> # ( ( * * *6=/** * * * * * *  +s6 B6A<6B<Bsdist_directoryc6|gdd||S)N)sdistz --formatsgztarz.tar.gz)r)r&rrqs r'rz_BuildMetaBackend.build_sdists+(( + + +Y   r) str | Nonec|sdStt|d}t|dksJ|rt |dndS)Nz *.dist-infor r)r1rglobrrp)r&rdist_info_candidatess r'_get_dist_info_dirz$_BuildMetaBackend._get_dist_info_dirsl! 4#D);$<$<$A$A-$P$PQQ'((A----/CMs'*+++Mr)c||}|rd|gng}dg|||}t5||d||cdddS#1swxYwYdS)Nreditable_wheelr)rrrkr)r&rrqrrryrs r'rz _BuildMetaBackend.build_editables../ABBH4<D%x00"D#RdRT-@-@-Q-QRC+--  00/                  sA++A/2A/c,||Sr$)rrs r'rz1_BuildMetaBackend.get_requires_for_build_editables44_EE Er)c.|||Sr$)rrs r'rz5_BuildMetaBackend.prepare_metadata_for_build_editables!88"O r))rqrlrrrrrdrpr$)rqrl)rr rrpr!rp)rr rrpr!r)rr rqrl)r-) rrrrRrr rqrlrr)NN)rr rqrlrr)rr rqrl)rrr!r)r*r+r,rrrrrrrrrrrLEGACY_EDITABLErrrr-r)r'rr%s .JJJJJJJJJJ     ( ( ( (OSPPPPP.)+ """""N,0-1 +++++:LP     NNNN 0415      6: F F F F F SW       3r)rc&eZdZdZddfd ZxZS)_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. rrdrpc ttj}tjtj|}|tjvr tjd|tjd}|tjd< t ||tjdd<|tjd<dS#|tjdd<|tjd<wxYw)Nrrc) r1rrGrFdirnamerinsertrsuperr)r&rdsys_path script_dir sys_argv_0 __class__s r'rz!_BuildMetaLegacyBackend.run_setups>>W__RW__\%B%BCC SX % % HOOAz * * * Xa[ "  % GG  <  8 8 8#CHQQQK$CHQKKK#CHQQQK$CHQK $ $ $ $s '"C++"D rr)r*r+r,rr __classcell__)rs@r'rrsL  %%%%%%%%%%%r)rceZdZdZdZdZdZdS)rzAwheel.bdist_wheel is deprecated, please import it from setuptoolsz| Ensure that any custom bdist_wheel implementation is a subclass of setuptools.command.bdist_wheel.bdist_wheel. )i z&https://github.com/pypa/wheel/pull/631N)r*r+r,_SUMMARY_DETAILS _DUE_DATE_SEE_URLr-r)r'rrs&RHHI7HHHr)r)rPr rQrR)Er __future__rr;r_rFrvrrrrarhcollections.abcrrrpathlibrtypingrr rArr _pathr r _reqsrrr5distutils.utilrtyping_extensionsr__all__getenvrrrr BaseExceptionrdistr/r<rCrOr\rerkrpr1rl__annotations__rnrrr_BACKENDrrrrrrrrrr-r)r'rs8#""""" 7777777777''''''''%%%%%%%% 222222$$$$$$,++++++   'RY'CRHHNNPP#'A'I'I#s'S'SS%%%%%]%%% /////:?////,  2 2 2    '''  #73c49d6J0K+K#Ld#RSSSSS |G|G|G|G|G|G|G|G~EEEEE1EEEP%%%%%%%%%%/%%%%%%P88888:888    'D'D#+#L " " -&.&N#*2*V',N% $ & & r)