-
-
Notifications
You must be signed in to change notification settings - Fork 132
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
Wildcard VersionReq doesn't match if a Version have pre-release #98
Comments
Yes, this is intended behavior. You only get prerelease versions when explicitly asking for them. This is consistent with other semver implementations, take https://semver.npmjs.com/ and try matching which then confuses me why you say
@isaacs, do you know what's up here? |
Another example from semantic_version python module:
I think |
I haven't had the time to check, but IIRC Bundler also doesn't give you prerelase explicitly.
That depends, it should match any released version, imho, and pre-releases aren't real releases. Anyway, this library will try to be as compatible with the rest of the ecosystem as possible, but if it's not standard across the ecosystem, then we'll do what I think is right 😉 |
Nope, it doesn't, by design.
|
Obviously I can't speak for Python's semantic_version module, though. I'm assuming it works for its purposes. Version range specifiers are much less standardized than versions themselves, but cargo and npm are mostly in sync with one another. |
@isaacs I am wondering why all these examples are returning true:
I only need this kind of behavior from semver crate. semver crate is returning false for all of these. |
@onur Probably you're using a very outdated version of semver.
|
I believe this is a bug in semver crate but according to NPM people, and @steveklabnik; a version like "0.1.0-pre.0" or "0.1.0-beta.0" *is not a real version* and any version that contains a pre-release string is getting different treatment by semver. IMO this is utterly wrong. Docs.rs is probably the first victim of this behavior and it will affect more in future. `*` means any and it should match any version. It doesn't matter if a version have a pre-release string or not. Even older versions of node's semver were matching "*" for any version. I don't know why they changed this behavior but I am not surprised any means "anything except a version that contains pre-release" in JS world. Fixes: #80 Ref: dtolnay/semver#98
@isaacs that figures:
TBH I don't know why this behavior is changed but old one seems more correct to me. Ranges are useless if a crate have a pre-release string. And Anyway I am closing this issue since |
I believe this is a bug in semver crate but according to NPM people, and @steveklabnik; a version like "0.1.0-pre.0" or "0.1.0-beta.0" *is not a real version* and any version that contains a pre-release string is getting different treatment by semver. IMO this is utterly wrong. Docs.rs is probably the first victim of this behavior and it will affect more in future. `*` means any and it should match any version. It doesn't matter if a version have a pre-release string or not. Even older versions of node's semver were matching "*" for any version. I don't know why they changed this behavior but I am not surprised any means "anything except a version that contains pre-release" in JS world. Fixes: rust-lang#80 Ref: dtolnay/semver#98
I believe
*
should match any version and currently it is not matching if a Version have a pre-release. For example:This issue is also affecting cargo. For example symtern only released versions with a pre-release string and using any range syntax in Cargo.toml doesn't work. Including:
*
,0.1
,^0.1
,0.1.0
etc.I tried node's semver and
*
is matching (satisfying) fine with0.1.0-pre.0
.Ref: onur/docs.rs#80
The text was updated successfully, but these errors were encountered: