� ��^i� ����dZddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z m Z ddl mZmZeje��Zd�Zd �Zd �Zd �Zdd �Zej��Ze�d d���e�dddd���e�dddd���e�ddd���d�Zedkree�����dSdS)z%Build a project using PEP 517 hooks. �N�)�BuildEnvironment)�Pep517HookCaller)�tempdir�mkdir_p)�FileNotFoundError� toml_loadc��ddh}|t|��ks5d�|t|��z ���}t|���dS)z7 Ensure build system has the requisite fields. �requires� build-backendz"Missing required fields: {missing})�missingN)�set�format� ValueError)�system�required�messages ��/builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/pep517/build.py�validate_systemrs_���O�,�H� ��F� � � #� #�6�=�=��S��[�[�(�>� � ����!�!�!� $� #�c���tj�|d��}tj|d��5}t |��}ddd��n #1swxYwY|dS)zC Load the build system from a source dir (pyproject.toml). zpyproject.toml�rbNz build-system)�os�path�join�io�openr )� source_dir� pyproject�f�pyproject_datas r� load_systemr"s����� � �Z�)9�:�:�I� ���D� !� !�&�Q�"�1����&�&�&�&�&�&�&�&�&�&�&����&�&�&�&� �.� )�)s�A�A�Ac�� t|��}n#ttf$ri}YnwxYw|�dd��|�dddg��|S)z� Given a source dir, attempt to get a build system backend and requirements from pyproject.toml. Fallback to setuptools but only if the file was not found or a build system was not indicated. r z setuptools.build_meta:__legacy__r � setuptools�wheel)r"r�KeyError� setdefault)rrs r� compat_systemr('s����Z�(�(���� �x� (������������ ����*���� ���j�<��"9�:�:�:� �Ms ��(�(c ���djdit����}t||��}|i��}t�d|��|�|��t�d��t ��5}t�d||��djdit����}t||��} | |i��} tj� || ��} tj | tj� |tj� | ������ddd��dS#1swxYwYdS)Nzget_requires_for_build_{dist}zGot build requires: %sz$Installed dynamic build dependencieszTrying to build %s in %sz build_{dist}�) r�locals�getattr�log�info� pip_installrrrr�shutil�move�basename) �hooks�env�dist�dest�get_requires_name� get_requires�reqs�td� build_name�build�filename�sources r� _do_buildr?:s���>�7�>�J�J����J�J���5�"3�4�4�L� �<�� � �D��H�H� %�t�,�,�,��O�O�D�����H�H� 3�4�4�4� ���L�b� ���+�T�2�6�6�6�*�^�*�6�6�V�X�X�6�6� ���z�*�*���5��R�=�=������b�(�+�+��� �F�B�G�L�L��r�w�/?�/?��/I�/I�J�J�K�K�K� L�L�L�L�L�L�L�L�L�L�L�L����L�L�L�L�L�Ls� CE�E �#E c��|pt|��}tj�||pd��}t |��t |��t ||d|�d����}t��5}|� |d��t||||��ddd��dS#1swxYwYdS)Nr5r z backend-pathr ) r"rrrrrr�getrr/r?)rr5r6rr3r4s rr<r<Ls�� � .�{�:�.�.�F� �7�<�<� �D�N�F� 3� 3�D� �D�M�M�M��F���� ��F�?�+�V�Z�Z��-G�-G� � �E� � � �*�s� ����z�*�+�+�+��%��d�D�)�)�)�*�*�*�*�*�*�*�*�*�*�*�*����*�*�*�*�*�*s� .C�C � C rz%A directory containing pyproject.toml)�helpz--binaryz-b� store_trueF)�action�defaultz--sourcez-sz --out-dirz-oz>Destination in which to save the builds relative to source dirc���t�d��ttd|js|jsdnd|js|jsdndf����}|D]}t |j||j���dS)NzQpep517.build is deprecated. Consider switching to https://pypi.org/project/build/�sdistr%) r-�warning�list�filterr>�binaryr<r�out_dir)�args�distsr5s r�mainrOps����K�K�H�I�I�I� ����;�;�d�k�;���t��;�;�d�k�;���t���� � �E� �3�3�� �d�o�t�T�\�2�2�2�2�3�3r�__main__)NN)�__doc__�argparser�loggingrr0�envbuildr�wrappersr�dirtoolsrr�compatrr � getLogger�__name__r-rr"r(r?r<�ArgumentParser�parser� add_argumentrO� parse_argsr*rr�r^s��������� � � � ����� � � � � � � � �&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�0�0�0�0�0�0�0�0��g���!�!�� "� "� "�*�*�*����&L�L�L�$ *� *� *� *� !�� � "� "������ 0���������� � ����� ����� � ����� ����� I����� 3� 3� 3� �z����D�� � � � �������r