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

Carat ^ matching is not compatible with NPM prerelease exclusion #61

paulortman opened this Issue Nov 3, 2017 · 2 comments


None yet
3 participants

paulortman commented Nov 3, 2017

The current carat match algorithm matches pre-release versions (-alpha, -beta). NPM only considers those versions which are not pre-releases. Given that the carat match was added explicitly to mirror the NPM extension, it seems like identical behavior is desired.

For example, search for the "babel" package from semver and then use "^5.0.0" as the search term. None of the 5.0.0-betas are selected. Using python-semanticversion, they would match.

To fix this will require adjusting existing tests -- and therefore potentially breaking existing behavior.


This comment has been minimized.

ivankravets commented Nov 29, 2017

Is this the same issue?

import semantic_version

semantic_version.Version("3.0.0-beta.3") in semantic_version.Spec("^2.1.1")
# True , why?

This comment has been minimized.

paulortman commented Dec 9, 2017

@ivankravets This does appear to be the same issue. Using my branch of code, your test returns False.

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