|
2 | 2 | # SPDX-License-Identifier: Apache-2.0 |
3 | 3 |
|
4 | 4 | # Python SDK tasks. Run `mise tasks` to list them and `mise run ci` for the |
5 | | -# full pipeline. Bindings are generated from core's proto/ at the ref pinned in |
6 | | -# OPENSHELL_CORE_REF and committed under src/openshell/_proto, so building the |
7 | | -# package needs no core checkout and no network. |
| 5 | +# full pipeline. Bindings are generated from core's proto/ at the release tag |
| 6 | +# pinned in buf.gen.yaml (inputs[0].tag) and committed under |
| 7 | +# src/openshell/_proto, so building the package needs no core checkout and no |
| 8 | +# network. |
8 | 9 |
|
9 | 10 | min_version = { soft = "2026.9.9" } |
10 | 11 |
|
11 | 12 | [tools] |
12 | 13 | python = "3.14.5" |
13 | 14 | buf = "1.72.0" |
14 | 15 | uv = "0.10.12" |
| 16 | +yq = "4.53.6" |
15 | 17 |
|
16 | 18 | [env] |
17 | | -# The single core pin: a release tag (or a full commit SHA). |
18 | | -OPENSHELL_CORE_REF = "v0.1.7" |
19 | 19 | SETUPTOOLS_SCM_PRETEND_VERSION_FOR_OPENSHELL = "0.0.0" |
20 | 20 |
|
21 | 21 | [vars] |
22 | 22 | python_paths = "src/ tests/ scripts/" |
23 | 23 |
|
24 | 24 | [tasks."core:version"] |
25 | | -description = "Print the pinned core ref" |
26 | | -run = "echo $OPENSHELL_CORE_REF" |
| 25 | +description = "Print the core release tag the bindings are pinned to" |
| 26 | +run = "yq -r '.inputs[0].tag' buf.gen.yaml" |
27 | 27 |
|
28 | 28 | [tasks.sync] |
29 | 29 | description = "Install the SDK and its development dependencies" |
30 | 30 | run = "uv sync --frozen --group dev" |
31 | 31 |
|
32 | 32 | [tasks."proto:fetch"] |
33 | | -description = "Export the SDK's protos from core at the pinned ref into proto/" |
34 | | -# buf follows the imports of the two root files, so proto/ holds exactly the |
35 | | -# files the SDK compiles. |
| 33 | +description = "Export the SDK's protos from core at the pinned tag into proto/" |
| 34 | +# buf follows the imports of the files in inputs[0].paths, so proto/ holds |
| 35 | +# exactly the files the SDK compiles. |
36 | 36 | run = """ |
37 | 37 | #!/usr/bin/env bash |
38 | 38 | set -euo pipefail |
| 39 | +input() { yq -r ".inputs[0].$1" buf.gen.yaml; } |
| 40 | +paths=() |
| 41 | +while read -r path; do paths+=(--path "$path"); done < <(yq -r '.inputs[0].paths[]' buf.gen.yaml) |
39 | 42 | rm -rf proto |
40 | | -buf export "https://github.com/NVIDIA/OpenShell.git#ref=${OPENSHELL_CORE_REF},depth=1,subdir=proto" \ |
41 | | - --path openshell.proto --path credential_driver.proto --output proto |
| 43 | +buf export "$(input git_repo)#tag=$(input tag),depth=$(input depth),subdir=$(input subdir)" \ |
| 44 | + "${paths[@]}" --output proto |
42 | 45 | """ |
43 | | -sources = ["mise.toml"] |
| 46 | +sources = ["buf.gen.yaml"] |
44 | 47 | outputs = ["proto/openshell.proto"] |
45 | 48 |
|
46 | 49 | [tasks."proto:gen"] |
|
62 | 65 | """ |
63 | 66 |
|
64 | 67 | [tasks."conformance:check"] |
65 | | -description = "Fail if vendored fixtures differ from core at the pinned ref" |
| 68 | +description = "Fail if vendored fixtures differ from core at the pinned tag" |
66 | 69 | run = """ |
67 | 70 | #!/usr/bin/env bash |
68 | 71 | set -euo pipefail |
69 | | -core=$(mktemp -d) |
70 | | -trap 'rm -rf "$core"' EXIT |
71 | | -scripts/fetch-core.sh "$OPENSHELL_CORE_REF" "$core" sdk/conformance |
| 72 | +# Shared cross-SDK fixtures live in core's sdk/conformance/. The copies in |
| 73 | +# tests/fixtures must match core at the pinned tag. |
| 74 | +TAG=$(yq -r '.inputs[0].tag' buf.gen.yaml) |
| 75 | +BASE="https://raw.githubusercontent.com/NVIDIA/OpenShell/$TAG/sdk/conformance" |
72 | 76 | for fixture in oauth-client-credentials.json oauth-client-credentials.json.license; do |
73 | | - diff -u "$core/sdk/conformance/$fixture" "tests/fixtures/$fixture" |
| 77 | + curl -fsSL "$BASE/$fixture" | diff -u - "tests/fixtures/$fixture" |
74 | 78 | done |
75 | 79 | """ |
76 | 80 |
|
|
0 commit comments