Team Ai
Datasetpublic

codekingpro/portable-devtools

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

2��j18����SSKJr SS\RS3\RS3\RS3SSS	S3SS/rSS
KrSS
KrSS
KrSS
KrSS
K	r	SS
K4r5SS
KrSSKJ
r
 SS
KrSSKJrJr SSKJr SSKJrJrJrJr SSKJrJr Sr\(a3SSKJrJrJ r  \	RBS:aSSK"J#r# OSSKJ#r# SSK$J%r%J&r&J'r'J(r( SS/S.r)S$Sjr*S%Sjr+S&Sjr,S'Sjr-S(S jr.S)S!jr/"S"S#5r0g
)*�)�annotations�6contextlib�difflibz._compatz._exceptionsz._util�os�pyproject_hooks�7subprocess�sys�warnings�zipfileN)�Any�)�_ctx�env)�tomllib)�BuildBackendException�BuildException�BuildSystemTableValidationError�TypoWarning)�check_dependency�parse_wheel_filenameF)�Iterator�Mapping�Sequence)��)�Self)�ConfigSettings�Distribution�StrPath�SubprocessRunnerz setuptools.build_meta:__legacy__zsetuptools >= 40.8.0)�
build-backend�requiresc��UHOn[R"SX5R5S:�dM.[R"SUSUS3[8SS9 MQ g)Ng�������?zFound 'z#' in pyproject.toml, did you mean 'z'?�)�9stacklevel)r�SequenceMatcher�ratior10�warnr)�11dictionary�expected�objs   �TD:\code\apps\devtools\python\user_packages\Python313\site-packages\build/_builder.py�12_find_typor->sO�����"�"�4��7�=�=�?�3�F��M�M��#��A�(��2�N���
��c��[RRU5(dSUS3n[U5e[RR	US5n[RR	US5n[RRU5(d6[RRU5(dSUS3n[U5egg)NzSource z is not a directory�pyproject.tomlzsetup.pyzF does not appear to be a Python project: no pyproject.toml or setup.py)r�path�isdirr�join�exists)�13source_dir�msg�pyproject_toml�setup_pys    r,�_validate_source_directoryr9Hs���
�7�7�=�=��$�$��14�|�#6�7���S�!�!��W�W�\�\�*�.>�?�N��w�w�|�|�J�15�3�H�
�7�7�>�>�.�)�)�"�'�'�.�.��2J�2J��16�|�#i�j���S�!�!�3K�)r.c��[US5n[R"UR5R	55sSSS5 $!,(df   g=f![17a 0s$[a-nURSURS3n[U5SeSnAf[RanSUSUS3n[U5SeSnAff=f)N�rbz: 'z' zFailed to parse z: � )�openr�loads�read�decode�FileNotFoundError�PermissionError�strerror�filenamer�TOMLDecodeError)r1�f�er6s    r,�_read_pyproject_tomlrHSs���18,�
�$��
���=�=�������!2�3��
�
�����	��,�����C��19�20�|�2�.���S�!�t�+���"�"�,� ���b���1�-���S�!�t�+��,�sF�A�2A21�	A�22 23A�A�A�C�)	C�2(B�C�1C�Cc�24�SU;a[US5 [$[US5nSU;a[US5 Sn[U5e[	US[255(a[
SUS55(d
Sn[U5eU=aS:�aS=bu[S`=bu   O?   aS:�aS=bu   S	n[U5e   [US5 [SUS'U=a9S:�a3S=b,u=[26S`=bun  [
S27U55(a O'    aS:�aS=bu   Sn[U5e   UR51Sk-28nU(aS
SRU53n[U5eU$)Nzbuild-systemr"z!`requires` is a required propertyc3�B# �UHn[U[5v� M g7f�N��29isinstance�str��.0�is  r,�	<genexpr>�,_parse_build_system_table.<locals>.<genexpr>os���G�$B�q�30�1�c���$B���z&`requires` must be an array of stringsr
r!�z `build-backend` must be a stringc3�B# �UHn[U[5v� M g7frKrLrOs  r,rRrS�s���<f�Ye�TU�Z��3�=O�=O�Ye�rTz*`backend-path` must be an array of strings>r"�backend-pathr!zUnknown properties: z, )r!)rW)31r-�_DEFAULT_BACKEND�dictrrM�list�allrN�keysr3)r7�build_system_tabler6�backend_path�
unknown_propss     r,�_parse_build_system_tabler`as����^�+��>�>�2����n�^�<�=���+�+��%�z�2�1��-�c�2�2��(��4�d�;�;�3�G�$6�z�$B�G�D�D�7��-�c�2�2�32�
%�
%�
%�s�u�
%��&�
!�
!�q�
!�4�C�1�#�6�6�"���)�?�;�3C�?�2S���/�33�
5�
5�
5�4�d�f�
5��<f�Ye�<f�9f�9f�
5��6�
 �
 �a�
 �>�C�1�#�6�6�!�'�+�+�-�0]�]�M��$�T�Y�Y�}�%=�$>�?��-�c�2�2��r.c���UHXn[RRX5n[RRU5(aMHSU<S3n[	U5e g)Nz`backend-path` entry z% does not exist or is not a directory)rr1r3r2r)r5�
backend_pathsr1�resolvedr6s     r,�_validate_backend_pathrd�sK�����7�7�<�<�34�1���w�w�}�}�X�&�&�)�$��1V�W�C�1�#�6�6�	r.c�0^^�SSUU4SjjjnU$)Nc�b>�T"X0TR"5=(d 0EU=(d 0E5 grK)�make_extra_environ)�cmd�cwd�
extra_environr�runners   ��r,�_invoke_wrapped_runner�7_wrap_subprocess_runner.<locals>._invoke_wrapped_runner�s.���	�s�V�S�3�3�5�;��V��AT�RT�V�Wr.�NN)rh�
Sequence[str]ri�35str | NonerjzMapping[str, str] | None�return�NonerU)rkrrls`` r,�_wrap_subprocess_runnerrs�s>���^b�X�
�X�!+�X�C[�X�	
�X�X�36"�!r.c��\rSrSrSr\R\R4SSjjr	\37\R4SSjj5r\SSj5r
\SSj5r\SSj5rSSS	jjrSSS38jjrSSSjjrSSSjjrSS
jrSSSjjr\R.SSj5rSrg)�ProjectBuilder�z39The PEP 517 consumer API.40c�@�[RRU5Ul[	U5 X lX0l[RRUS5n[[U55Ul41URSUlURRS5=n(a[URU5 [R"URURURRS5UR42URS9Ulg)a�43:param source_dir: The source directory44:param python_executable: The python executable where the backend lives45:param runner: Runner for backend subprocesses46 47The ``runner``, if provided, must accept the following arguments:48 49- ``cmd``: a list of strings representing the command and arguments to50  execute, as would be passed to e.g. 'subprocess.check_call'.51- ``cwd``: a string representing the working directory that must be52  used for the subprocess. Corresponds to the provided source_dir.53- ``extra_environ``: a dict mapping environment variable names to values54  which must be set for the subprocess execution.55 56The default runner simply calls the backend hooks in a subprocess, writing backend output57to stdout/stderr.58r0r!rW)r^�python_executablerkN)rr1�abspath�_source_dirr9�_python_executable�_runnerr3r`rH�
_build_system�_backend�getrdr�BuildBackendHookCaller�_hook)�selfr5rxrk�pyproject_toml_pathrbs      r,�__init__�ProjectBuilder.__init__�s���.!#�����59� ;���"�:�.�"3���� �g�g�l�l�:�7G�H��6�7K�L_�7`�a����*�*�?�;��
� �.�.�2�2�>�B�B�=�B�"�4�#3�#3�]�C�$�;�;�����M�M��+�+�/�/��?�"�5�5��<�<�60��61r.c�8�U"UUR[X15S9$)N)r5rxrk)rxrs)�clsrr5rks    r,�from_isolated_env� ProjectBuilder.from_isolated_env�s%���!�!�3�3�*�6�7�62�	63r.c��UR$)zProject source directory.)rz�r�s r,r5�ProjectBuilder.source_dir�s�����r.c��UR$)z364The Python executable used to invoke the backend.65)r{r�s r,rx� ProjectBuilder.python_executable�s��66�&�&�&r.c�2�[URS5$)z�67The dependencies defined in the ``pyproject.toml``'s68``build-system.requires`` field or the default build dependencies69if ``pyproject.toml`` is missing or ``build-system`` is undefined.70r")�setr}r�s r,�build_system_requires�$ProjectBuilder.build_system_requires�s���4�%�%�j�1�2�2r.Nc���[R"SUS3SS9 SU3n[URU5nUR	U5 [U"U55sSSS5 $!,(df   g=f)a71Return the dependencies defined by the backend in addition to72:attr:`build_system_requires` for a given distribution.73 74:param distribution: Distribution to get the dependencies of75    (``sdist`` or ``wheel``)76:param config_settings: Config settings for the build backend77zGetting build dependencies for �...��step��kind�get_requires_for_build_N)r�log�getattrr��_handle_backendr�)r��distribution�config_settings�	hook_name�get_requiress     r,�get_requires_for_build�%ProjectBuilder.get_requires_for_build�s_��	
���2�<�.��D�9�U�-�l�^�<�	��t�z�z�9�5��
�
!�
!�)�
,��|�O�4�5�-�
,�
,�s�A!�!78A/c��URX5RUR5nUVVs1sHn[U5HoUiM M snn$s snnf)aa79Return the dependencies which are not satisfied from the combined set of80:attr:`build_system_requires` and :meth:`get_requires_for_build` for a given81distribution.82 83:param distribution: Distribution to check (``sdist`` or ``wheel``)84:param config_settings: Config settings for the build backend85:returns: Set of variable-length unmet dependency tuples86)r��unionr�r)r�r�r��dependencies�d�us      r,�check_dependencies�!ProjectBuilder.check_dependencies	sM���2�2�<�Q�W�W�X\�Xr�Xr�s��'�E�<�a�1A�!�1D�A��1D��<�E�E��Es�Ac���[R"SUS3SS9 URSU3UUSS9$![a4n[	UR87[R5(aSnAgeSnAff=f)	a"88Prepare metadata for a distribution.89 90:param distribution: Distribution to build (must be ``wheel``)91:param output_directory: Directory to put the prepared metadata in92:param config_settings: Config settings for the build backend93:returns: The full path to the prepared metadata directory94zGetting metadata for r�r�r��prepare_metadata_for_build_F)�_allow_fallbackN)rr��
_call_backendrrM�	exceptionr�HookMissing)r�r��output_directoryr�r�s     r,�prepare�ProjectBuilder.prepares}��	
���(���c�:��K�95	��%�%�-�l�^�<� �� %�	&��
��%�	��)�-�-��/J�/J�K�K����	�s�0�96A.�)A)�(A)�)A.c�t�[R"SUS3SS9 Uc0OSU0nUR"SU3X#40UD6$)a�97Build a distribution.98 99:param distribution: Distribution to build (``sdist`` or ``wheel``)100:param output_directory: Directory to put the built distribution in101:param config_settings: Config settings for the build backend102:param metadata_directory: If provided, should be the return value of a103    previous ``prepare`` call on the same ``distribution`` kind104:returns: The full path to the built distribution105z	Building r�r�r��metadata_directory�build_)rr�r�)r�r�r�r�r��kwargss      r,�build�ProjectBuilder.build5sO��"	
���9�\�N�#�.�Y�?�)�1��8L�N`�7a���!�!�F�<�.�"9�;K�g�`f�g�gr.c��^�URSU5nUbU$URSU5n[[RRU55nU(d
Sn[
U5eUSSUSS3nUS3m[R"U5nURUU4S	jUR555 SSS5 [RRX5$!,(df   N-=f)106aO107Generate the metadata directory of a distribution and return its path.108 109If the backend does not support the ``prepare_metadata_for_build_wheel``110hook, a wheel will be built and the metadata will be extracted from it.111 112:param output_directory: Directory to put the metadata distribution in113:returns: The path of the metadata directory114�wheelNz
Invalid wheelr��-�versionz115.dist-info�/c3�V># �UHoRT5(dMUv� M  g7frK)�116startswith)rP�member�
member_prefixs  �r,rR�/ProjectBuilder.metadata_path.<locals>.<genexpr>es����W�l�F�6G�6G�
�6V���l�s�)�	))r�r�rrr1�basename�117ValueErrorr�ZipFile�118extractall�namelistr3)	r�r��metadatar��matchr6�distinfo�wr�s	        @r,�
metadata_path�ProjectBuilder.metadata_pathKs�����<�<��)9�:�����O��119�120�7�$4�5��$�R�W�W�%5�%5�e�%<�=���!�C��S�/�!��N�+�,�A�e�I�.>�-?�z�J��#�*�A��
�
�_�_�U�
#�q�
�L�L� �W�a�j�j�l�W�
�$�121�w�w�|�|�,�7�7�$�
#�s�+C"�"122C0c���[RRU5n[URU5n[RRU5(a6[RR
U5(dSUS3n[U5eO[R"USS9 URU5 U"X#40UD6nSSS5 [RRUW5$!,(df   N.=f)NzBuild path 'z' exists and is not a directoryT)�exist_ok)rr1ryr�r�r4r2r�makedirsr�r3)r�r��outdirr�r��callbackr6r�s        r,r��ProjectBuilder._call_backendis���������(���4�:�:�y�1��
�7�7�>�>�&�!�!��7�7�=�=��(�(�$�V�H�,K�L��$�S�)�)�)�
�K�K���.�
�
!�
!�)�
,�$�V�G��G�H�-��w�w�|�|�F�H�-�-�-�
,�s�6123C(�(124C6c#�P# �Sv� g![Ra4n[USURS3[R125"55SeSnAf[Ran[USU35SeSnAf[a#n[U[R126"5S9SeSnAff=f7f)Nz	Backend 'z' is not available.z0Backend subprocess exited when trying to invoke )�exc_info)	r�BackendUnavailablerr~r	r�r�CalledProcessError�	Exception)r��hookr�s   r,r��ProjectBuilder._handle_backend|s����	V����1�1�	�'���D�M�M�?�*=�>�������	
��127�,�,�	x�'�	�5e�fj�ek�3l�m�sw�w���	V�'�	�C�L�L�N�K�QU�U��	V�s<�B&�	�B&�B#�/A�B#�#A3�3
B#�B�B#�#B&)r~r}r�r{r|rz)r5rrxrNrkr rqrr)r�env.IsolatedEnvr5rrkr rqr)rqrN)rq�set[str]rK)r�rr��ConfigSettings | Nonerqr�)r�rr�r�rqzset[tuple[str, ...]])r�rr�rr�r�rqrprn)128r�rr�rr�r�r�rprqrN)r�rrqrN)129r�rNr�rr�r�r�rrqrN)r�rNrqzIterator[None])�__name__�130__module__�__qualname__�__firstlineno__�__doc__r	�131executabler�default_subprocess_runnerr��classmethodr��propertyr5rxr�r�r�r�r�r�r�r�contextmanagerr��__static_attributes__rUr.r,ruru�s����"%���#2�#L�#L�	+132��+133��+134�!�	+135�136137�+138�Z�139$3�#L�#L�	140141�
�142143��144145�!�	146147�148149�150151��152153�� �� ��'��'��3��3�26�6�"�6�/�6�154�	6�.26�F�"�F�/�F�155�	F�*26�	�"��"��/�	�156157��>26�)-�h�"�h�"�h�/�	h�158'�h�159
�
h�,8�>Y]�.��.�&-�.�@U�.�hk�.�	�.�&���V��Vr.ru)r)zMapping[str, str]r*rNrqrr)r5rrqrr)r1rrq�Mapping[str, Any])r7r�rqr�)r5rNrbrorqrr)rkr rr�rqr )1�160__future__r�__spec__�parent�__lazy_modules__rrrrr	r161r�typingrr�rr�_compatr�_exceptionsrrrr�_utilrr�
TYPE_CHECKING�collections.abcrrr�version_info�typing_extensionsr�_typesrrrr rXr-r9rHr`rdrsrurUr.r,�<module>r�s���#��
�����x� �����|�$�����v�����	��
�����	��162���������:��
��;�;�163���'�!�*��O�O�8�'�(����"�,�,�^7�"�hV�hVr.
codekingpro/portable-devtools · Team Ai