3
Re @ s d dl mZ d dlZd dlZd dlZd dlmZ d dlmZm Z d dl
mZmZ d dl
mZ d dlmZ erd dlmZmZmZ d d
Zdd Zed
ddddgZdd ZdS ) )absolute_importN)
namedtuple)sixtoml)InvalidRequirementRequirement)InstallationError)MYPY_CHECK_RUNNING)AnyOptionalListc C s t | totdd | D S )Nc s s | ]}t |tjV qd S )N)
isinstancer string_types).0item r /builddir/build/BUILDROOT/alt-python36-pip-20.2.4-5.el9.x86_64/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/pyproject.py s z"_is_list_of_str..)r
listall)objr r r _is_list_of_str s
r c C s2 t jj| d}tjr.t|tjr.|jtj }|S )Nzpyproject.toml)
ospathjoinr PY2r
text_typeencodesysgetfilesystemencoding)unpacked_source_directoryr r r r make_pyproject_path s r! BuildSystemDetailsrequiresbackendcheckbackend_pathc C s t jj|}t jj|}|rLtj|dd}tj|}W dQ R X |jd}nd}|rv| rv| dk rp| rptdd} n>|rd|kr| dk r| rtdj |d d} n| dkr|} | dk st
| sdS |dkrd d
gdd}|dk st
d
} d|kr
t| j |dd|d }
t|
s.t| j |ddxJ|
D ]B}yt| W n. t
k
rr t| j |dj |dY nX q4W |jd}|jdg }
g }|dkrd}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.0wheelz 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)packagereasonz1'build-system.requires' is not a list of strings.z='build-system.requires' contains an invalid requirement: {!r}zbackend-path)r r isfileioopenr loadgetr formatAssertionErrorr r r r" )
use_pep517pyproject_tomlsetup_pyreq_name
has_pyproject has_setupfpp_tomlbuild_systemerror_templater# requirementr$ r&