MCPcopy
hub / github.com/pex-tool/pex / resolve

Function resolve

pex/resolver.py:1546–1722  ·  view source on GitHub ↗

Resolves all distributions needed to meet requirements for multiple distribution targets. The resulting distributions are installed in individual chroots that can be independently added to `sys.path` :keyword targets: The distribution target environments to resolve for. :keyword re

(
    targets=Targets(),  # type: Targets
    requirements=None,  # type: Optional[Iterable[ParsedRequirement]]
    requirement_files=None,  # type: Optional[Iterable[str]]
    constraint_files=None,  # type: Optional[Iterable[str]]
    allow_prereleases=False,  # type: bool
    transitive=True,  # type: bool
    repos_configuration=ReposConfiguration(),  # type: ReposConfiguration
    resolver_version=None,  # type: Optional[ResolverVersion.Value]
    network_configuration=None,  # type: Optional[NetworkConfiguration]
    build_configuration=BuildConfiguration(),  # type: BuildConfiguration
    compile=False,  # type: bool
    max_parallel_jobs=None,  # type: Optional[int]
    ignore_errors=False,  # type: bool
    verify_wheels=True,  # type: bool
    pip_log=None,  # type: Optional[PipLog]
    pip_version=None,  # type: Optional[PipVersionValue]
    resolver=None,  # type: Optional[Resolver]
    use_pip_config=False,  # type: bool
    extra_pip_requirements=(),  # type: Tuple[Requirement, ...]
    keyring_provider=None,  # type: Optional[str]
    uploaded_prior_to=None,  # type: Optional[str]
    result_type=InstallableType.INSTALLED_WHEEL_CHROOT,  # type: InstallableType.Value
    dependency_configuration=DependencyConfiguration(),  # type: DependencyConfiguration
)

Source from the content-addressed store, hash-verified

1544
1545
1546def resolve(
1547 targets=Targets(), # type: Targets
1548 requirements=None, # type: Optional[Iterable[ParsedRequirement]]
1549 requirement_files=None, # type: Optional[Iterable[str]]
1550 constraint_files=None, # type: Optional[Iterable[str]]
1551 allow_prereleases=False, # type: bool
1552 transitive=True, # type: bool
1553 repos_configuration=ReposConfiguration(), # type: ReposConfiguration
1554 resolver_version=None, # type: Optional[ResolverVersion.Value]
1555 network_configuration=None, # type: Optional[NetworkConfiguration]
1556 build_configuration=BuildConfiguration(), # type: BuildConfiguration
1557 compile=False, # type: bool
1558 max_parallel_jobs=None, # type: Optional[int]
1559 ignore_errors=False, # type: bool
1560 verify_wheels=True, # type: bool
1561 pip_log=None, # type: Optional[PipLog]
1562 pip_version=None, # type: Optional[PipVersionValue]
1563 resolver=None, # type: Optional[Resolver]
1564 use_pip_config=False, # type: bool
1565 extra_pip_requirements=(), # type: Tuple[Requirement, ...]
1566 keyring_provider=None, # type: Optional[str]
1567 uploaded_prior_to=None, # type: Optional[str]
1568 result_type=InstallableType.INSTALLED_WHEEL_CHROOT, # type: InstallableType.Value
1569 dependency_configuration=DependencyConfiguration(), # type: DependencyConfiguration
1570):
1571 # type: (...) -> ResolveResult
1572 """Resolves all distributions needed to meet requirements for multiple distribution targets.
1573
1574 The resulting distributions are installed in individual chroots that can be independently added
1575 to `sys.path`
1576
1577 :keyword targets: The distribution target environments to resolve for.
1578 :keyword requirements: A sequence of requirement strings.
1579 :keyword requirement_files: A sequence of requirement file paths.
1580 :keyword constraint_files: A sequence of constraint file paths.
1581 :keyword allow_prereleases: Whether to include pre-release and development versions when
1582 resolving requirements. Defaults to ``False``, but any requirements that explicitly request
1583 pre-release or development versions will override this setting.
1584 :keyword transitive: Whether to resolve transitive dependencies of requirements.
1585 Defaults to ``True``.
1586 :keyword repos_configuration: Configuration for package repositories to resolve packages from.
1587 :keyword resolver_version: The resolver version to use.
1588 :keyword network_configuration: Configuration for network requests made downloading and building
1589 distributions.
1590 :keyword build_configuration: The configuration for building resolved projects.
1591 :keyword compile: Whether to pre-compile resolved distribution python sources.
1592 Defaults to ``False``.
1593 :keyword max_parallel_jobs: The maximum number of parallel jobs to use when resolving,
1594 building and installing distributions in a resolve. Defaults to the number of CPUs available.
1595 :keyword ignore_errors: Whether to ignore resolution solver errors. Defaults to ``False``.
1596 :keyword verify_wheels: Whether to verify wheels have valid metadata. Defaults to ``True``.
1597 :keyword pip_log: Preserve the `pip download` log and print its location to stderr.
1598 Defaults to ``False``.
1599 :returns: The installed distributions meeting all requirements and constraints.
1600 :raises Unsatisfiable: If ``requirements`` is not transitively satisfiable.
1601 :raises Untranslatable: If no compatible distributions could be acquired for
1602 a particular requirement.
1603 :raises ValueError: If a foreign platform was provided in `platforms`, and `use_wheel=False`.

Callers

nothing calls this directly

Calls 15

install_distributionsMethod · 0.95
build_distributionsMethod · 0.95
TargetsClass · 0.90
ReposConfigurationClass · 0.90
BuildConfigurationClass · 0.90
pluralizeFunction · 0.90
ResolveResultClass · 0.90
_parse_reqsFunction · 0.85
DownloadRequestClass · 0.85
DownloadTargetClass · 0.85
_download_internalFunction · 0.85

Tested by

no test coverage detected