|
| 1 | +# Contributing to the OpenShell Python SDK |
| 2 | + |
| 3 | +## Setup |
| 4 | + |
| 5 | +Install [mise](https://mise.jdx.dev/), then install the pinned tools and the |
| 6 | +development dependencies: |
| 7 | + |
| 8 | +```shell |
| 9 | +mise install |
| 10 | +mise run sync |
| 11 | +``` |
| 12 | + |
| 13 | +mise reads the Python version from `.python-version`, and uv manages the |
| 14 | +virtual environment. `mise tasks` lists every task. The ones you need most: |
| 15 | + |
| 16 | +| Task | What it does | |
| 17 | +|------|--------------| |
| 18 | +| `mise run ci` | Everything CI runs: checks, unit tests, build | |
| 19 | +| `mise run check` | Format check, lint, type check, proto check, conformance check | |
| 20 | +| `mise run format` | Format the code | |
| 21 | +| `mise run test` | Unit tests; `UV_PYTHON=3.11` picks the interpreter | |
| 22 | +| `mise run build` | Build the wheel and sdist, verify them, and install them on Python 3.11 | |
| 23 | +| `mise run proto:gen` | Regenerate the bindings from core at the pinned ref | |
| 24 | +| `mise run core:version` | Print the pinned core version | |
| 25 | + |
| 26 | +CI runs the unit tests on every Python version the package supports (3.11 to |
| 27 | +3.14). |
| 28 | + |
| 29 | +## Commits and pull requests |
| 30 | + |
| 31 | +- Use [Conventional Commits](https://www.conventionalcommits.org/): |
| 32 | + `<type>(<scope>): <description>`. |
| 33 | +- Sign off every commit (`git commit --signoff`) for the [Developer Certificate |
| 34 | + of Origin](https://developercertificate.org/). |
| 35 | +- Every change goes through a pull request with an approval from a code owner |
| 36 | + who did not push last. |
| 37 | +- New files need only the license line `SPDX-License-Identifier: Apache-2.0` |
| 38 | + in a comment. Keep the existing headers as they are. |
| 39 | + |
| 40 | +## Bindings and core versions |
| 41 | + |
| 42 | +The bindings in `src/openshell/_proto` are generated from core's `proto/` at one |
| 43 | +core ref, `OPENSHELL_CORE_REF` in `mise.toml`, and committed. Don't edit |
| 44 | +generated files; change the pin and run `mise run proto:gen`. |
| 45 | +`mise run proto:check` fails when the committed bindings don't match the pin. |
| 46 | + |
| 47 | +Shared test fixtures come from core's `sdk/conformance/` and are copied into |
| 48 | +`tests/fixtures/`. `mise run conformance:check` compares them with core at the |
| 49 | +pinned ref. |
| 50 | + |
| 51 | +## Releases |
| 52 | + |
| 53 | +SDK releases follow core releases: SDK `X.Y.Z` is built from core `vX.Y.Z`, and |
| 54 | +there are no SDK-only releases. To try unreleased changes, install from the |
| 55 | +repository: |
| 56 | + |
| 57 | +```shell |
| 58 | +pip install "openshell @ git+https://github.com/ai-openshell/sdk-python@main" |
| 59 | +``` |
0 commit comments