Thank you for your interest in contributing to Granite Switch!
This project uses uv for dependency management. Install it once before working on the project:
curl -LsSf https://astral.sh/uv/install.sh | shOr via pip: pip install uv
Keep
uv.lockatrevision = 3. Therevisionfield at the top ofuv.lockis the lockfile format version, bumped automatically by newer uv releases (uv 0.12.x writesrevision = 5). It is not a dependency change, and we pin it at3so the committed lockfile stays readable by the uv versions the team and CI use. Ifgit diff uv.lockshows onlyrevision = 3→revision = 5(or similar) after auv sync/uv lock, that bump is spurious — revert it before committing:git checkout uv.lock # if revision is the only changeIf you also changed dependencies, re-lock and then reset just the first line back to
revision = 3by hand (edituv.lockline 2) so only the real dependency changes land. Do not commit a barerevisionbump.
- Fork the repository
- Clone your fork and install dependencies:
git clone https://github.com/<your-username>/granite-switch.git cd granite-switch uv sync --group dev
On macOS (or any machine without a CUDA GPU): the
devgroup pulls in vLLM + CUDA, which have no macOS wheels, souv sync --group devfails. Install the CPU-only subset instead — enough for unit, HF, and compose work:uv sync --frozen --no-default-groups --extra hf --extra compose
--no-default-groupsskips the defaultvllm26group;--frozeninstalls strictly from the committeduv.lockwithout modifying it. (What fails on macOS is installing the vLLM/CUDA wheels — resolving the lockfile withuv lockworks fine, so theuv-lockpre-commit hook runs locally too; the CPU subset above simply never installs those wheels.) To run the CPU test suites the same way, prefix pytest with the same flags, e.g.uv run --frozen --no-default-groups --extra hf --extra compose pytest tests/unit tests/hf tests/composer. vLLM and integration tests are Linux + GPU only and cannot run locally on macOS. - Enable the project's pre-commit hooks (ruff, nbstripout, link/import validation, SPDX/DCO checks, and basic hygiene checks). pre-commit manages its own isolated environment per hook, so install it as a standalone tool rather than into the project venv:
uv tool install pre-commit # one-time, isolated — any platform pre-commit install # hooks for staged files pre-commit install --hook-type prepare-commit-msg # auto-adds your DCO sign-off pre-commit install --hook-type commit-msg # verifies the DCO sign-off git config blame.ignoreRevsFile .git-blame-ignore-revs
Don't use
uv run pre-commit.uv runfirst syncs the project's default dependency group (vLLM + CUDA), which fails on macOS and needlessly pulls the GPU stack on Linux.uv tool install(orpipx/a system package) installs pre-commit standalone and works on every platform.All three
installcommands are required.pre-commit installalone only wires up the staged-file hooks; the DCO hooks run at theprepare-commit-msgandcommit-msgstages and must be installed explicitly. With them in place your sign-off is added automatically — see Sign off your commits (DCO) below. - Create a feature branch and make your changes
- Run tests:
uv run pytest tests/ -v - Submit a pull request
Every commit must carry a Developer Certificate of Origin (DCO) sign-off. By adding a sign-off you certify that you wrote the change (or otherwise have the right to submit it) under the project's license — see the full DCO text. A commit-msg hook and a CI check both reject commits that are missing it.
A sign-off is just a trailer line at the end of the commit message:
Signed-off-by: Jane Doe <jane.doe@example.com>
The sign-off is generated from your Git identity, so set it once (drop --global to scope it to
this repository only):
git config --global user.name "Jane Doe"
git config --global user.email "jane.doe@example.com"The name and email must match the values you sign off with — a real name and a reachable email
are expected, and the email must be a valid name@host address (the check requires an @). Verify
with:
git config user.name
git config user.emailOnce the prepare-commit-msg hook is installed (step 3 of Getting Started), your
sign-off is appended automatically from the Git identity above — every git commit just works,
no flags to remember:
git commit -m "Your commit message" # Signed-off-by: is added for youThe commit-msg hook then verifies the trailer is present, and the CI DCO check enforces it on the
PR as a backstop.
If you haven't installed the hook (e.g. a fresh clone), pass -s (--signoff) and Git appends the
trailer itself:
git commit -s -m "Your commit message"Forgot it on your last commit? Amend it:
git commit --amend -s --no-editTo sign off every commit on an existing branch in one go:
git rebase --signoff origin/mainSee docs/GIT_WORKFLOW.md for detailed workflow, commit conventions, and code quality standards.
- Bug fixes — Identify and fix issues in the codebase
- Documentation — Improve tutorials and guides
This project follows the Contributor Covenant Code of Conduct. Please read it before participating.
Open an issue or start a discussion.