Skip to content

Commit d18fca1

Browse files
committed
Deprecate Python 2 relic --no-python-version-warning
1 parent 39be130 commit d18fca1

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

news/13154.removal.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Deprecate the ``no-python-version-warning`` flag as it has long done nothing
2+
since Python 2 support was removed in pip 21.0.

src/pip/_internal/cli/base_command.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
NetworkConnectionError,
3030
PreviousBuildDirError,
3131
)
32+
from pip._internal.utils.deprecation import deprecated
3233
from pip._internal.utils.filesystem import check_path_owner
3334
from pip._internal.utils.logging import BrokenStdoutLoggingError, setup_logging
3435
from pip._internal.utils.misc import get_prog, normalize_path
@@ -228,4 +229,12 @@ def _main(self, args: List[str]) -> int:
228229
)
229230
options.cache_dir = None
230231

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

0 commit comments

Comments
 (0)