Skip to content

commands: debug: Use packaging.version.parse to compare #9464

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/9461.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
commands: debug: Use packaging.version.parse to compare between versions.
3 changes: 2 additions & 1 deletion src/pip/_internal/commands/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import pip._vendor
from pip._vendor import pkg_resources
from pip._vendor.certifi import where
from pip._vendor.packaging.version import parse as parse_version

from pip import __file__ as pip_location
from pip._internal.cli import cmdoptions
Expand Down Expand Up @@ -100,7 +101,7 @@ def show_actual_vendor_versions(vendor_txt_versions):
extra_message = ' (Unable to locate actual module version, using'\
' vendor.txt specified version)'
actual_version = expected_version
elif actual_version != expected_version:
elif parse_version(actual_version) != parse_version(expected_version):
extra_message = ' (CONFLICT: vendor.txt suggests version should'\
' be {})'.format(expected_version)
logger.info('%s==%s%s', module_name, actual_version, extra_message)
Expand Down