-
I'm trying to publish my project to PyPI using github actions, but I'm feeling overwhelmed by options I don't understand. My project is primarily python and I've added a small rust file that uses ffi to interface with cpython. I don't use any additional rust or C libraries. Looking at https://www.maturin.rs/distribution.html#build-wheels, I see that I should use a manylinux docker image, but I'm not clear which image I should use or how to set that up. That page also suggests using the PyO3/maturin-action github action. Does this handle using the correct docker image for me? Or do I need to use the pyo3/maturin image directly and ignore the github action? Should I use the github action only for windows and mac? Which version of manylinux should I use? manylinux2014? How does cross-compiling work? Which architectures should I make wheels for? I've tried looking at the maturin-action documentation, but looking at the linked examples I just become overwhelmed with options again. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yes, usually you only need to feed it the Rust target and manylinux policy.
You can use it directly if you only care about x86_64 Linux.
Windows and macOS are easy,
For pure Rust project, manylinux2014 is recommended. The choice should be based on your target os glibc version, manylinux2014 is glibc 2.17 which is old enough to support most distros.
cross-compiling needs cross compilers, in Rust usually only a cross linker is required when no C/C++ dependencies are involved. I've built manylinux-cross docker images for them.
manylinux2014 supports x86_64, i686, aarch64, armv7l, ppc64le and s390x. |
Beta Was this translation helpful? Give feedback.
Yes, usually you only need to feed it the Rust target and manylinux policy.
You can use it directly if you only care about x86_64 Linux.
Windows and macOS are easy,
pip install maturin
and run it directly generally works, the github actions only simplify the process.For pure Rust project, manylinux2014 is recommended. The choice should be based on your target os gli…