Skip to content

Commit 17e6964

Browse files
docs: Python version setup guide for contributors (#161)
Co-authored-by: Elias Derby <eliasderby90@gmail.com>
1 parent e808a0e commit 17e6964

2 files changed

Lines changed: 25 additions & 4 deletions

File tree

‎.python-version‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

‎CONTRIBUTING.md‎

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,38 @@ Prerequisites:
6565
pipeline step in a container, and the integration tests do too. On Linux,
6666
the layer-caching snapshotter also needs FUSE's `user_allow_other` enabled
6767
in `/etc/fuse.conf`.
68-
- **Python 3.11+** and [uv](https://docs.astral.sh/uv/) — for the `harmont`
68+
- **Python 3.12** and [uv](https://docs.astral.sh/uv/) — for the `harmont`
6969
pipeline DSL that lives in `crates/hm-dsl-engine/harmont-py/`. Linting is
70-
pinned to **ruff 0.15** in CI.
70+
pinned to **ruff 0.15** in CI. See [Python setup](#python-setup) below.
7171

7272
Build everything from the workspace root:
7373

7474
```sh
7575
cargo build
7676
```
7777

78-
Run your freshly built CLI against a real project — the `examples/`
79-
directory has fourteen runnable projects to try it on:
78+
### Python setup
79+
80+
The `hm` CLI shells out to `python3` to evaluate `.hm/*.py` pipeline files.
81+
If your system `python3` is older than 3.12, pipeline runs will fail. The
82+
repo pins Python 3.12 in `.python-version`; the one-time setup is:
83+
84+
```sh
85+
uv venv # creates .venv/ with Python 3.12 (downloads it if needed)
86+
source .venv/bin/activate # puts the right python3 on PATH
87+
```
88+
89+
After activating, `python3 --version` should report 3.12.x. You can add
90+
`source /path/to/harmont-cli/.venv/bin/activate` to your shell profile or
91+
use [direnv](https://direnv.net/) to activate automatically.
92+
93+
> **Why not the venv inside `harmont-py/`?** That venv is for developing the
94+
> Python SDK itself (running pytest, ruff, ty). The top-level venv exists
95+
> solely to put the right `python3` on your PATH — no packages need to be
96+
> installed in it.
97+
98+
With the venv active, run your freshly built CLI against a real project —
99+
the `examples/` directory has fourteen runnable projects to try it on:
80100

81101
```sh
82102
cargo run -p harmont-cli -- run ci --backend docker --dir examples/rust

0 commit comments

Comments
 (0)