Thank you for your interest in contributing! This guide covers how to set up your development environment, build, test, and submit changes.
- Python (3.11+)
- Docker
- Make
That's it. All dev tools (ruff, mypy, pytest, protoc) run inside Docker — no local installation needed.
# Clone the repository
git clone https://github.com/opendecree/decree-python.git
cd decree-python
# Build the tools image (one-time)
make tools
# Run the full check suite
make lint && make typecheck && make testedit code -> lint -> typecheck -> test -> commit -> PR
| Target | Description |
|---|---|
make generate |
Regenerate proto stubs from BSR |
make lint |
Lint with ruff (check + format) |
make format |
Auto-format with ruff |
make typecheck |
Type check with mypy (strict) |
make test |
Run tests with coverage (pytest) |
make build |
Build sdist + wheel |
make clean |
Remove build artifacts |
Generated proto stubs live in sdk/src/opendecree/_generated/ and are committed to git. If the upstream .proto files change, regenerate with:
make generateThis requires the decree repo checked out alongside decree-python (for proto source files).
sdk/
├── src/opendecree/ # SDK source
│ ├── client.py # ConfigClient (sync)
│ ├── async_client.py # AsyncConfigClient
│ ├── watcher.py # ConfigWatcher (sync)
│ ├── async_watcher.py # AsyncConfigWatcher
│ ├── errors.py # Exception hierarchy
│ ├── types.py # Dataclass return types
│ ├── _channel.py # gRPC channel factory
│ ├── _interceptors.py # Auth metadata interceptors
│ ├── _retry.py # Exponential backoff retry
│ ├── _convert.py # TypedValue conversion
│ ├── _stubs.py # Lazy proto stub loading
│ └── _generated/ # Proto stubs (committed)
├── tests/ # pytest test suite
├── docs/ # Usage documentation
└── pyproject.toml # Package metadata + tool config
make testTests use pytest with pytest-asyncio. Coverage must stay above 80% (enforced in pyproject.toml). Tests mock gRPC stubs — no running server needed.
- Linting and formatting: ruff (replaces black + isort + flake8)
- Type checking: mypy in strict mode
- Run
make lint && make typecheckbefore submitting
- Fork the repository
- Create a feature branch from
main - Make your changes
- Ensure
make lint && make typecheck && make testpasses - Open a pull request against
main
By contributing, you agree that your contributions will be licensed under the Apache License 2.0.