-
Notifications
You must be signed in to change notification settings - Fork 15
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
libmicrovmi python bindings #162
Comments
After looking at rust-cpython, a couple of things:
|
that's awesome, my info was not up to date then, because I thought it was still nightly only. 👍 |
actually not a good idea, since the library produced has undefined symbols to the Python API, requiring that any binary would link with Python libs.
so workspace and splitting is a good idea. |
I investigated how to distribute the generate bindings. maturin seems like the way to go for PyO3 bindings. The crate name right now is pip install microvmi
and
from microvmi import Microvmi Unfortunately, maturin doesn't allow to override this package name at the moment, and only uses the Cargo Looking at this comment it looks like I will have a look at it |
What's wrong with |
I prefer the simplicity of having |
Sure, I get that sentiment. I am just not sure whether it's worth pursuing other routes over. ;) |
I managed to get |
Are there any drawbacks at all if we are using |
Maturin is described as:
So no, we are just not following the hype ... yet :) |
Publishing wheels on PyPI is a pain in the ass. PyPI will refuse
reason: https://stackoverflow.com/a/59586096/3017219 However, Rust can't be installed on the
with
and with |
Okay, I uploaded a first version on PyPI to reserve the name, and generate a project specific API token (which is not possible without a first upload) |
About packaging, we have a problem. Currently, the python library will rebuild libmicrovmi and embed it inside the Python extension. and for the rest, we might face an issue with outdated software that just won't compile, but not sure yet. I have no idea to propose for now. |
Sounds tough, maybe we shouldn't use the official manylinux image then? We are not going to support older linux versions anyway. |
the issue is that manylinux is the only way to upload a wheel on PyPI. I managed to compile everything on this CentOS 6, so let's keep this for now. other topic: |
Sure, but you could use unofficial images based on newer linux distros. But if you already got it working there is no need to change it now of course ;) |
I don't think you can skip CentOS, the whole point is to use a very old ABI to have maximum compatibility, that's why they take CentOS 5/6.
And the reason we need this manylinux conversion is stated in this PEP: |
Well, imho you are already breaking this philosophy by installing a bunch of custom headers/libraries that are only available on newer systems (at least newer than CentOS 6). Looks to me like you are cheating a little, so to speak ;) |
PyO3 just added support for a custom wheel name: I'm keeping the setuptools-rust based setup for now, but we could switch to maturin one day 👍 It actually doesn't event matter anymore since we providing a python library |
Create Python bindings to call libmicrovmi from Python
TODO (updated):
DriverType
andDriverInitParam
read_physical
setup.py
to accept--features
parameter, and set features inRustExtension
quay.io/pypa/manylinux2014_x86_64
and install all the drivers required development headersbuild-wheels.sh
to accept--features
and pass them tosetup.py
python/Cargo.toml
to fillsetup.py
metadataWe should use the
rust-cpython
projectrust-cpython will help us to generate a Python extension module, wrapping the libmicrovmi Rust API.
how to integrate this new library
@rageagainsthepc if you have an opinion
The text was updated successfully, but these errors were encountered: