Skip to content
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

Problems when the version numbering format changes #110

Closed
iliana opened this issue Mar 6, 2015 · 7 comments · Fixed by #121
Closed

Problems when the version numbering format changes #110

iliana opened this issue Mar 6, 2015 · 7 comments · Fixed by #121

Comments

@iliana
Copy link

iliana commented Mar 6, 2015

I updated protobuf on release-monitoring.org to the new upstream at GitHub, and anitya seems to be having issues dealing with the fact that version numbers now have a "v" in front of them.

https://release-monitoring.org/project/3715/ -- Something strange occured, we found that this project has released a version "v3.0.0-alpha-2" while we had the latest version at "2.5.0"

@pypingou
Copy link
Member

pypingou commented Mar 6, 2015

That's because upstream changed the way he/she tags the releases.

I am not sure this is something I want to handle, as I am afraid it's going to open a can of worm.

@ralphbean
Copy link
Contributor

Hey, so I recently learned that the python stdlib distutils module has a nice utility for comparing versions:

>>> from distutils.version import LooseVersion
>>> weird_alpha = LooseVersion('v3.0.0-alpha-2')
>>> old_normal = LooseVersion('2.5.0')
>>> weird_alpha > old_normal
True
>>> weird_alpha == old_normal
False
>>> weird_alpha < old_normal
False
>>> weird_alpha >= old_normal
True
>>> weird_alpha <= old_normal
False

@pypingou
Copy link
Member

pypingou commented Mar 6, 2015

oh, nice

@cydrobolt
Copy link
Contributor

oh, interesting

@pypingou
Copy link
Member

hm, this is leading to other problems:

>>> from distutils.version import LooseVersion
>>> v1 = LooseVersion('0.10')
>>> v2 = LooseVersion('v0.1.0')
>>> v1 > v2
False
>>> v2 = LooseVersion('1.1-alpha-7')
>>> v1 = LooseVersion('1.1')
>>> v1 > v2
False
>>> v1 = LooseVersion('1.0.3')
>>> v2 = LooseVersion('dev-master')
>>> v1 > v2
False

So not sure if we should change something here.

@ralphbean
Copy link
Contributor

Yeah. Tricky. :(

@ralphbean
Copy link
Contributor

So, solving this generally might be impossible. People could use whatever format they choose to release their software, and we're not going to be able to predict that 100%.

OTOH, the least we can do is .lstrip('v') on versions to get rid of that leading 'v' that crops up everywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants