lawsynth/docs/getting-started/installation.md
caelum0x 7dfbb5df69 fix(python): make documented maturin install path work
The `maturin develop` path documented in the README and installation guide
failed: python/lawsynth/ has no Cargo.toml and pyproject.toml carried no
manifest-path, so maturin had nothing to build. Point maturin at the
lawsynth-python crate in the Cargo workspace via manifest-path, and document
scripts/build-native.sh as the maturin-free / offline fallback (both produce
an import-compatible lawsynth._native).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-09-06 13:01:01 +03:00

1.7 KiB

Installation

The core requires Rust 1.94.0 with clippy and rustfmt; the pinned toolchain is recorded in rust-toolchain.toml. The Python package requires Python 3.11 or newer and uses maturin to build lawsynth._native.

Install the lawsynth CLI, or run it in place while developing:

cargo install --path crates/lawsynth-cli   # installs the `lawsynth` binary
# or
cargo run -p lawsynth-cli -- --help
cargo test --workspace

Cargo is deliberately configured with [net] offline = true. A fresh machine must first obtain the lockfile's crates in an environment with registry access (for example, temporarily run cargo fetch with offline mode disabled), then restore offline mode for normal local verification. Do not edit the lockfile or replace locked dependencies merely to make an offline build pass.

For Python development:

cd python/lawsynth
python -m pip install maturin
maturin develop
python -m pytest -q tests

maturin develop reads manifest-path from pyproject.toml, which points at the lawsynth-python crate in the Cargo workspace. On machines without maturin (or without registry access to fetch the maturin/pyo3 build chain), build the identical lawsynth._native extension with a plain cargo build:

python/lawsynth/scripts/build-native.sh   # builds and installs _native next to the package

This gives you the lawsynth.Study API. Two optional companion packages extend it: lawsynth-notebook (the StudyDashboard rich notebook view) and lawsynth-connectors (import observations from filesystem, http, s3, postgres, and sqlite sources via Study.from_source). Both live under python/ and degrade to a clear error when absent.