Skip to content

Commit

Permalink
Merge pull request #13155 from ichard26/deprecate-python-warning
Browse files Browse the repository at this point in the history
Deprecate Python 2 relic `--no-python-version-warning`
  • Loading branch information
sbidoul authored Jan 12, 2025
2 parents dafc095 + d18fca1 commit 1452429
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions news/13154.removal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Deprecate the ``no-python-version-warning`` flag as it has long done nothing
since Python 2 support was removed in pip 21.0.
9 changes: 9 additions & 0 deletions src/pip/_internal/cli/base_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
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
Expand Down Expand Up @@ -228,4 +229,12 @@ def _main(self, args: List[str]) -> int:
)
options.cache_dir = None

if options.no_python_version_warning:
deprecated(
reason="--no-python-verison-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)

0 comments on commit 1452429

Please sign in to comment.