Skip to content

Commit

Permalink
Clean up resolver internal APIs. (pex-tool#1420)
Browse files Browse the repository at this point in the history
Kill ~unused resolve and rename resolve_multi to resolve.
Eliminate ResolvedDistribution alias in favor of InstalledDistribution
which better reflects the shap of the distribution (not a wheel, but an
installed wheel). Fix test-use fallout.

Work towards pex-tool#1401.
Closes pex-tool#969
  • Loading branch information
jsirois authored Aug 23, 2021
1 parent 9050de5 commit 65f7c5e
Show file tree
Hide file tree
Showing 7 changed files with 233 additions and 357 deletions.
4 changes: 2 additions & 2 deletions pex/bin/pex.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from pex.pex_builder import CopyMode, PEXBuilder
from pex.pip import ResolverVersion
from pex.platforms import Platform
from pex.resolver import Unsatisfiable, parsed_platform, resolve_from_pex, resolve_multi
from pex.resolver import Unsatisfiable, parsed_platform, resolve, resolve_from_pex
from pex.tracer import TRACER
from pex.typing import TYPE_CHECKING
from pex.variables import ENV, Variables
Expand Down Expand Up @@ -1024,7 +1024,7 @@ def to_python_interpreter(full_path_or_basename):
)
else:
with TRACER.timed("Resolving requirements."):
resolveds = resolve_multi(
resolveds = resolve(
requirements=reqs,
requirement_files=options.requirement_files,
constraint_files=options.constraint_files,
Expand Down
11 changes: 6 additions & 5 deletions pex/pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from textwrap import dedent

from pex import dist_metadata, third_party
from pex.common import atomic_directory, is_script, safe_mkdtemp
from pex.common import atomic_directory, safe_mkdtemp
from pex.compatibility import urlparse
from pex.dist_metadata import ProjectNameAndVersion
from pex.distribution_target import DistributionTarget
Expand Down Expand Up @@ -51,6 +51,7 @@
Mapping,
Optional,
Protocol,
Sequence,
Tuple,
Union,
)
Expand Down Expand Up @@ -96,8 +97,8 @@ def for_value(cls, value):
class PackageIndexConfiguration(object):
@staticmethod
def _calculate_args(
indexes=None, # type: Optional[List[str]]
find_links=None, # type: Optional[List[str]]
indexes=None, # type: Optional[Sequence[str]]
find_links=None, # type: Optional[Iterable[str]]
network_configuration=None, # type: Optional[NetworkConfiguration]
):
# type: (...) -> Iterator[str]
Expand Down Expand Up @@ -171,8 +172,8 @@ def _calculate_env(
def create(
cls,
resolver_version=None, # type: Optional[ResolverVersion.Value]
indexes=None, # type: Optional[List[str]]
find_links=None, # type: Optional[List[str]]
indexes=None, # type: Optional[Sequence[str]]
find_links=None, # type: Optional[Iterable[str]]
network_configuration=None, # type: Optional[NetworkConfiguration]
):
# type: (...) -> PackageIndexConfiguration
Expand Down
Loading

0 comments on commit 65f7c5e

Please sign in to comment.