Skip to content
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

Python enhancement: use cffi instead of rust-cpython #342

Open
tasn opened this issue Aug 13, 2020 · 0 comments
Open

Python enhancement: use cffi instead of rust-cpython #342

tasn opened this issue Aug 13, 2020 · 0 comments
Labels
enhancement Python Python related issues

Comments

@tasn
Copy link

tasn commented Aug 13, 2020

Having used the Python generated bindings successfully, I've now reached the point of packaging them and uploading to PyPi, though unfortunately this is quite the ordeal. The reason for that is that when using rust-cpython we are building real python modules written in Rust (no Python code) which have some annoying implications:

  1. You can't inherit from classes. I wanted to add some Python specific sugar on top some of the classes and it doesn't seem to be possible.
  2. Packaging is absolutely hell - when using rust-cypthon your built module is specific to the minor Python version in addition to the Arch. This means that you have to build it for every combination of OS, Arch and Python version, which is insane (and not too easy to set up in CI).

Idea: maybe let's use the generated C API that we already have in the C++ backend and just generate a python module to wrap around it using the python ffi library. This will make the build matrix less insane.

I'm not sure whether it's a good idea or not. I'm just putting this out there for some discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Python Python related issues
Projects
None yet
Development

No branches or pull requests

2 participants