1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Centralize warning about always enabled features

This commit is contained in:
Stéphane Bidoul 2023-03-29 08:40:02 +02:00
parent 93e6dd7184
commit 2617ccd8a3
4 changed files with 16 additions and 8 deletions

View file

@ -122,6 +122,15 @@ class Command(CommandContextMixIn):
user_log_file=options.log, 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? # TODO: Try to get these passing down from the command?
# without resorting to os.environ to hold these. # without resorting to os.environ to hold these.
# This also affects isolated builds and it should. # This also affects isolated builds and it should.

View file

@ -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( use_new_feature: Callable[..., Option] = partial(
Option, Option,
"--use-feature", "--use-feature",
@ -1004,8 +1009,8 @@ use_new_feature: Callable[..., Option] = partial(
choices=[ choices=[
"fast-deps", "fast-deps",
"truststore", "truststore",
"no-binary-enable-wheel-cache", # now always on ]
], + ALWAYS_ENABLED_FEATURES,
help="Enable new functionality, that may be backward incompatible.", help="Enable new functionality, that may be backward incompatible.",
) )

View file

@ -343,9 +343,6 @@ class InstallCommand(RequirementCommand):
reqs = self.get_requirements(args, options, finder, session) reqs = self.get_requirements(args, options, finder, session)
check_legacy_setup_py_options(options, reqs) 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) wheel_cache = WheelCache(options.cache_dir)
# Only when installing is it permitted to use PEP 660. # Only when installing is it permitted to use PEP 660.

View file

@ -120,9 +120,6 @@ class WheelCommand(RequirementCommand):
reqs = self.get_requirements(args, options, finder, session) reqs = self.get_requirements(args, options, finder, session)
check_legacy_setup_py_options(options, reqs) 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) wheel_cache = WheelCache(options.cache_dir)
preparer = self.make_requirement_preparer( preparer = self.make_requirement_preparer(