U 巀gw@sddlZddlZddlZddlmZddlmZmZm Z ej dkrLddl Z n ddl m Z ddlmZddlmZmZmZddlmZeed d d Zeed d dZedddddgZe eeeee edddZdS)N) namedtuple)AnyListOptional) )tomli)InvalidRequirement)InstallationErrorInvalidPyProjectBuildRequiresMissingPyProjectBuildRequires)get_requirement)objreturncCst|totdd|DS)Ncss|]}t|tVqdS)N) isinstancestr).0itemrE/opt/hc_python/lib/python3.8/site-packages/pip/_internal/pyproject.py sz"_is_list_of_str..)rlistall)rrrr_is_list_of_strsr)unpacked_source_directoryrcCstj|dS)Nzpyproject.toml)ospathjoin)rrrrmake_pyproject_pathsrBuildSystemDetailsrequiresbackendcheck backend_path) use_pep517pyproject_tomlsetup_pyreq_namerc Cstj|}tj|}|s.|s.t|d|rdt|dd}t|}W5QRX|d}nd}|r|s|dk r|stdd}nX|rd|kr|dk r|std |dd}n(|dkr|pt j d  pt j d  }|dk st |sdS|dkr d gd d}|dk st d|kr.t|d|d} t| sLt|dd| D]L} z t| Wn8tk r} zt|d| d| W5d} ~ XYnXqP|d} |dg} g}| dkrd } d g}t| | || S)aBLoad 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. ) zW does not appear to be a Python project: neither 'setup.py' nor 'pyproject.toml' found.zutf-8)encodingz build-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.toml setuptoolswheelzsetuptools>=40.8.0z setuptools.build_meta:__legacy__)r r)r )packagezIt is not a list of strings.)r,reasonz$It contains an invalid requirement: z backend-path)rrisfiler opentomllibloadsreadgetformat importlibutil find_specAssertionErrorr rr r r r)r$r%r&r' has_pyproject has_setupfpp_toml build_systemr requirementerrorr!r#r"rrrload_pyproject_toml#s                   r@)importlib.utilr5rsys collectionsrtypingrrr version_infor0 pip._vendorr"pip._vendor.packaging.requirementsr pip._internal.exceptionsr r r pip._internal.utils.packagingr boolrrrrr@rrrrs,