3
”Reè ã @ s® d dl mZ d dlZd dlZd dlZd dlmZ d dlmZm Z d dl
mZmZ d dl
mZ d dlmZ er€d dlmZmZmZ d d
„ Zdd„ Zed
ddddgƒZdd„ ZdS )é )Úabsolute_importN)Ú
namedtuple)ÚsixÚtoml)ÚInvalidRequirementÚRequirement)ÚInstallationError)ÚMYPY_CHECK_RUNNING)ÚAnyÚOptionalÚListc C s t | tƒotdd„ | D ƒƒS )Nc s s | ]}t |tjƒV qd S )N)Ú
isinstancer Ústring_types)Ú.0Úitem© r ú†/builddir/build/BUILDROOT/alt-python36-pip-20.2.4-5.el8.x86_64/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/pyproject.pyú s z"_is_list_of_str..)r
ÚlistÚall)Úobjr r r Ú_is_list_of_str s
r c C s2 t jj| dƒ}tjr.t|tjƒr.|jtj ƒ ƒ}|S )Nzpyproject.toml)
ÚosÚpathÚjoinr ÚPY2r
Ú text_typeÚencodeÚsysÚgetfilesystemencoding)Úunpacked_source_directoryr r r r Úmake_pyproject_path s r! ÚBuildSystemDetailsÚrequiresÚbackendÚcheckÚbackend_pathc C s¸ t jj|ƒ}t jj|ƒ}|rLtj|dd��}tj|ƒ}W dQ R X |jdƒ}nd}|rv| rv| dk rp| rptdƒ‚d} n>|r¨d|kr¨| dk r¢| r¢tdj |d ƒƒ‚d} n| dkr´|} | dk sÀt
‚| sÈdS |dkrÞd d
gddœ}|dk sêt
‚d
} d|k�r
t| j |dd�ƒ‚|d }
t|
ƒ�s.t| j |dd�ƒ‚xJ|
D ]B}yt|ƒ W n. t
k
�rr t| j |dj |ƒd�ƒ‚Y nX �q4W |jdƒ}|jdg ƒ}
g }|dk�rªd}d d
g}t|
|||
ƒS )aB Load the pyproject.toml file.
Parameters:
use_pep517 - Has the user requested PEP 517 processing? None
means the user hasn't explicitly specified.
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.
)
zutf-8)ÚencodingNzbuild-systemzIDisabling PEP 517 processing is invalid: project does not have a setup.pyTz
build-backendzbDisabling PEP 517 processing is invalid: project specifies a build backend of {} in pyproject.tomlzsetuptools>=40.8.0Úwheelz setuptools.build_meta:__legacy__)r# z
build-backendzO{package} has a pyproject.toml file that does not comply with PEP 518: {reason}r# z]it has a 'build-system' table but not 'build-system.requires' which is mandatory in the table)ÚpackageÚreasonz1'build-system.requires' is not a list of strings.z='build-system.requires' contains an invalid requirement: {!r}zbackend-path)r r ÚisfileÚioÚopenr ÚloadÚgetr ÚformatÚAssertionErrorr r r r" )Ú
use_pep517Úpyproject_tomlÚsetup_pyÚreq_nameÚ
has_pyprojectÚ has_setupÚfÚpp_tomlÚbuild_systemÚerror_templater# Úrequirementr$ r&