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

fix version comparisons #46

Merged

Conversation

pipermerriam
Copy link
Contributor

Fixes #45

What was wrong?

The logic implementing the prerelease version comparisons was not quite correct.

How was it fixed?

Modified how pre-release tags are compared to ensure that all of the example test vectors from the semver spec evaluate correctly.

Cute animal picture

baby-kangaroo-white

@pipermerriam
Copy link
Contributor Author

Let me know if there is anything about this implementation you would like changed.

Copy link
Contributor

@k-bx k-bx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@@ -232,7 +246,7 @@ def test_prerelease_order():
assert min_ver('1.2.3-Rc10', '1.2.3-rc10') == '1.2.3-Rc10'
# Numeric identifiers always have lower precedence than non-numeric
# identifiers.
assert min_ver('1.2.3-2', '1.2.3-rc') == '1.2.3-rc'
assert min_ver('1.2.3-2', '1.2.3-rc') == '1.2.3-2'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch!

@k-bx k-bx merged commit 4cac6ff into python-semver:master Jan 16, 2017
@k-bx
Copy link
Contributor

k-bx commented Jan 16, 2017

@pipermerriam released under 2.7.4, thank you!

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 this pull request may close these issues.

Version comparison does not conform to semver spec for prerelease tags.
2 participants