Viewing File: /opt/hc_python/lib/python3.12/site-packages/pip/_internal/__pycache__/pyproject.cpython-312.pyc

�

T�*j����ddlmZddlZddlmZddlmZddlmZddl	m
Z
mZmZddl
mZddlmZdd	�Zdd
�Zedgd��Z								dd
�Zy)�)�annotationsN)�
namedtuple)�Any)�InvalidRequirement)�InstallationError�InvalidPyProjectBuildRequires�MissingPyProjectBuildRequires)�tomllib)�get_requirementc�J�t|t�xrtd�|D��S)Nc3�<K�|]}t|t����y�w)N)�
isinstance�str)�.0�items  �F/opt/hc_python/lib/python3.12/site-packages/pip/_internal/pyproject.py�	<genexpr>z"_is_list_of_str.<locals>.<genexpr>s����(O�3�4��D�#�)>�3�s�)r�list�all)�objs r�_is_list_of_strrs���c�4� �O�S�(O�3�(O�%O�O�c�B�tjj|d�S)Nzpyproject.toml)�os�path�join)�unpacked_source_directorys r�make_pyproject_pathrs��
�7�7�<�<�1�3C�D�Dr�BuildSystemDetails)�requires�backend�check�backend_pathc��tjj|�}tjj|�}|s|st|�d���|rKt	|d��5}tj|j��}ddd�jd�}nd}|�dgdd�}d	|vrt|�
��|d	}t|�s
t|d���|D]}		t|	��|jd�}|jdg�}g}
|�d}dg}
t|||
|�S#1swY��xYw#t$r}
t|d
|	����|
�d}
~
wwxYw)a�Load the pyproject.toml file.

    Parameters:
        pyproject_toml - Location of the project's pyproject.toml file
        setup_py - Location of the project's setup.py file
        req_name - The name of the requirement we're processing (for
                   error reporting)

    Returns:
        None if we should use the legacy code path, otherwise a tuple
        (
            requirements from pyproject.toml,
            name of PEP 517 backend,
            requirements we should check are installed after setting
                up the build environment
            directory paths to import the backend from (backend-path),
                relative to the project root.
        )
    zW does not appear to be a Python project: neither 'setup.py' nor 'pyproject.toml' found.zutf-8)�encodingNzbuild-systemzsetuptools>=40.8.0z setuptools.build_meta:__legacy__)r �
build-backendr )�packagezIt is not a list of strings.)r'�reasonz$It contains an invalid requirement: r&zbackend-path)rr�isfiler�openr
�loads�read�getr	rrrrr)�pyproject_toml�setup_py�req_name�
has_pyproject�	has_setup�f�pp_toml�build_systemr �requirement�errorr!r#r"s              r�load_pyproject_tomlr8s|��,�G�G�N�N�>�2�M������x�(�I�����j�=�
>�
�	
�
�
�.�7�
3�q��m�m�A�F�F�H�-�G�4��{�{�>�2������.�.�?�
����%�+�H�=�=��J�'�H��8�$�+��1�
�	
� ��	��K�(� �����/�G��#�#�N�B�7�L��E���5��%�&���h����E�E�y4�
3��H"�	�/� �=�k�_�M���
��	�s$� $D"�D.�"D+�.	E
�7E�E
)rr�return�bool)rrr9r)r.rr/rr0rr9r)�
__future__rr�collectionsr�typingr�"pip._vendor.packaging.requirementsr�pip._internal.exceptionsrrr	�pip._internal.utils.compatr
�pip._internal.utils.packagingrrrrr8�rr�<module>rCst��"�	�"��A���
/�9�P�E� ��J���
\F��\F�#&�\F�25�\F��\Fr
Back to Directory File Manager