|
| 1 | +# Contributing |
| 2 | + |
| 3 | +Thanks for your interest in the Dexpace Python SDK. External pull requests |
| 4 | +are welcome — this page covers everything you need to get a change merged. |
| 5 | + |
| 6 | +## Setup |
| 7 | + |
| 8 | +The repository is a [`uv`](https://docs.astral.sh/uv/)-managed workspace of |
| 9 | +five packages. One sync provisions everything in editable mode along with |
| 10 | +the dev toolchain: |
| 11 | + |
| 12 | +```bash |
| 13 | +git clone https://github.com/dexpace/python-sdk.git |
| 14 | +cd python-sdk |
| 15 | +uv sync |
| 16 | +``` |
| 17 | + |
| 18 | +## Quality gates |
| 19 | + |
| 20 | +Every pull request must pass the same four gates CI runs (on Python 3.12, |
| 21 | +3.13, and 3.14): |
| 22 | + |
| 23 | +```bash |
| 24 | +uv run pytest -q # full test suite |
| 25 | +uv run mypy --strict # type-check |
| 26 | +uv run ruff check # lint |
| 27 | +uv run ruff format --check # formatting |
| 28 | +``` |
| 29 | + |
| 30 | +Run them locally before opening a PR. |
| 31 | + |
| 32 | +## Conventions |
| 33 | + |
| 34 | +The full convention set lives in [`CLAUDE.md`](CLAUDE.md). The essentials: |
| 35 | + |
| 36 | +- **Python 3.12+** with modern syntax: `X | None`, built-in generics, |
| 37 | + PEP 695 type parameters, `from __future__ import annotations` everywhere. |
| 38 | +- **Immutable models**: `@dataclass(frozen=True, slots=True)`; mutate via |
| 39 | + `dataclasses.replace` or `with_*` helpers — no builders. |
| 40 | +- **`Protocol` for SPIs, `ABC` for shared behaviour.** |
| 41 | +- **No new runtime dependencies.** `core` ships against the standard |
| 42 | + library plus `furl` only; new third-party needs belong behind the |
| 43 | + `HttpClient` or `Serde` seams, or in a new transport package. |
| 44 | +- **Google-style docstrings** on every public symbol; functions capped at |
| 45 | + 50 lines. |
| 46 | +- **MIT licence header** (two lines) at the top of every `.py` file, src |
| 47 | + and tests alike. |
| 48 | + |
| 49 | +## Commit messages |
| 50 | + |
| 51 | +Use the prefixes the history already follows: |
| 52 | + |
| 53 | +| Prefix | Use for | |
| 54 | +|----------|----------------------------------| |
| 55 | +| `feat:` | new features | |
| 56 | +| `fix:` | bug fixes | |
| 57 | +| `chore:` | refactors and cleanup | |
| 58 | +| `docs:` | documentation-only changes | |
| 59 | +| `ci:` | CI configuration | |
| 60 | + |
| 61 | +## Reporting issues |
| 62 | + |
| 63 | +Use the [issue templates](https://github.com/dexpace/python-sdk/issues/new/choose). |
| 64 | +For security vulnerabilities, follow [`SECURITY.md`](SECURITY.md) instead of |
| 65 | +opening a public issue. |
0 commit comments