Contributing
Contributing to refloxide¶
Thank you for your interest in contributing to refloxide!
Development Setup¶
- Fork and clone the repository:
- Install dependencies using uv (dev tooling +
[plugin]modeling stack):bash uv sync --group dev --extra plugin - Install prek hooks:
Making Changes¶
- Create a new branch for your feature or bugfix:
- Make your changes and ensure tests pass:
- Ensure code quality:
- Commit your changes using conventional commits:
Commit Message Format¶
We use Conventional Commits. Here are some examples:
feat: add new feature- A new featurefix: resolve bug in X- A bug fixdocs: update README- Documentation changesrefactor: simplify code- Code refactoringtest: add tests for X- Adding testschore: update dependencies- Maintenance tasks
Pull Request Process¶
- Update documentation if needed
- Add tests for new functionality
- Ensure all tests pass
- Run the benchmark comparison (below) and paste its table into the PR description
- Submit a pull request with a clear description
Benchmarks are a PR requirement¶
Every pull request that touches Rust code, the build profile, or the Python hot path must include a before/after benchmark from at least one machine. Shared CI runners are too noisy to measure performance, so the benchmark is not an Actions job: the author runs it locally when opening the PR.
The script builds a release wheel of the merge-base with main (in a
temporary git worktree) and of your working tree, runs
examples/gpu_backend_bench.py against each in an isolated environment, and
writes a markdown table (also saved to bench-compare.md, which is
gitignored) with the machine, toolchain, and per-benchmark change. Paste the
whole block into the PR description. Pass --base <ref> to compare against a
tag or another commit, and --repeats N for tighter medians.
Reviewers expect no unexplained slowdown. A regression is acceptable only with a stated reason in the PR. Docs-only changes may state "not applicable".
CI¶
| Workflow | When | What |
|---|---|---|
| CI | every PR push, push to main |
rust (fmt, clippy, tests, shader check), python (lint, format, types, pytest; extension built once), package (wheel and sdist build plus import; Linux on PRs, Linux/macOS/Windows on main) |
| Security | weekly, manual, PRs that change a lockfile or manifest | dependency scan; semgrep on the schedule only |
| Documentation | push to main |
build and deploy the site |
| Release | push to main that changes the package, manual dry run |
see Releasing |
Performance is not checked in CI; see "Benchmarks are a PR requirement".
Reproduce the CI checks locally with cargo fmt --all --check,
cargo clippy --workspace --all-targets -- -D warnings,
cargo test --workspace --all-targets, and make verify test.
Releasing¶
A release is a version bump merged to main. Nothing is published from a
branch or a manual step.
- Run
make release-prep. It derives the next semver from conventional commits since the latestv*tag (or take--bump patch|minor|major) and updatespyproject.toml,Cargo.toml([workspace.package]),python/refloxide/__init__.py, lockfiles, andCHANGELOG.md. - Commit the result and open a normal pull request.
- Merge it. The Release workflow checks that the three versions agree and
that tag
vX.Y.Zdoes not exist yet. If so, it runs CI, builds wheels for Linux (x86_64, aarch64), macOS (x86_64, arm64) and Windows (x64) plus the sdist, publishes to PyPI by trusted publishing, then creates the tag and a GitHub release with git-cliff notes. If the tag exists, it does nothing.
Run Release manually with dry_run to build everything without
publishing or tagging. The Rust crates are not published to crates.io.
Dependency Updates¶
This project uses Renovate for automated dependency updates. Renovate will automatically open pull requests when new versions are available for:
- GitHub Actions
- Python dependencies (via
pyproject.toml) uv.locklockfile
To activate it:
- Go to github.com/apps/renovate and click Install
- Choose your GitHub account or organization
- Under Repository access, select this repository (or all repositories)
- Click Install & Authorize
- Renovate will open an onboarding pull request titled
Configure Renovate— merge it to activate - Renovate will now open PRs automatically when new dependency versions are available
The renovate.json at the root of this project is pre-configured to manage:
- GitHub Actions workflow dependencies
- Python dependencies (via
pyproject.toml)