Skip to content

Commit 258f95e

Browse files
authored
Reverse --no-python-version-warning deprecation (#13308)
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 occurrences of the flag. The deprecation has already achieved the goal of communicating that this flag is unnecessary today.
1 parent 84a052e commit 258f95e

File tree

3 files changed

+5
-10
lines changed

3 files changed

+5
-10
lines changed

news/13303.removal.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Hide ``--no-python-version-warning`` from CLI help and documentation
2+
as it's useless since Python 2 support was removed. Despite being
3+
formerly slated for removal, the flag will remain as a no-op to
4+
avoid breakage.

src/pip/_internal/cli/base_command.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
NetworkConnectionError,
3030
PreviousBuildDirError,
3131
)
32-
from pip._internal.utils.deprecation import deprecated
3332
from pip._internal.utils.filesystem import check_path_owner
3433
from pip._internal.utils.logging import BrokenStdoutLoggingError, setup_logging
3534
from pip._internal.utils.misc import get_prog, normalize_path
@@ -231,12 +230,4 @@ def _main(self, args: List[str]) -> int:
231230
)
232231
options.cache_dir = None
233232

234-
if options.no_python_version_warning:
235-
deprecated(
236-
reason="--no-python-version-warning is deprecated.",
237-
replacement="to remove the flag as it's a no-op",
238-
gone_in="25.1",
239-
issue=13154,
240-
)
241-
242233
return self._run_wrapper(level_number, options, args)

src/pip/_internal/cli/cmdoptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,7 @@ def check_list_path_option(options: Values) -> None:
10391039
dest="no_python_version_warning",
10401040
action="store_true",
10411041
default=False,
1042-
help="Silence deprecation warnings for upcoming unsupported Pythons.",
1042+
help=SUPPRESS_HELP, # No-op, a hold-over from the Python 2->3 transition.
10431043
)
10441044

10451045

0 commit comments

Comments
 (0)