From bcc807fff183879ade3cfa1e57360c486801943f Mon Sep 17 00:00:00 2001 From: Richard Si Date: Thu, 27 Mar 2025 22:19:27 -0400 Subject: [PATCH] Reverse --no-python-version-warning deprecation This flag is way more prevalent than initially thought. Since this flag is already a no-op, it's better to hide it from CLI help. This way, we can avoid unnecessary churn, but avoid/discourage new occurances of the flag. The deprecation has achieved the goal of communicating that this flag is unnecessary today. --- news/13303.removal.rst | 4 ++++ src/pip/_internal/cli/base_command.py | 9 --------- src/pip/_internal/cli/cmdoptions.py | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) create mode 100644 news/13303.removal.rst diff --git a/news/13303.removal.rst b/news/13303.removal.rst new file mode 100644 index 00000000000..a198277a1a1 --- /dev/null +++ b/news/13303.removal.rst @@ -0,0 +1,4 @@ +Hide ``--no-python-version-warning`` from CLI help and documentation +as it's useless since Python 2 support was removed. Despite being +formerly slated for removal, the flag will remain as a no-op to +avoid breakage. diff --git a/src/pip/_internal/cli/base_command.py b/src/pip/_internal/cli/base_command.py index 509f7463ba8..1d71d67e7a4 100644 --- a/src/pip/_internal/cli/base_command.py +++ b/src/pip/_internal/cli/base_command.py @@ -29,7 +29,6 @@ NetworkConnectionError, PreviousBuildDirError, ) -from pip._internal.utils.deprecation import deprecated from pip._internal.utils.filesystem import check_path_owner from pip._internal.utils.logging import BrokenStdoutLoggingError, setup_logging from pip._internal.utils.misc import get_prog, normalize_path @@ -231,12 +230,4 @@ def _main(self, args: List[str]) -> int: ) options.cache_dir = None - if options.no_python_version_warning: - deprecated( - reason="--no-python-version-warning is deprecated.", - replacement="to remove the flag as it's a no-op", - gone_in="25.1", - issue=13154, - ) - return self._run_wrapper(level_number, options, args) diff --git a/src/pip/_internal/cli/cmdoptions.py b/src/pip/_internal/cli/cmdoptions.py index 93969be93b9..89be4a7b45a 100644 --- a/src/pip/_internal/cli/cmdoptions.py +++ b/src/pip/_internal/cli/cmdoptions.py @@ -1039,7 +1039,7 @@ def check_list_path_option(options: Values) -> None: dest="no_python_version_warning", action="store_true", default=False, - help="Silence deprecation warnings for upcoming unsupported Pythons.", + help=SUPPRESS_HELP, # No-op, a hold-over from the Python 2->3 transition. )