Skip to content

Commit

Permalink
Use parse_version as the name for packaging.version.parse
Browse files Browse the repository at this point in the history
  • Loading branch information
pradyunsg committed Apr 9, 2023
1 parent 7cb863e commit 0fcd11f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/pip/_internal/utils/deprecation.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import warnings
from typing import Any, Optional, TextIO, Type, Union

from pip._vendor.packaging.version import parse
from pip._vendor.packaging.version import parse as parse_version

from pip import __version__ as current_version # NOTE: tests patch this name.

Expand Down Expand Up @@ -81,7 +81,10 @@ def deprecated(
"""

# Determine whether or not the feature is already gone in this version.
is_gone = gone_in is not None and parse(current_version) >= parse(gone_in)
if gone_in is None:
is_gone = False
else:
is_gone = parse_version(current_version) >= parse_version(gone_in)

message_parts = [
(reason, f"{DEPRECATION_MSG_PREFIX}{{}}"),
Expand Down

0 comments on commit 0fcd11f

Please sign in to comment.