Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the experimental fast-deps feature #11478

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/pip/_internal/cli/cmdoptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,6 @@ def check_list_path_option(options: Values) -> None:
default=[],
choices=[
"2020-resolver",
"fast-deps",
"truststore",
"no-binary-enable-wheel-cache",
],
Expand Down
19 changes: 0 additions & 19 deletions src/pip/_internal/cli/req_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,24 +287,6 @@ def make_requirement_preparer(
temp_build_dir_path = temp_build_dir.path
assert temp_build_dir_path is not None

resolver_variant = cls.determine_resolver_variant(options)
if resolver_variant == "2020-resolver":
lazy_wheel = "fast-deps" in options.features_enabled
if lazy_wheel:
logger.warning(
"pip is using lazily downloaded wheels using HTTP "
"range requests to obtain dependency information. "
"This experimental feature is enabled through "
"--use-feature=fast-deps and it is not ready for "
"production."
)
else:
lazy_wheel = False
if "fast-deps" in options.features_enabled:
logger.warning(
"fast-deps has no effect when used with the legacy resolver."
)

return RequirementPreparer(
build_dir=temp_build_dir_path,
src_dir=options.src_dir,
Expand All @@ -317,7 +299,6 @@ def make_requirement_preparer(
finder=finder,
require_hashes=options.require_hashes,
use_user_site=use_user_site,
lazy_wheel=lazy_wheel,
verbosity=verbosity,
)

Expand Down
210 changes: 0 additions & 210 deletions src/pip/_internal/network/lazy_wheel.py

This file was deleted.

45 changes: 1 addition & 44 deletions src/pip/_internal/operations/prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
import shutil
from typing import Dict, Iterable, List, Optional

from pip._vendor.packaging.utils import canonicalize_name

from pip._internal.distributions import make_distribution_for_install_requirement
from pip._internal.distributions.installed import InstalledDistribution
from pip._internal.exceptions import (
Expand All @@ -28,12 +26,7 @@
from pip._internal.metadata import BaseDistribution, get_metadata_distribution
from pip._internal.models.direct_url import ArchiveInfo
from pip._internal.models.link import Link
from pip._internal.models.wheel import Wheel
from pip._internal.network.download import BatchDownloader, Downloader
from pip._internal.network.lazy_wheel import (
HTTPRangeRequestUnsupported,
dist_from_wheel_url,
)
from pip._internal.network.session import PipSession
from pip._internal.operations.build.build_tracker import BuildTracker
from pip._internal.req.req_install import InstallRequirement
Expand Down Expand Up @@ -220,7 +213,6 @@ def __init__(
finder: PackageFinder,
require_hashes: bool,
use_user_site: bool,
lazy_wheel: bool,
verbosity: int,
) -> None:
super().__init__()
Expand Down Expand Up @@ -249,9 +241,6 @@ def __init__(
# Should install in user site-packages?
self.use_user_site = use_user_site

# Should wheels be downloaded lazily?
self.use_lazy_wheel = lazy_wheel

# How verbose should underlying tooling be?
self.verbosity = verbosity

Expand Down Expand Up @@ -356,10 +345,7 @@ def _fetch_metadata_only(
"Metadata-only fetching is not used as hash checking is required",
)
return None
# Try PEP 658 metadata first, then fall back to lazy wheel if unavailable.
return self._fetch_metadata_using_link_data_attr(
req
) or self._fetch_metadata_using_lazy_wheel(req.link)
return self._fetch_metadata_using_link_data_attr(req)

def _fetch_metadata_using_link_data_attr(
self,
Expand Down Expand Up @@ -402,35 +388,6 @@ def _fetch_metadata_using_link_data_attr(
)
return metadata_dist

def _fetch_metadata_using_lazy_wheel(
self,
link: Link,
) -> Optional[BaseDistribution]:
"""Fetch metadata using lazy wheel, if possible."""
# --use-feature=fast-deps must be provided.
if not self.use_lazy_wheel:
return None
if link.is_file or not link.is_wheel:
logger.debug(
"Lazy wheel is not used as %r does not point to a remote wheel",
link,
)
return None

wheel = Wheel(link.filename)
name = canonicalize_name(wheel.name)
logger.info(
"Obtaining dependency information from %s %s",
name,
wheel.version,
)
url = link.url.split("#", 1)[0]
try:
return dist_from_wheel_url(name, url, self._session)
except HTTPRangeRequestUnsupported:
logger.debug("%s does not support range requests", url)
return None

def _complete_partial_requirements(
self,
partially_downloaded_reqs: Iterable[InstallRequirement],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "1.0"
Loading