U
ÀÒ.eZ ã @ s„ d dl mZ d dlZd dlZd dlZd dlmZmZ d dlm Z d dl
mZ erhd dlm
Z
mZmZmZ dd„ Zd d
„ Zdd„ ZdS )
é )Úabsolute_importN)ÚpytomlÚsix)ÚInstallationError)ÚMYPY_CHECK_RUNNING)ÚAnyÚTupleÚOptionalÚListc C s t | tƒotdd„ | D ƒƒS )Nc s s | ]}t |tjƒV qd S )N)Ú
isinstancer Zstring_types)Ú.0Úitem© r ú;/usr/lib/python3.8/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 j | d¡}tjr.t|tjƒr.| t ¡ ¡}|S )Nzpyproject.toml)
ÚosÚpathÚjoinr ZPY2r Z text_typeÚencodeÚsysÚgetfilesystemencoding)Zunpacked_source_directoryr r r r Úmake_pyproject_path s r c
C sV t j |¡}t j |¡}|rLtj|dd��}t |¡}W 5 Q R X | d¡}nd}|rr|sr| dk rl| sltdƒ‚d} n<|r¢d|kr¢| dk rœ| sœtd |d ¡ƒ‚d} n| dkr®|} | dk sºt
‚| sÂdS |dkrØd d
gddœ}|dk sät
‚d
} d|k�rt| j |dd�ƒ‚|d }
t|
ƒ�s(t| j |dd�ƒ‚| d¡}g }|dk�rLd}d d
g}|
||fS )aÍ 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
)
zutf-8)Úencodingzbuild-systemNzIDisabling PEP 517 processing is invalid: project does not have a setup.pyTú
build-backendzbDisabling PEP 517 processing is invalid: project specifies a build backend of {} in pyproject.tomlzsetuptools>=40.8.0Zwheelz setuptools.build_meta:__legacy__)Úrequiresr zO{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.)r r ÚisfileÚioÚopenr ÚloadÚgetr ÚformatÚAssertionErrorr )
Z
use_pep517Zpyproject_tomlZsetup_pyZreq_nameZ
has_pyprojectZ has_setupÚfZpp_tomlZbuild_systemZerror_templater ZbackendZcheckr r r Úload_pyproject_toml# sf ÿýÿ
þ ÿ
ÿÿ
þ
r) )Z
__future__r r" r r Zpip._vendorr r Zpip._internal.exceptionsr Zpip._internal.utils.typingr Útypingr r r r
r r r) r r r r Ú s