-
-
Notifications
You must be signed in to change notification settings - Fork 289
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
Add option to pass python version number #199
Comments
I think this is duplicate of #121. The short version is using semver versions, e.g. |
It makes sense to use semver so that cargo doesn't complain, I guess this could be done for my issue as a compromise. But that doesn't solve the issue that a dynamic buildnumber generated by the build pipeline cannot be 'injected'. |
I think that modifying Cargo.toml in the build pipeline is the best solution. It should be a one-liner and will e.g. also ensure that |
wheel actually have a build tag part, see https://www.python.org/dev/peps/pep-0427/#file-name-convention
And |
PEP 621 also commited to having a static |
FWIW, setuptools supports a dynamic version that can be programmatically set by Also, PEP 621's motivation provides for "escape hatches", such as the dynamic version, and by the look of this thread, the maturin project seems to purposefully disregard this. Either way, I don't think it should be a "won't fix", because there's an open issue here: Maturin is non-compliant with PEP-0621 as described here. I.e. if maturin does not support the dynamic version directive, then at the very least it should "raise an error" if a dynamic version directive is encountered. |
Also just chiming in since we're trying to switch over from C++ to some more Rust based libraries and stumbled over this particular issue. This comment also nicely explains what can go wrong in non-atomic, manual release processes. As cargo now seems to allow version-less manifests (which I tried locally), I think there should be a somewhat easy way that maturin injects some version information on building a wheel. |
When building through a CI pipeline, it's not possible to pass a version number that has an incremental build number to
maturin build
.For my use case, the rust package has version "0.3.0", but the actual python package/wheel should receive "0.3.0.dev50". Simply renaming the file is not enough as the embedded metadata contains the version in some places (including directory name).
Passing the version would need to be dynamic - through environment variable or argument, not in a file like Cargo.toml - because this version is generated by the build pipeline.
Also note that cargo version semantics are different to python, and treats "0.3.0.dev50" as junk.
The text was updated successfully, but these errors were encountered: