summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStéphane Bidoul <stephane.bidoul@gmail.com>2023-03-29 08:40:02 +0200
committerStéphane Bidoul <stephane.bidoul@gmail.com>2023-03-29 08:41:09 +0200
commit2617ccd8a3a46fb38bd9794d81cc8b9b6fd07602 (patch)
tree77176c38596354cf74bf07832695c833c38da0f4 /src
parent93e6dd718483f248ff964ac797a4b422498813c2 (diff)
downloadpip-2617ccd8a3a46fb38bd9794d81cc8b9b6fd07602.tar.gz
Centralize warning about always enabled features
Diffstat (limited to 'src')
-rw-r--r--src/pip/_internal/cli/base_command.py9
-rw-r--r--src/pip/_internal/cli/cmdoptions.py9
-rw-r--r--src/pip/_internal/commands/install.py3
-rw-r--r--src/pip/_internal/commands/wheel.py3
4 files changed, 16 insertions, 8 deletions
diff --git a/src/pip/_internal/cli/base_command.py b/src/pip/_internal/cli/base_command.py
index 5bd7e67e6..637fba18c 100644
--- a/src/pip/_internal/cli/base_command.py
+++ b/src/pip/_internal/cli/base_command.py
@@ -122,6 +122,15 @@ class Command(CommandContextMixIn):
user_log_file=options.log,
)
+ always_enabled_features = set(options.features_enabled) & set(
+ cmdoptions.ALWAYS_ENABLED_FEATURES
+ )
+ if always_enabled_features:
+ logger.warning(
+ "The following features are always enabled: %s. ",
+ ", ".join(sorted(always_enabled_features)),
+ )
+
# TODO: Try to get these passing down from the command?
# without resorting to os.environ to hold these.
# This also affects isolated builds and it should.
diff --git a/src/pip/_internal/cli/cmdoptions.py b/src/pip/_internal/cli/cmdoptions.py
index 34b5144b0..7f72332db 100644
--- a/src/pip/_internal/cli/cmdoptions.py
+++ b/src/pip/_internal/cli/cmdoptions.py
@@ -994,6 +994,11 @@ no_python_version_warning: Callable[..., Option] = partial(
)
+# Features that are now always on. A warning is printed if they are used.
+ALWAYS_ENABLED_FEATURES = [
+ "no-binary-enable-wheel-cache", # always on since 23.1
+]
+
use_new_feature: Callable[..., Option] = partial(
Option,
"--use-feature",
@@ -1004,8 +1009,8 @@ use_new_feature: Callable[..., Option] = partial(
choices=[
"fast-deps",
"truststore",
- "no-binary-enable-wheel-cache", # now always on
- ],
+ ]
+ + ALWAYS_ENABLED_FEATURES,
help="Enable new functionality, that may be backward incompatible.",
)
diff --git a/src/pip/_internal/commands/install.py b/src/pip/_internal/commands/install.py
index 7bc17be5a..e9fc7ee3a 100644
--- a/src/pip/_internal/commands/install.py
+++ b/src/pip/_internal/commands/install.py
@@ -343,9 +343,6 @@ class InstallCommand(RequirementCommand):
reqs = self.get_requirements(args, options, finder, session)
check_legacy_setup_py_options(options, reqs)
- if "no-binary-enable-wheel-cache" in options.features_enabled:
- logger.warning("no-binary-enable-wheel-cache is now active by default.")
-
wheel_cache = WheelCache(options.cache_dir)
# Only when installing is it permitted to use PEP 660.
diff --git a/src/pip/_internal/commands/wheel.py b/src/pip/_internal/commands/wheel.py
index d1e619c63..c6a588ff0 100644
--- a/src/pip/_internal/commands/wheel.py
+++ b/src/pip/_internal/commands/wheel.py
@@ -120,9 +120,6 @@ class WheelCommand(RequirementCommand):
reqs = self.get_requirements(args, options, finder, session)
check_legacy_setup_py_options(options, reqs)
- if "no-binary-enable-wheel-cache" in options.features_enabled:
- logger.warning("no-binary-enable-wheel-cache is now active by default.")
-
wheel_cache = WheelCache(options.cache_dir)
preparer = self.make_requirement_preparer(