-
Notifications
You must be signed in to change notification settings - Fork 796
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
pyo3, rust-numpy, ndarray, and num-complex MSRV issue #1798
Comments
mtreinish
added a commit
to mtreinish/pyo3
that referenced
this issue
Aug 16, 2021
When building an extension with rust-numpy and ndarray on the MSRV of 1.41 with complex numbers. The num-complex crate version needs to be 0.2 which was the pinned version as of ndarray 0.13.1 which was the last release of ndarray that supported building with rust 1.41. However, the pyo3 pinned version of 0.4 is incompatible with this and will cause an error when building because of the version mismatch. To fix this This commit expands the supported versions for num-complex to match what rust-numpy uses [1] so that we can build pyo3, numpy, ndarray, and num-complex in an extension with rust 1.41. Fixes PyO3#1798 [1] https://github.com/PyO3/rust-numpy/blob/v0.14.1/Cargo.toml#L19
mtreinish
added a commit
to mtreinish/pyo3
that referenced
this issue
Aug 16, 2021
When building an extension with rust-numpy and ndarray on the MSRV of 1.41 with complex numbers. The num-complex crate version needs to be 0.2 which was the pinned version as of ndarray 0.13.1 which was the last release of ndarray that supported building with rust 1.41. However, the pyo3 pinned version of 0.4 is incompatible with this and will cause an error when building because of the version mismatch. To fix this This commit expands the supported versions for num-complex to match what rust-numpy uses [1] so that we can build pyo3, numpy, ndarray, and num-complex in an extension with rust 1.41. Fixes PyO3#1798 [1] https://github.com/PyO3/rust-numpy/blob/v0.14.1/Cargo.toml#L19
This was referenced Aug 16, 2021
davidhewitt
pushed a commit
that referenced
this issue
Aug 17, 2021
When building an extension with rust-numpy and ndarray on the MSRV of 1.41 with complex numbers. The num-complex crate version needs to be 0.2 which was the pinned version as of ndarray 0.13.1 which was the last release of ndarray that supported building with rust 1.41. However, the pyo3 pinned version of 0.4 is incompatible with this and will cause an error when building because of the version mismatch. To fix this This commit expands the supported versions for num-complex to match what rust-numpy uses [1] so that we can build pyo3, numpy, ndarray, and num-complex in an extension with rust 1.41. Fixes #1798 [1] https://github.com/PyO3/rust-numpy/blob/v0.14.1/Cargo.toml#L19
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🐛 Bug Reports
There is an MSRV conflict between ndarray, rust-numpy, and pyo3. Specifically the msrv of ndarray was increased to 1.42 in ndarray 0.14.0 and to rust 1.49 in 0.15 (see https://github.com/rust-ndarray/ndarray/blob/master/RELEASES.md ) so to use ndarray with numpy we need ndarray 0.13.x which still supports building with rust 1.41. However, if we need to use num-complex with all of the above for a complex number we have to use the version pinned in the ndarray 0.13.1 package which is 0.2:
https://github.com/rust-ndarray/ndarray/blob/0.13.1/Cargo.toml#L33
but this has an interop issue with pyo3's num-complex optional dependency which requires 0.4:
https://github.com/PyO3/pyo3/blob/main/Cargo.toml#L24
which causes a version mismatch if there is an object taken from a numpy array converted to a readonly ndarray that gets converted to a pyobject (which I hit).
🌍 Environment
rustc --version
): 1.41.1version = "0.x.y"
withgit = "https://github.com/PyO3/pyo3")?
: no (but it has the same issue)💥 Reproducing
The only way I can get this to work with all 4 libs is by using the latest rust version and the latest ndarray and num-complex. Then everything builds as expected and is using num-complex 0.4. I really can't wait for cargo to support msrv package metadata so this kind of situation can be automatically resolved.
The text was updated successfully, but these errors were encountered: