Skip to content

Commit 2617ccd

Browse files
committed
Centralize warning about always enabled features
1 parent 93e6dd7 commit 2617ccd

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

src/pip/_internal/cli/base_command.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,15 @@ def _main(self, args: List[str]) -> int:
122122
user_log_file=options.log,
123123
)
124124

125+
always_enabled_features = set(options.features_enabled) & set(
126+
cmdoptions.ALWAYS_ENABLED_FEATURES
127+
)
128+
if always_enabled_features:
129+
logger.warning(
130+
"The following features are always enabled: %s. ",
131+
", ".join(sorted(always_enabled_features)),
132+
)
133+
125134
# TODO: Try to get these passing down from the command?
126135
# without resorting to os.environ to hold these.
127136
# This also affects isolated builds and it should.

src/pip/_internal/cli/cmdoptions.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -994,6 +994,11 @@ def check_list_path_option(options: Values) -> None:
994994
)
995995

996996

997+
# Features that are now always on. A warning is printed if they are used.
998+
ALWAYS_ENABLED_FEATURES = [
999+
"no-binary-enable-wheel-cache", # always on since 23.1
1000+
]
1001+
9971002
use_new_feature: Callable[..., Option] = partial(
9981003
Option,
9991004
"--use-feature",
@@ -1004,8 +1009,8 @@ def check_list_path_option(options: Values) -> None:
10041009
choices=[
10051010
"fast-deps",
10061011
"truststore",
1007-
"no-binary-enable-wheel-cache", # now always on
1008-
],
1012+
]
1013+
+ ALWAYS_ENABLED_FEATURES,
10091014
help="Enable new functionality, that may be backward incompatible.",
10101015
)
10111016

src/pip/_internal/commands/install.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,6 @@ def run(self, options: Values, args: List[str]) -> int:
343343
reqs = self.get_requirements(args, options, finder, session)
344344
check_legacy_setup_py_options(options, reqs)
345345

346-
if "no-binary-enable-wheel-cache" in options.features_enabled:
347-
logger.warning("no-binary-enable-wheel-cache is now active by default.")
348-
349346
wheel_cache = WheelCache(options.cache_dir)
350347

351348
# Only when installing is it permitted to use PEP 660.

src/pip/_internal/commands/wheel.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,6 @@ def run(self, options: Values, args: List[str]) -> int:
120120
reqs = self.get_requirements(args, options, finder, session)
121121
check_legacy_setup_py_options(options, reqs)
122122

123-
if "no-binary-enable-wheel-cache" in options.features_enabled:
124-
logger.warning("no-binary-enable-wheel-cache is now active by default.")
125-
126123
wheel_cache = WheelCache(options.cache_dir)
127124

128125
preparer = self.make_requirement_preparer(

0 commit comments

Comments
 (0)