Skip to content

Commit

Permalink
Merge 'docs: add python bindings' from Jean Arhancet
Browse files Browse the repository at this point in the history
Document Python binding setup with Maturin.

Closes #653
  • Loading branch information
penberg committed Jan 13, 2025
2 parents 44550ab + 94ff7ac commit 481bd17
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,25 @@ The `simulator` directory contains a deterministic simulator for testing.
What this means is that the behavior of a test run is deterministic based on the seed value.
If the simulator catches a bug, you can always reproduce the exact same sequence of events by passing the same seed.
The simulator also performs fault injection to discover interesting bugs.

## Python Bindings

Limbo provides Python bindings built on top of the [PyO3](https://pyo3.rs) project.
To compile the Python bindings locally, you first need to create and activate a Python virtual environment (for example, with Python `3.12`):

```bash
python3.12 -m venv venv
source venv/bin/activate
```

Then, install [Maturin](https://pypi.org/project/maturin/):

```bash
pip install maturin
```

Once Maturin is installed, you can build the crate and install it as a Python module directly into the current virtual environment by running:

```bash
cd bindings/python && maturin develop
```

0 comments on commit 481bd17

Please sign in to comment.