Thank you for your interest in contributing to debug-toolbar! This document provides guidelines and instructions for contributing.
Fork the repository on GitHub
Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/debug-toolbar.git cd debug-toolbar
Install uv (if not already installed):
curl -LsSf https://astral.sh/uv/install.sh | sh
Install development dependencies:
make dev
Install pre-commit hooks:
make prek-install
Create a new branch for your work:
git checkout -b feature/your-feature-name
Or use git worktrees for parallel development:
make worktree NAME=your-feature-name
Run the test suite:
make test
Run tests with coverage:
make test-cov
Run all CI checks locally before pushing:
make ci
This runs:
make fmt-check- Code formatting checkmake lint- Linting with ruffmake type-check- Type checking with tymake test- Unit and integration tests
To auto-fix formatting and lint issues:
make fmt make lint-fix
Build the documentation:
make docs
Serve documentation with live reload:
make docs-serve
We follow Conventional Commits for commit messages.
Format:
<type>(<scope>): <description> [optional body] [optional footer]
Types:
- feat: A new feature
- fix: A bug fix
- docs: Documentation only changes
- style: Changes that don't affect code meaning (formatting)
- refactor: Code change that neither fixes a bug nor adds a feature
- perf: Performance improvement
- test: Adding or correcting tests
- chore: Changes to build process or auxiliary tools
Examples:
feat(litestar): add custom visibility callback support fix(core): handle empty response bodies correctly docs: update installation instructions test(panels): add tests for SQLAlchemy panel
- Ensure all tests pass locally with
make ci - Update documentation if you're adding or changing features
- Add tests for new functionality
- Create a Pull Request with a clear description
- Link any related issues
- Wait for CI checks to pass
- Request review from maintainers
- We use ruff for linting and formatting
- Line length is 120 characters
- Use Google-style docstrings
- Type hints are required for public APIs
- All code must pass type checking with
ty
- Write tests for all new functionality
- Use pytest fixtures from
conftest.py - Mark tests appropriately:
-
@pytest.mark.unit- Fast, isolated tests -@pytest.mark.integration- Tests requiring full app setup - Test both core and framework-specific functionality
Example test:
@pytest.mark.unit
class TestMyPanel:
async def test_generate_stats(self, request_context: RequestContext):
"""Test panel stats generation."""
panel = MyPanel()
stats = await panel.generate_stats(request_context)
assert "expected_key" in stats
This project uses GitHub's immutable releases feature for supply chain security. Once a release is published, its assets and tag cannot be modified.
To create a new release:
Bump the version using uv (0.7.0+):
uv version --bump patch # 0.1.0 => 0.1.1 uv version --bump minor # 0.1.0 => 0.2.0 uv version --bump major # 0.1.0 => 1.0.0
Commit and merge to main:
git add pyproject.toml git commit -m "chore: bump version to X.Y.Z" # Create PR, wait for CI, merge
Push the tag to trigger the release workflow:
git checkout main && git pull git tag vX.Y.Z git push origin vX.Y.Z
The CD workflow automatically:
- Builds the distribution
- Signs with Sigstore
- Creates a draft GitHub release with assets attached
- Publishes to PyPI (trusted publishing)
- Publishes the release (removes draft status)
- Creates a PR to update the changelog
Note
With immutable releases enabled, tags cannot be reused. If a release fails after the tag is pushed, bump to the next patch version instead of attempting to recreate the same tag.
- Open a GitHub Discussion
- Join the Litestar Discord
- Check existing Issues
By contributing, you agree that your contributions will be licensed under the MIT License.