Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
build_meta.cpython-313.pyc240 linesDownload Raw Back to __pycache__
1�

2`j3O���%SrSSKJr SSKrSSKrSSKrSSKrSSKrSSKrSSK	r	SSK4r5SSKrSSKJ
r
JrJr SSKJr SSKJrJrJr SSKrSSKJr SS	KJrJr SS6KJr SSKJr SSKrSSK J!r! \(aSS
K"J#r# /SQr$"SS\%5r&"SS\RNRP5r(\RRS5r*Sr+S"Sjr,Sr-\RRS5r.\\\/\\/\0\/S44S4r1S\2S'"SS5r3"SS\35r4"SS\45r5"S S!\5r6\4"5r7\7Rpr8\7Rrr9\7Rtr:\7Rvr;\7Rxr<\7Rzr=\7R|r>\7R~r?\5"5r@g)#a'A PEP 517 interface to setuptools7 8Previously, when a user or a command line tool (let's call it a "frontend")9needed to make a request of setuptools to take a certain action, for10example, generating a list of installation requirements, the frontend11would call "setup.py egg_info" or "setup.py bdist_wheel" on the command line.12 13PEP 517 defines a different method of interfacing with setuptools. Rather14than calling "setup.py" directly, the frontend should:15 16  1. Set the current directory to the directory with a setup.py file17  2. Import this module into a safe python interpreter (one in which18     setuptools can potentially set global variables or crash hard).19  3. Call one of the functions defined in PEP 517.20 21What each function does is defined in PEP 517. However, here is a "casual"22definition of the functions (this definition should not be relied on for23bug reports or API stability):24 25  - `build_wheel`: build a wheel in the folder and return the basename26  - `get_requires_for_build_wheel`: get the `setup_requires` to build27  - `prepare_metadata_for_build_wheel`: get the `install_requires`28  - `build_sdist`: build an sdist in the folder and return the basename29  - `get_requires_for_build_sdist`: get the `setup_requires` to build30 31Again, this is not a formal definition! Just a "taste" of the module.32�)�annotationsN)�Iterable�Iterator�Mapping)�Path)�
TYPE_CHECKING�NoReturn�Union�)�errors)�StrPath�	same_path)�
parse_strings)�SetuptoolsDeprecationWarning)�	strtobool)�	TypeAlias)33�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�34__legacy__�SetupRequirementsErrorc��\rSrSrSSjrSrg)r�Gc��Xlg�N��35specifiers)�selfr"s  �GD:\code\apps\devtools\python\Lib\site-packages\setuptools/build_meta.py�__init__�SetupRequirementsError.__init__Hs��$��r!N)�return�None)�__name__�36__module__�__qualname__�__firstlineno__r%�__static_attributes__�r'r$rrGs��%r'rc�P�\rSrSrSSjr\\RSSj55rSr	g)�Distribution�Lc�@�[[U55n[U5er )�listrr)r#r"�specifier_lists   r$�fetch_build_eggs�Distribution.fetch_build_eggsMs���m�J�7�8��$�^�4�4r'c#��# �[RRnU[RlSv� U[Rlg!U[Rlf=f7f)zW37Replace38distutils.dist.Distribution with this class39for the duration of this context.40N)�	distutils�corer1)�cls�origs  r$�patch�Distribution.patchRsB����~�~�*�*��&)�	���#�	/��*.�I�N�N�'��$�I�N�N�'�s�0A'�A
�A'�
A$�$A'r/N)r(r	)r(zIterator[None])41r*r+r,r-r6�classmethod�42contextlib�contextmanagerr=r.r/r'r$r1r1Ls)��5�43����/���/r'r1c#�# �[RnS[lSv� U[lg!U[lf=f7f)z�Temporarily disable installing setup_requires44 45Under PEP 517, the backend reports build dependencies to the frontend,46and the frontend is responsible for ensuring they're installed.47So setuptools (acting as a backend) should not try to install them.48c��gr r/)�attrss r$�<lambda>�+no_install_setup_requires.<locals>.<lambda>ks��tr'N)�49setuptools�_install_setup_requires)r<s r$�no_install_setup_requiresrIbs2����-�-�D�);�J�&�2�
�-1�50�*��T�51�*�s�A�0�A�
=�Ac	���[R"U5Vs/sHHn[RR[RR	X55(dMFUPMJ sn$s snfr )�os�listdir�path�isdir�join)�a_dir�names  r$�_get_immediate_subdirectoriesrRrsI�����E�*��*��b�g�g�m�m�B�G�G�L�L��<U�.V��*����s�AA+�"A+c�^�U4Sj[R"U55nUunU$![a
 [S5Sef=f)Nc3�V># �UHoRT5(dMUv� M  g7fr )�endswith)�.0�f�	extensions  �r$�	<genexpr>�'_file_with_extension.<locals>.<genexpr>ys����J�0�a�J�J�y�4I���0�s�)�	)z[No distribution was found. Ensure that `setup.py` is not empty and that it calls `setup()`.)rKrL�52ValueError)�	directoryrX�matching�files `  r$�_file_with_extensionr_xsQ���J�2�:�:�i�0�J�H������K�����
8�53��	��s	�)�Ac��[RRU5(d[R"S5$[54R"U5$)Nz%from setuptools import setup; setup())rKrM�exists�io�StringIO�tokenize�open��setup_scripts r$�_open_setup_scriptrh�s4��
�7�7�>�>�,�'�'��{�{�B�C�C��=�=��&�&r'c#�# �[R"5 [R"SS5 Sv� SSS5 g!,(df   g=f7f)N�ignorezsetup.py install is deprecated)�warnings�catch_warnings�filterwarningsr/r'r$�suppress_known_deprecationrn�s0���	�	 �	 �	"�����*J�K�
�55#�	"�	"�s�A�=�	A�56A�Ar�_ConfigSettingsc�J�\rSrSrSrS57SjrSSjrSSjrSSjrSSjr	Sr58g	)�_ConfigSettingsTranslator�zTranslate ``config_settings`` into distutils-style command arguments.59Only a limited number of options is currently supported.60c��U=(d 0nURU5=(d /n[U[5(a[R"U5$U$)a�61Get the value of a specific key in ``config_settings`` as a list of strings.62 63>>> fn = _ConfigSettingsTranslator()._get_config64>>> fn("--global-option", None)65[]66>>> fn("--global-option", {})67[]68>>> fn("--global-option", {'--global-option': 'foo'})69['foo']70>>> fn("--global-option", {'--global-option': ['foo']})71['foo']72>>> fn("--global-option", {'--global-option': 'foo'})73['foo']74>>> fn("--global-option", {'--global-option': 'foo bar'})75['foo', 'bar']76)�get�77isinstance�str�shlex�split)r#�key�config_settings�cfg�optss     r$�_get_config�%_ConfigSettingsTranslator._get_config�s@��$�#����w�w�s�|�!�r��$.�t�S�$9�$9�u�{�{�4� �C�t�Cr'c#��# �U=(d 0n1SknSU;dSU;aU[URS5=(d URS5=(d S5nUR5U;aSOSv� SU;dSU;aU[URS5=(d URS5=(d S5nUR5U;aSOSv� URS	U5S78hv�N g79N7f)a80Let the user specify ``verbose`` or ``quiet`` + escape hatch via81``--global-option``.82Note: ``-v``, ``-vv``, ``-vvv`` have similar effects in setuptools,83so we just have to cover the basic scenario ``-v``.84 85>>> fn = _ConfigSettingsTranslator()._global_args86>>> list(fn(None))87[]88>>> list(fn({"verbose": "False"}))89['-q']90>>> list(fn({"verbose": "1"}))91['-v']92>>> list(fn({"--verbose": None}))93['-v']94>>> list(fn({"verbose": "true", "--global-option": "-q --no-user-cfg"}))95['-v', '-q', '--no-user-cfg']96>>> list(fn({"--quiet": None}))97['-q']98>�0�no�off�false�verbosez	--verbose�1z-qz-v�quietz--quietz--global-optionN)rvrt�lowerr})r#rzr{�falsey�levels     r$�_global_args�&_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�C'C1�)C/�*C1c#��# �U=(d 0nSU;a-[[US=(d S55nU(aSOSv� SU;aS[US5/Shv�N ggN7f)aH99The ``dist_info`` command accepts ``tag-date`` and ``tag-build``.100 101.. warning::102   We cannot use this yet as it requires the ``sdist`` and ``bdist_wheel``103   commands run in ``build_sdist`` and ``build_wheel`` to reuse the egg-info104   directory created in ``prepare_metadata_for_build_wheel``.105 106>>> fn = _ConfigSettingsTranslator()._ConfigSettingsTranslator__dist_info_args107>>> list(fn(None))108[]109>>> list(fn({"tag-date": "False"}))110['--no-date']111>>> list(fn({"tag-date": None}))112['--no-date']113>>> list(fn({"tag-date": "true", "tag-build": ".a"}))114['--tag-date', '--tag-build', '.a']115ztag-dater�z116--tag-datez	--no-datez	tag-buildz--tag-buildN)rrv)r#rzr{�vals    r$�__dist_info_args�*_ConfigSettingsTranslator.__dist_info_args�sc���&�#�������C��J�� :�7�;�<�C�#&�<�K�8��#��%�s�3�{�+;�'<�=�=�=��=�s�AA#�A!�A#c#�# �U=(d 0nURS5=(d URS5nU(dgS[U5/Shv�N gN7f)z�117The ``editable_wheel`` command accepts ``editable-mode=strict``.118 119>>> fn = _ConfigSettingsTranslator()._editable_args120>>> list(fn(None))121[]122>>> list(fn({"editable-mode": "strict"}))123['--mode', 'strict']124z
editable-mode�
editable_modeNz--mode)rtrv)r#rzr{�modes    r$�_editable_args�(_ConfigSettingsTranslator._editable_args�sE����#����w�w��'�C�3�7�7�?�+C�����c�$�i�(�(�(�s�A
A�A�Ac#�D# �URSU5Shv�N gN7f)a�125Users may expect to pass arbitrary lists of arguments to a command126via "--global-option" (example provided in PEP 517 of a "escape hatch").127 128>>> fn = _ConfigSettingsTranslator()._arbitrary_args129>>> list(fn(None))130[]131>>> list(fn({}))132[]133>>> list(fn({'--build-option': 'foo'}))134['foo']135>>> list(fn({'--build-option': ['foo']}))136['foo']137>>> list(fn({'--build-option': 'foo'}))138['foo']139>>> list(fn({'--build-option': 'foo bar'}))140['foo', 'bar']141>>> list(fn({'--global-option': 'foo'}))142[]143z--build-optionN)r}�r#rzs  r$�_arbitrary_args�)_ConfigSettingsTranslator._arbitrary_args144s���*�#�#�$4�o�F�F�F�s� �� r/N)ryrvrzror(�	list[str])rzror(z
Iterator[str])r*r+r,r-�__doc__r}r��)_ConfigSettingsTranslator__dist_info_argsr�r�r.r/r'r$rqrq�s$���D�,H�@>�4)� Gr'rqc�P�\rSrSrSSjrSSSjjrSSSjjrSSSjjrSSjrSSjr	SSS	jjr145SSSjjrSSSjjrSSS
jjr
SSjrSSSjjrSSSjjrSSSjjrS146rg) �_BuildMetaBackendi"c�4�/[RSSQURU5QSP[l[R	5 UR5 SSS5 U$!,(df   U$=f![anX#R-
nSnAU$SnAff=f)Nr�egg_info)�sys�argvr�r1r=�	run_setuprr")r#rz�requirements�es    r$�_get_build_requires�%_BuildMetaBackend._get_build_requires#s���147�
�X�X�b�q�\�148�
�
�
��
/�149�
�150���151	)��#�#�%���� �&�152��&�%�153���&�	)��L�L�(�L����	)�s5�A4�A"�A4�"154A1�,A4�1A4�4155B�>B�Bc�x�[RRU5nSn[U5nUR	5RSS5nSSS5 [
W[55 g!,(df   N$=f![a2nUR(ae[R"SSSS9 SnAgSnAff=f)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)rKrM�abspathrh�read�replace�exec�locals�156SystemExit�coder�emit)r#rg�__file__r*rWr�r�s       r$r��_BuildMetaBackend.run_setup3s����7�7�?�?�<�0����
��
)�Q��6�6�8�#�#�G�U�3�D�*�	���v�x� �	*�
)��157�158	��v�v��(�-�-�H�J�+�	
��	159	�s#�!A,�A=�,160A:�=161B9�(B4�4B9Nc�"�URU/S9$�N)r��r�r�s  r$r�._BuildMetaBackend.get_requires_for_build_wheelJ����'�'��b�'�I�Ir'c�"�URU/S9$r�r�r�s  r$r�._BuildMetaBackend.get_requires_for_build_sdistOr�r'c��URX5n[URU5(d [R"[U5U5 UR$)z�162PEP 517 requires that the .dist-info directory be placed in the163metadata_directory. To comply, we MUST copy the directory to the root.164 165Returns the basename of the info directory, e.g. `proj-0.0.0.dist-info`.166)�_find_info_directoryr�parent�shutil�movervrQ)r#�metadata_directory�suffix�info_dirs    r$�_bubble_up_info_directory�+_BuildMetaBackend._bubble_up_info_directoryTsD���,�,�-?�H������*<�=�=��K�K��H�
�'9�:��}�}�r'c��[R"U5H�up4nUVs/sHofRU5(dMUPM nn[U5S:wd[U5S:wdMO[U5S:XdSUS[U5SU35e[	X7S5s $ SUSU3n[167R"U5es snf)NrrzExactly one z& should have been produced, but found z: zNo z directory found in )rK�walkrU�lenrr�
InternalError)	r#r�r�r��dirs�_rW�168candidates�msgs	         r$r��&_BuildMetaBackend._find_info_directorycs���!�w�w�'9�:�O�F�!�%)�@�T��Z�Z��-?�!�T�J�@��:��!�#�s�4�y�A�~��:��!�+��"�6�(�*P�QT�U_�Q`�Pa�ac�dn�co�p��+��F�q�M�2�2� ;��F�8�/�0B�/C�D���"�"�3�'�'��As169�B>�B>c�2�/[RSSQURU5QSPSP[U5PSP[l[	5 UR5 SSS5 UR
US5 UR
US5$!,(df   N2=f)Nr�	dist_infoz--output-dirz--keep-egg-infoz	.egg-infoz170.dist-info)r�r�r�rvrIr�r��r#r�rzs   r$r�2_BuildMetaBackend.prepare_metadata_for_build_wheelps���171�
�X�X�b�q�\�172�
�
�
��
/�173�
�174�
�	175�176
�"�#�177�
�
178���'�
(��N�N��)�	
�&�&�'9�;�G��-�-�.@�,�O�O�	)�
(�s�B�179Br/c���[RRU5n[R"USS9 [R180"SUS9n/[RSSQURU5QUQSPUPUQ[l[5 UR5 SSS5 [Xb5n[RRX75n[RRU5(a[R"U5 [R"[RRXg5U5 SSS5 U$!,(df   N�=f!,(df   W$=f)NT)�exist_okz.tmp-)�prefix�dirrz181--dist-dir)rKrMr��makedirs�tempfile�TemporaryDirectoryr�r�r�rIr�r_rOra�remove�rename)	r#�
setup_command�result_extension�result_directoryrz�arbitrary_args�tmp_dist_dir�result_basename�result_paths	         r$�_build_with_temp_dir�&_BuildMetaBackend._build_with_temp_dir�s/���7�7�?�?�+;�<��	���$�t�4�
�
(�
(�� 0�182�
�����"�1����"�"�?�3�����	�183�� �
�C�H�+�,���� �-�3�<�R�O��'�'�,�,�'7�I�K��w�w�~�~�k�*�*��	�	�+�&��I�I�b�g�g�l�l�<�A�;�O�'184�*��-�,��185�186�*��s&�187AE�E�B E�188E	�E�189E'c��^^^�SUUU4SjjnUc	U"S/5$U"SS[U5/5$![a7nS[U5;ae[R5 U"S/5sSnA$SnAff=f)Nc190�>�[5 TRUSTTTRT55sSSS5 $!,(df   g=f)N�.whl)rnr�r�)�cmdrzr#�wheel_directorys ���r$�_build�-_BuildMetaBackend.build_wheel.<locals>._build�s=���+�-��0�0���#�#��(�(��9��.�-�-�s	�$:�191A�bdist_wheel�--dist-info-dirz--dist-info-dir not recognized)r�r�)rvr��_IncompatibleBdistWheelr�)r#r�rzr�r��exs```   r$r�_BuildMetaBackend.build_wheel�sx���	�	��%��=�/�*�*�	+��=�*;�S�AS�=T�U�V�V���	+�/�s�2�w�>��#�(�(�*��=�/�*�*��	+�s�/�192A0�,A+�%A0�+A0c�,�UR/SQSX5$)N)�sdistz	--formats�gztarz.tar.gz)r�)r#�sdist_directoryrzs   r$r�_BuildMetaBackend.build_sdist�s���(�(�+�Y��193�	194r'c��U(dg[[U5RS55n[U5S::deU(a[	US5$S$)Nz*.dist-inforr)r4r�globr�rv)r#r��dist_info_candidatess   r$�_get_dist_info_dir�$_BuildMetaBackend._get_dist_info_dir�sP��!��#�D�);�$<�$A�$A�-�$P�Q���'�(�A�-�-�-�/C�s�'��*�+�M��Mr'c���URU5nU(aSU/O/nS/UQURU5Qn[5 URUSX5sSSS5 $!,(df   g=f)Nr��editable_wheelr�)r�r�rnr�)r#r�rzr�r�r|r�s       r$r� _BuildMetaBackend.build_editable�sh���*�*�+=�>��08�!�8�,�b���N�$�N��)<�)<�_�)M�N��
'�
)��,�,��V�_��*�
)�
)�s�A�195A*c�$�URU5$r )rr�s  r$r�1_BuildMetaBackend.get_requires_for_build_editable�s���0�0��A�Ar'c�$�URX5$r )rr�s   r$r�5_BuildMetaBackend.prepare_metadata_for_build_editable�s���4�4��196�	197r')rzror�r��zsetup.py�rgrvr(r)r )rzror(r�)r�r
r�rvr(rv)r�r
r�rvr(r)r�r
rzror(rv)r/)198r��
Iterable[str]r��str | tuple[str, ...]r�r
rzror�r)NN)r�r
rzror��StrPath | Noner(rv)r�r
rzror(rv)r�rr(z199str | None)r*r+r,r-r�r�rrr�r�rr�rrr�rrrr.r/r'r$r�r�"s����.��>G�� �026�J�.�J�	�J�26�J�.�J�	�J�200
�")�
�36�
�	�
�(�OS�P�")�P�<K�P�	�P�.)+�
"�$�"�0�"�"�	"�201)�"�&�
"�N,0�-1�	+� �+�)�+�+�	+�202203
�+�:LP�204�&�205�9H�206�	�207�N�,0�-1�	
� �
�)�
�+�	
�208209
�
� 26�B�.�B�	�B�OS�210�")�211�<K�212�	�213�214r'r�c�4^�\rSrSrSrSSU4SjjjrSrU=r$)�_BuildMetaLegacyBackendi�a/Compatibility backend for setuptools215 216This is a version of setuptools.build_meta that endeavors217to maintain backwards218compatibility with pre-PEP 517 modes of invocation. It219exists as a temporary220bridge between the old packaging mechanism and the new221packaging mechanism,222and will eventually be removed.223c�">�[[R5n[RR	[RRU55nU[R;a [RR
SU5 [RSnU[RS'[TU]%US9 U[RSS&U[RS'g!U[RSS&U[RS'f=f)Nrrf)224r4r�rMrK�dirnamer��insertr��superr�)r#rg�sys_path�225script_dir�226sys_argv_0�	__class__s     �r$r��!_BuildMetaLegacyBackend.run_setup�s��������>���W�W�_�_�R�W�W�_�_�\�%B�C�227��S�X�X�%��H�H�O�O�A�z�*�228�X�X�a�[�229�"������		%��G��<��8�#�C�H�H�Q�K�$�C�H�H�Q�K��#�C�H�H�Q�K�$�C�H�H�Q�K�s�2
C&�&(Dr/rr)r*r+r,r-r�r�r.�
__classcell__)rs@r$rr�s���	�%�%r'rc�$�\rSrSrSrSrSrSrSrg)r�izAwheel.bdist_wheel is deprecated, please import it from setuptoolsz|230    Ensure that any custom bdist_wheel implementation is a subclass of231    setuptools.command.bdist_wheel.bdist_wheel.232    )i��233�z&https://github.com/pypa/wheel/pull/631r/N)	r*r+r,r-�_SUMMARY�_DETAILS�	_DUE_DATE�_SEE_URLr.r/r'r$r�r�s��R�H��H��I�7�Hr'r�)r\r
rXr)Ar��234__future__rr@rbrKrwr�r�r�rdrk�collections.abcrrr�pathlibr�typingrr	r235rG�r�_pathr
r�_reqsrrr9�distutils.utilr�typing_extensionsr�__all__�
BaseExceptionr�distr1rArIrRr_rhrnrvr4ro�__annotations__rqr�rr��_BACKENDrrrrrrrrrr/r'r$�<module>r's����8#��	�	��
�236����7�7��1�1���%� �2��$��+���%�]�%�237/�:�?�?�/�/�/�,���2��2��	�'�������#�7�3��c�4��9�d�6J�0K�+K�#L�d�#R�S���S��|G�|G�~F238�1�F239�R%%�/�%%�P8�:�8����'�D�D��'�D�D��#+�#L�#L� ��"�"���"�"��"*�"J�"J��&.�&R�&R�#��(�(��%�
&�240r'
codekingpro/portable-devtools · Team Ai