PBR

pbr - Python Build Reasonableness in pbr

Bug #1960830 reported by Gaetan Semet
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PBR
New
Undecided
Unassigned

Bug Description

Hi.

Looks like pbr does not evaluate X.dev0 package correctly, it seems to confuse it as being equal to X.

Example: from_pip_string("1.0.0.dev0") == from_pip_string("1.0.0").

According to PEP440, 1.2.dev == 1.2.dev0 but both are < 1.2.

>>> SemanticVersion.from_pip_string("1.2.0")
pbr.version.SemanticVersion(1.2.0)
>>> SemanticVersion.from_pip_string("1.2.0.dev1")
pbr.version.SemanticVersion(1.2.0.dev1)
>>> SemanticVersion.from_pip_string("1.2.0.dev0")
pbr.version.SemanticVersion(1.2.0)
>>> SemanticVersion.from_pip_string("1.2.0.dev")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/az02065/Projects/Alton/nestor_build_info/.venv/lib/python3.7/site-packages/pbr/version.py", line 145, in from_pip_string
    return klass._from_pip_string_unsafe(version_string)
  File "/Users/az02065/Projects/Alton/nestor_build_info/.venv/lib/python3.7/site-packages/pbr/version.py", line 215, in _from_pip_string_unsafe
    dev_count = int(component[3:])
ValueError: invalid literal for int() with base 10: ''

Expected behavior:

>>> SemanticVersion.from_pip_string("1.2.0.dev0")
pbr.version.SemanticVersion(1.2.0.dev0)
>>> SemanticVersion.from_pip_string("1.2.0.dev")
pbr.version.SemanticVersion(1.2.0.dev0)

description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.