Skip to content

Commit 8f0201f

Browse files
committed
Remove no-binary disabling the cache of locally built wheels
1 parent 28239f9 commit 8f0201f

File tree

5 files changed

+12
-43
lines changed

5 files changed

+12
-43
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
@@ -1004,7 +1004,7 @@ def check_list_path_option(options: Values) -> None:
10041004
choices=[
10051005
"fast-deps",
10061006
"truststore",
1007-
"no-binary-enable-wheel-cache",
1007+
"no-binary-enable-wheel-cache", # now always on
10081008
],
10091009
help="Enable new functionality, that may be backward incompatible.",
10101010
)

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
@@ -106,7 +105,6 @@ def run(self, options: Values, args: List[str]) -> int:
106105
session = self.get_default_session(options)
107106

108107
finder = self._build_package_finder(options, session)
109-
wheel_cache = WheelCache(options.cache_dir, options.format_control)
110108

111109
options.wheel_dir = normalize_path(options.wheel_dir)
112110
ensure_dir(options.wheel_dir)
@@ -123,23 +121,9 @@ def run(self, options: Values, args: List[str]) -> int:
123121
check_legacy_setup_py_options(options, reqs)
124122

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

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

tests/functional/test_install.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1656,7 +1656,7 @@ def test_install_no_binary_uses_local_backend(
16561656
assert os.path.isfile(marker), "Local PEP 517 backend not used"
16571657

16581658

1659-
def test_install_no_binary_disables_cached_wheels(
1659+
def test_install_no_binary_uses_cached_wheels(
16601660
script: PipTestEnvironment, data: TestData
16611661
) -> None:
16621662
# Seed the cache
@@ -1673,7 +1673,7 @@ def test_install_no_binary_disables_cached_wheels(
16731673
)
16741674
assert "Successfully installed upper-2.0" in str(res), str(res)
16751675
# upper is built and not obtained from cache
1676-
assert "Building wheel for upper" in str(res), str(res)
1676+
assert "Building wheel for upper" not in str(res), str(res)
16771677

16781678

16791679
def test_install_editable_with_wrong_egg_name(

0 commit comments

Comments
 (0)