Skip to content

Commit 8003353

Browse files
committed
Remove no-binary disabling the cache of locally built wheels
1 parent b0a2841 commit 8003353

File tree

5 files changed

+10
-62
lines changed

5 files changed

+10
-62
lines changed

news/11453.removal.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
``--no-binary`` does not disable the cache of locally built wheels anymore. It only
2+
means "don't download wheels".

src/pip/_internal/cli/cmdoptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@ def check_list_path_option(options: Values) -> None:
10001000
choices=[
10011001
"fast-deps",
10021002
"truststore",
1003-
"no-binary-enable-wheel-cache",
1003+
"no-binary-enable-wheel-cache", # now always on
10041004
],
10051005
help="Enable new functionality, that may be backward incompatible.",
10061006
)

src/pip/_internal/commands/install.py

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@
3030
check_legacy_setup_py_options,
3131
)
3232
from pip._internal.utils.compat import WINDOWS
33-
from pip._internal.utils.deprecation import (
34-
LegacyInstallReasonFailedBdistWheel,
35-
deprecated,
36-
)
33+
from pip._internal.utils.deprecation import LegacyInstallReasonFailedBdistWheel
3734
from pip._internal.utils.filesystem import test_writable_dir
3835
from pip._internal.utils.logging import getLogger
3936
from pip._internal.utils.misc import (
@@ -347,23 +344,9 @@ def run(self, options: Values, args: List[str]) -> int:
347344
check_legacy_setup_py_options(options, reqs)
348345

349346
if "no-binary-enable-wheel-cache" in options.features_enabled:
350-
# TODO: remove format_control from WheelCache when the deprecation cycle
351-
# is over
352-
wheel_cache = WheelCache(options.cache_dir)
353-
else:
354-
if options.format_control.no_binary:
355-
deprecated(
356-
reason=(
357-
"--no-binary currently disables reading from "
358-
"the cache of locally built wheels. In the future "
359-
"--no-binary will not influence the wheel cache."
360-
),
361-
replacement="to use the --no-cache-dir option",
362-
feature_flag="no-binary-enable-wheel-cache",
363-
issue=11453,
364-
gone_in="23.1",
365-
)
366-
wheel_cache = WheelCache(options.cache_dir, options.format_control)
347+
logger.warning("no-binary-enable-wheel-cache is now active by default.")
348+
349+
wheel_cache = WheelCache(options.cache_dir)
367350

368351
# Only when installing is it permitted to use PEP 660.
369352
# In other circumstances (pip wheel, pip download) we generate

src/pip/_internal/commands/wheel.py

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
InstallRequirement,
1515
check_legacy_setup_py_options,
1616
)
17-
from pip._internal.utils.deprecation import deprecated
1817
from pip._internal.utils.misc import ensure_dir, normalize_path
1918
from pip._internal.utils.temp_dir import TempDirectory
2019
from pip._internal.wheel_builder import build, should_build_for_wheel_command
@@ -107,7 +106,6 @@ def run(self, options: Values, args: List[str]) -> int:
107106
session = self.get_default_session(options)
108107

109108
finder = self._build_package_finder(options, session)
110-
wheel_cache = WheelCache(options.cache_dir, options.format_control)
111109

112110
options.wheel_dir = normalize_path(options.wheel_dir)
113111
ensure_dir(options.wheel_dir)
@@ -124,23 +122,9 @@ def run(self, options: Values, args: List[str]) -> int:
124122
check_legacy_setup_py_options(options, reqs)
125123

126124
if "no-binary-enable-wheel-cache" in options.features_enabled:
127-
# TODO: remove format_control from WheelCache when the deprecation cycle
128-
# is over
129-
wheel_cache = WheelCache(options.cache_dir)
130-
else:
131-
if options.format_control.no_binary:
132-
deprecated(
133-
reason=(
134-
"--no-binary currently disables reading from "
135-
"the cache of locally built wheels. In the future "
136-
"--no-binary will not influence the wheel cache."
137-
),
138-
replacement="to use the --no-cache-dir option",
139-
feature_flag="no-binary-enable-wheel-cache",
140-
issue=11453,
141-
gone_in="23.1",
142-
)
143-
wheel_cache = WheelCache(options.cache_dir, options.format_control)
125+
logger.warning("no-binary-enable-wheel-cache is now active by default.")
126+
127+
wheel_cache = WheelCache(options.cache_dir)
144128

145129
preparer = self.make_requirement_preparer(
146130
temp_build_dir=directory,

tests/functional/test_install.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1677,27 +1677,6 @@ def test_install_no_binary_uses_local_backend(
16771677
assert os.path.isfile(marker), "Local PEP 517 backend not used"
16781678

16791679

1680-
@pytest.mark.usefixtures("with_wheel")
1681-
def test_install_no_binary_disables_cached_wheels(
1682-
script: PipTestEnvironment, data: TestData
1683-
) -> None:
1684-
# Seed the cache
1685-
script.pip("install", "--no-index", "-f", data.find_links, "upper")
1686-
script.pip("uninstall", "upper", "-y")
1687-
res = script.pip(
1688-
"install",
1689-
"--no-index",
1690-
"--no-binary=:all:",
1691-
"-f",
1692-
data.find_links,
1693-
"upper",
1694-
expect_stderr=True,
1695-
)
1696-
assert "Successfully installed upper-2.0" in str(res), str(res)
1697-
# upper is built and not obtained from cache
1698-
assert "Building wheel for upper" in str(res), str(res)
1699-
1700-
17011680
def test_install_editable_with_wrong_egg_name(
17021681
script: PipTestEnvironment, resolver_variant: ResolverVariant
17031682
) -> None:

0 commit comments

Comments
 (0)