Contributing¶
Thanks for helping with originet. Bugs and proposals go through issues; code through pull requests.
Setup¶
git clone git@github.com:estcarisimo/originet.git && cd originet
cargo build # the CLI: target/debug/originet
cargo test --workspace --all-features
cd python && uv sync --locked # builds the extension in editable mode (needs Rust)
uv run pytest
Requirements: Rust 1.88 or newer (rust-version in Cargo.toml), and for the Python
bindings uv and Python 3.10 or newer. Build the extension
with uv sync (maturin), not with cargo build --workspace: a pyo3 extension-module
cannot be linked by cargo alone (cargo clippy --workspace and cargo test --workspace
are fine, they do not link it). On an Apple Silicon
Mac the Rust toolchain must be the arm64 one (rustup); an x86_64 Homebrew toolchain
cannot build the extension for an arm64 Python.
Checks that CI runs, in the same order:
cargo fmt --all --check
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo clippy -p originet --all-targets --no-default-features -- -D warnings
RUSTDOCFLAGS="-D warnings" cargo doc -p originet --no-deps --all-features
cargo deny check # cargo install cargo-deny
cargo test --workspace --all-features --locked
cargo test -p originet --no-default-features --locked
(cd python && uv run ruff check . && uv run ruff format --check . && uv run mypy && uv run pytest -q)
docker build -t originet .
uvx --with-requirements docs/requirements.txt mkdocs build --strict
Tests never touch the network: they use the fixtures in tests/fixtures/ and a seeded
cache directory. Keep it that way; a test that needs CAIDA is an #[ignore] test.
Pull requests¶
- Branch from
main; never push tomaindirectly (theprotect-mainruleset enforces a pull request with green checks). - Every PR gets an independent review following
.github/REVIEW.mdand is merged only afterVERDICT: APPROVEon its final commit with CI green. - Add a bullet under
[Unreleased]inCHANGELOG.mdfor user-visible changes. - American English in identifiers, comments, docs and the changelog.
- Every documented command is run before it is written down; example output is a real capture.
- A change to the Python API updates
python/originet/_native.pyiandpython/tests/too. - Dependencies: pinned to SHAs in workflows; new crates must pass
cargo deny check(license allow-list indeny.toml).
Releases¶
- Move
[Unreleased]inCHANGELOG.mdto## [X.Y.Z] - YYYY-MM-DD. - Set
versiontoX.Y.ZinCargo.toml,python/Cargo.toml,python/pyproject.tomlandCITATION.cff(withdate-released); runcargo update --workspaceand(cd python && uv lock)so the lockfiles follow. - Merge that PR, then tag
vX.Y.Zonmainand push the tag.
The release workflow checks that the tag, the four versions and the changelog agree and
that the tag is on main; then it creates the GitHub release with the changelog section,
attaches binaries (Linux x86_64/aarch64 musl, macOS x86_64/arm64, Windows x86_64), builds
the wheels and the sdist, and pushes ghcr.io/estcarisimo/originet.
Publishing to PyPI and crates.io is gated by the repository variables PYPI_PUBLISH and
CRATES_IO_PUBLISH (true to publish) and uses OIDC Trusted Publishing, no stored
tokens. One-time setup per registry:
- PyPI: a pending publisher for
originet(ownerestcarisimo, repositoryoriginet, workflowrelease.yml, environmentpypi) can be created before the first upload, so the workflow can publish the first version. - crates.io has no pending publisher: the first version is uploaded by hand
(
cargo loginwith a token scoped topublish-newfororiginet, thencargo publish -p originet --lockedfrommain), the trusted publisher is added in the crate's settings (ownerestcarisimo, repositoryoriginet, workflowrelease.yml, environmentcrates-io), and the token is revoked. The workflow skips a version that is already on the registry, so tagging that same version afterwards is safe.