Developer Documentation¶
Installing from Source¶
Install rust
Pip install
pip install --no-binary smirk
Development Environment¶
Install uv
Build smirk:
uv run maturin developUse it:
uv run python -c 'import smirk'
Running Tests¶
To test at the rust level: cargo test. To run the python tests:
uv run maturin develop # Ensure the rust library is up to date
uv run pytest # Runs the testsuite
Building Documentation¶
To build the documentation:
uv run --group docs --with pip sphinx-autobuild docs build/html
Editing Notebooks¶
Launch the notebook in an isolated environment:
uv run --isolated --no-default-groups --with jupyter,pip jupyter notebook
Make some changes and save the notebook
Purge notebook outputs
uv run pre-commit run --allCommit your changes
Important
Please avoid committing notebooks with saved cell outputs
Linting¶
- All in one:
uv run pre-commit run --all- Rust:
Check syntax with
cargo checkand formatting withcargo fmt- Python:
Check syntax with
ruff --fix --select=Iand formatting withruff format