-
Notifications
You must be signed in to change notification settings - Fork 106
Replace semantic_version with packaging #157
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
Conversation
Use the "packaging" package instead of semantic_version package to parse Rust version and spec. Packaging is used by setuptools to parse version strings and specs. This also solves a deprecation warning with semamtic_version. The partial argument to Version() has been deprecated. Signed-off-by: Christian Heimes <[email protected]>
Thanks for this. I'm definitely in favour of updating dependencies. Using I wonder if instead we can fix usage of the |
semantic_version is still supported, just the I'll investigate support for pre-releases with packaging and get back to you. |
Packaging's version parser parses Rust's beta versions correctly, e.g.
However it does not understand -nightly suffix:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, we're almost there.
I'm happy for us to proceed with packaging
(as it's better maintained) but we'll need to handle this mapping in a couple more places:
SpecifierSet
presumably also needs to map-nightly
to.dev0
.- The error message raised from
get_rust_version
if the compiler is not suitable will now usepackaging
syntax when it formatsmin_version
onutils.py
line 73. I think it'd potentially be confusing for users to see Rust versions which don't follow the actual Rust release syntax, so we should map the.bx
back to-beta.x
and.dev0
back to-nightly
in the error.
setuptools_rust/extension.py
Outdated
return None | ||
try: | ||
return semantic_version.SimpleSpec.parse(self.rust_version) | ||
return SpecifierSet(self.rust_version) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we probably need to do a similar mapping for -nightly
here?
|
Not sure I follow - I think it's a We map the rustc specs to Also, I think I've spotted another potential issue - it looks like we currently depend on ordering setuptools-rust/setuptools_rust/command.py Lines 30 to 36 in fab42d4
It looks like |
Note that I've now removed the deprecated In general I'm now leaning towards the opinion that we should stick to Unless you would like to make a further case for |
Use the "packaging" package instead of semantic_version package to parse
Rust version and spec. Packaging is used by setuptools to parse version
strings and specs.
This also solves a deprecation warning with semamtic_version. The
partial argument to Version() has been deprecated.
Signed-off-by: Christian Heimes [email protected]