Contribution Guide¶
Setting Up the Environment¶
- Run
make install-uvto install uv if not already installed. - Run
make installto install all dependencies and pre-commit hooks.
Code Contributions¶
Workflow¶
- Fork the
litestar-granianrepository. - Clone your fork locally with
git. - Set up the environment.
- Make your changes.
- Run
make lintoruvx prek run --all-filesto run linters and formatters. - Commit your changes to
git. - Push the changes to your fork.
- Open a pull request with a descriptive Conventional Commit title indicating what it changes.
Tip
Pull requests and commits must follow the Conventional Commits specification.
Guidelines for Writing Code¶
- All code must be strictly typed and validated with mypy and Pyright.
- All code must be tested with pytest.
- All code must be formatted and linted with Ruff.
Writing and Running Tests¶
Run the complete test suite with make test. Use a focused uv run pytest path/to/test_file.py command while developing, then run make lint, make type-check, make docs, and make build before release.
Runtime changes should cover both focused command-building behavior and real subprocess shutdown. Signal tests must target the top-level Litestar PID and verify that the port closes, server lifespans unwind, and no Granian descendant is orphaned.
Project Documentation¶
The documentation lives in the docs/ directory and is built with Zensical and mkdocstrings-python.
Running the Docs Locally¶
Serve the documentation locally with make docs-serve or build and verify all documentation artifacts with make docs.
Creating a New Release¶
- Increment the version in
pyproject.tomlfollowing Semantic Versioning and PEP 440. - Draft a new release on GitHub using
vMAJOR.MINOR.PATCHas both the tag and release title. - Commit your changes and push to
main. - Publish the release and verify that the GitHub Actions release workflow completes cleanly.