- Notifications
You must be signed in to change notification settings - Fork0
Demo repo showing how to build Python extension using Rust.
License
code-ape/rust_python_extension
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Demo repo showing how to build Python extension using Rust.
This was built usingrustc 1.4.0-nightly (dcdcc6f6b 2015-08-11) and run onPython 2.7.10. To run with Python3 change the[dependencies.cpython] section that saysfeatures = ["python27-sys"] tofeatures = ["python3-sys"] (note, this is untested). For best results it is recommended to use exactly what I did.
- Run
cargo build --release - Run
python try_in_python.py
This repo was created because my initial attempt to use the code Higgs provided didn't work due to very recent changes indgrunwald/rust-cpython andSkylerLipthay/interpolate_idents. Long term I'm sure this will no longer be an issue but for those who want to do this now, this is helpful. Please refer to myCargo.toml to see exactly what versions of these dependencies you'll need to successfully use this. NOTE: for now this repo is using a fork ofinterpolate_idents by dgrunwald, foundhere. There is a PR for these changes to be merged back in, foundhere, which should hopefully soon make this repo unnecessary.
The example code comes straight from Ewan Higgs post on using Rust cpython crate. For a more detailed look into Higgs work see his blog posthere.
About
Demo repo showing how to build Python extension using Rust.
Resources
License
Uh oh!
There was an error while loading.Please reload this page.