Skip to content

NpmSpec doesn't properly handle prerelease versions #86

Description

@nwalters512

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions