Skip to content

Commit

Permalink
add --unstable-feature=shallow_wheels!
Browse files Browse the repository at this point in the history
  • Loading branch information
cosmicexplorer committed Jun 23, 2020
1 parent 9761388 commit 1891d79
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion news/8448.feature
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Add a set of utilities in ``pip._internal.network.shallow`` for fetching metadata from remote wheel files without downloading the entire file. Link these utilities into the v2 resolver by adding a new ShallowWheelDistribution AbstractDistribution subclass. Expose this behavior via a --shallow-wheels command-line option to ``pip download``. This produces a marked performance improvement.
Add a set of utilities in ``pip._internal.network.shallow`` for fetching metadata from remote wheel files without downloading the entire file. Link these utilities into the v2 resolver by adding a new ShallowWheelDistribution AbstractDistribution subclass. Expose this behavior via a --unstable-feature=shallow_wheels command-line option to ``pip download``. This produces a marked performance improvement.
2 changes: 1 addition & 1 deletion src/pip/_internal/cli/cmdoptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ def check_list_path_option(options):
metavar='feature',
action='append',
default=[],
choices=['resolver'],
choices=['resolver', 'shallow_wheels'],
help=SUPPRESS_HELP, # TODO: Enable this when the resolver actually works.
# help='Enable unstable feature(s) that may be backward incompatible.',
) # type: Callable[..., Option]
Expand Down
2 changes: 1 addition & 1 deletion src/pip/_internal/cli/req_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def make_requirement_preparer(
finder=finder,
require_hashes=options.require_hashes,
use_user_site=use_user_site,
use_shallow_wheels=True,
use_shallow_wheels=('shallow_wheels' in options.unstable_features),
)

@staticmethod
Expand Down
1 change: 1 addition & 0 deletions src/pip/_internal/commands/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ def run(self, options, args):
requirement_set = resolver.resolve(
reqs, check_supported_wheels=not options.target_dir
)
requirement_set.perform_all_final_hydration()

try:
pip_req = requirement_set.get_requirement("pip")
Expand Down
1 change: 1 addition & 0 deletions src/pip/_internal/commands/wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ def run(self, options, args):
requirement_set = resolver.resolve(
reqs, check_supported_wheels=True
)
requirement_set.perform_all_final_hydration()

reqs_to_build = [
r for r in requirement_set.requirements.values()
Expand Down
2 changes: 1 addition & 1 deletion src/pip/_internal/resolution/resolvelib/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from pip._internal.distributions.shallow_wheel import (
DistributionNeedingFinalHydration,
)
from pip._internal.exceptions import DistributionNotFound, InstallationError
from pip._internal.exceptions import InstallationError
from pip._internal.req.req_set import RequirementSet
from pip._internal.resolution.base import BaseResolver
from pip._internal.resolution.resolvelib.provider import PipProvider
Expand Down

0 comments on commit 1891d79

Please sign in to comment.