https://github.com/fschutt/pythontest
Test to bind a Rust module to Python with PyO3
https://github.com/fschutt/pythontest
Last synced: about 1 month ago
JSON representation
Test to bind a Rust module to Python with PyO3
- Host: GitHub
- URL: https://github.com/fschutt/pythontest
- Owner: fschutt
- Created: 2021-04-30T23:34:24.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-30T23:34:45.000Z (about 5 years ago)
- Last Synced: 2025-02-24T21:11:38.428Z (over 1 year ago)
- Language: Rust
- Size: 1000 Bytes
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pythontest
Test how to build an extension module for Python
## Build
```sh
RUSTFLAGS="-C target-feature=-crt-static" \
cargo build --target=x86_64-unknown-linux-musl --release
# Install systemwide
strip ./target/x86_64-unknown-linux-musl/release/libazul.so
sudo cp ./target/x86_64-unknown-linux-musl/release/libazul.so /usr/lib
# Create symlink with proper name
ln -s /usr/lib/libazul.so ./azul.so
# Execute the script
python3 ./test.py
```
## Note
PyO3 only supports Python 3+, not Python 2.7! Make sure to
run your script with `python3 ./test.py`, not regular `python`