-
-
Notifications
You must be signed in to change notification settings - Fork 284
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 build just the compiled extension modules #1419
Comments
Sounds interesting, I'll keep an eye on it.
We could add a |
Building the extension itself is the easy part, on linux even just The hard part is configuration: Where is the Cargo.toml and where should the .so go? What are the options to compile: Debug or release, are we cross compiling and which cargo rustc options to add? How do we know when we need to recompile? Which configuration files contain this information and how can the user overwrite them? This is something that PEP 517 skips over by saying For my understanding, PEP 517 is a sdist -> whl spec, and it does this job mostly really well (again except for configuration, which isn't a problem normally if you just want to On the practical side, exposing a config json -> built shared library either as cli or with pyo3 shouldn't be too hard. You might want to look at BuildOptions (the user input) or BuildContext (the resolved configuration) to get an impression for the API. |
Hi, I’d like to use pyo3-stub-gen together with maturin’s github action. This doesn’t seem possible without wasting time:
So splitting maturin into a core library that can be wrapped into a hatchling plugin would be amazing! |
Hello! I'm starting an effort to make it easier and more standardized to build extension modules in Python. This was discussed recently on the Discourse Python forum but essentially the end goal is something like what is documented here and eventually a PEP. My view is that the Python community has not fully completed the expressed outcome of PEP 517 in that build backends are still (for the most part) reliant on setuptools for building non-Python code bases.
In my mind, there is a component that selects what files are to be included in an archive which we call the build backend and some other component that interacts with a compiler to generate some files. I think that there is no reason at all that they must be the same component.
In this hypothetical future any build backend would be able to trigger the building of extension modules based on user configuration. So in the case of maturin, that would look like (forgetting about what the final interface might be, that's my job) a way to just build the compiled bits and output the location of the files (and maybe some metadata) whether that be with a direct function call or via CLI.
I'm not too familiar with this code base yet but I think it wouldn't be too challenging to add such an option. Is that an accurate assessment?
Also, please let me know what you think of this general proposal. If it happens, you wouldn't actually need to maintain your own logic for building wheels and source distributions, etc. only the Rust part. Of course you can always still provide that functionality if you wanted.
Thank you for your time 🙂
The text was updated successfully, but these errors were encountered: