def build_project_metadata(
src_file: pathlib.Path,
build_targets: tuple[str, ...],
*,
isolated: bool,
quiet: bool,
) -> ProjectMetadata: """ Return the metadata for a project.
Uses the ``prepare_metadata_for_build_wheel`` hook for the wheel metadata if available, otherwise ``build_wheel``.
Uses the ``prepare_metadata_for_build_{target}`` hook for each ``build_targets`` if available.
:param src_file: Project source file
:param build_targets: A tuple of build targets to get the dependencies
of (``sdist`` or ``wheel`` or ``editable``).
:param isolated: Whether to run invoke the backend in the current
environment or to create an isolated one and invoke it
there.
:param quiet: Whether to suppress the output of subprocesses. """
for req in metadata.get_all("Requires-Dist") or []:
parts = parse_req_from_line(req, comes_from) if parts.requirement.name == package_name: # Replace package name with package directory in the requirement # string so that pip can find the package as self-referential. # Note the string can contain extras, so we need to replace only # the package name, not the whole string.
replaced_package_name = req.replace(package_name, str(package_dir), 1)
parts = parse_req_from_line(replaced_package_name, comes_from)
# Build requirements will only be present if a pyproject.toml file exists, # but if there is also a setup.py file then only that will be explicitly # processed due to the order of `DEFAULT_REQUIREMENTS_FILES`.
src_file = src_file.parent / PYPROJECT_TOML
for req in builder.build_system_requires:
result[req].add(f"{package_name} ({src_file}::build-system.requires)") for build_target in build_targets: for req in builder.get_requires_for_build(build_target):
result[req].add(
f"{package_name} ({src_file}::build-system.backend::{build_target})"
)
for req, comes_from_sources in result.items(): for comes_from in comes_from_sources: yield install_req_from_line(req, comes_from=comes_from)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.