Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions python_bindings/BUILD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Building and Releasing

## Building from source
First, create a Python `venv`, like so:
```sh
cd python_bindings
python3 -m venv .env
source .env/bin/activate
```

We use `maturin` and `pyo3` to develop, build and publish. Make sure that the `maturin` executable is available, for example by running
```sh
pip install maturin
```
or by using the package manager of your choice, e.g. `dnf install maturin` or `apt install python3-maturin`.

For developing, run
```sh
maturin develop
```
which will install the crate as a python module in the current virtual environment. You can then e.g. use it from a REPL, like so:
```sh
python3
>>> import tsalign
>>> alignment = tsalign.align("ACGT", "AGT")
>>> alignment.cigar()
'1M1D2M'
>>> ...
```

## Release
Release by simply adjusting the version in `Cargo.toml`, create and push a tag that is called `python_bindings-v<version>`. A GitHub action should™ publish to the [PyPI repository](https://pypi.org/project/tsalign/).