Add minimal C-api implementation that builds with Pyo3#7562
Add minimal C-api implementation that builds with Pyo3#7562bschoenmaeckers wants to merge 137 commits into
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Could you try with hpy if you dont mind? We are looking for sustainable way |
That would require significant changes in codebase that are using the CPython api spec. I would like to explore the possibility to use the ab3/abi3t api. Would you be willing to accept that? |
youknowone
left a comment
There was a problem hiding this comment.
This way will not work.
Just in case, the code can be generated, but I hope we carefully review the decisions. unlikely-to-happen decisions must be reviewed and justified by document(comment) the decisions.
If you are not familiar enough to the project to decide good way, please start from a smaller and simpler issue.
We only need abi3t, because we are compatible to free-threading.
We have to minimize the surface of C API. if HPy helps it, we need HPy.
Ideally c api must be very thin wrappers to RustPython features. "code" must not be included in this crate.
I wanted to create as little of modificaties to the existing code base without significant motivation. But I definitely agree with you. |
This reverts commit b2c2f69.
📦 Library DependenciesThe following Lib/ modules were modified. Here are their dependencies: [ ] lib: cpython/Lib/ctypes dependencies:
dependent tests: (34 tests)
Legend:
|
This is my shot at implementing a minimal Cpython compatible C-api. I've implemented the bare minimum to get the included Pyo3 example running where most of the api is stubbed. I'm not familiar with the rest of the RustPython code base so let me know what you think and where I did stupid things.
Please take extra care reviewing the pylifecycle.rs & pystate.rs files where I try to setup the RustPython interpreter.
xref #5604