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

NpmSpec doesn't properly handle prerelease versions #86

Closed
nwalters512 opened this issue Nov 20, 2019 · 2 comments
Closed

NpmSpec doesn't properly handle prerelease versions #86

nwalters512 opened this issue Nov 20, 2019 · 2 comments

Comments

@nwalters512
Copy link

Consider the npm version range >0.0.0-alpha <0.0.0-beta. I would expect the version 0.0.0-alpha.0 to match this version range, and evaluating the constraints independently tells me this should be true:

>>> from semantic_version import Version
>>> Version('0.0.0-alpha.0') > Version('0.0.0-alpha')
True
>>> Version('0.0.0-alpha.0') < Version('0.0.0-beta')
True

However, NpmSpec reports that this is not the case:

>>> from semantic_version import Version, NpmSpec
>>> Version('0.0.0-alpha.0') in NpmSpec('>0.0.0-alpha <0.0.0-beta')
False

This appears to be a bug, but it's possible that my understanding of prerelease versions in compound npm version ranges is off.

Thanks for all the work on this library!

@rbarrois
Copy link
Owner

Hi!

Thanks for the bug report, well spotted!

A bugfix release is on its way ;)

@nwalters512
Copy link
Author

Thanks for the quick fix!

bmwiedemann added a commit to bmwiedemann/openSUSE that referenced this issue Mar 26, 2020
https://build.opensuse.org/request/show/787484
by user scarabeus_iv + dimstar_suse
- version update to 2.8.4
  * `#89 <https://github.com/rbarrois/python-semanticversion/issues/89>`_:
    Properly coerce versions with leading zeroes in components (e.g.
    ``1.01.007``)
  - Add `Clause.prettyprint()` for debugging
  * `#86 <https://github.com/rbarrois/python-semanticversion/issues/86>`_:
    Fix handling of prerelease ranges within `NpmSpec`
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

No branches or pull requests

2 participants