|
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 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. |
| 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. |
9 | 8 |
|
10 | 9 | min_version = { soft = "2026.9.9" } |
11 | 10 |
|
12 | 11 | [tools] |
13 | 12 | python = "3.14.5" |
14 | 13 | buf = "1.72.0" |
15 | 14 | uv = "0.10.12" |
16 | | -yq = "4.53.6" |
17 | 15 |
|
18 | 16 | [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 core release tag the bindings are pinned to" |
26 | | -run = "yq -r '.inputs[0].tag' buf.gen.yaml" |
| 25 | +description = "Print the pinned core ref" |
| 26 | +run = "echo $OPENSHELL_CORE_REF" |
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 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. |
| 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. |
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) |
42 | 39 | rm -rf proto |
43 | | -buf export "$(input git_repo)#tag=$(input tag),depth=$(input depth),subdir=$(input subdir)" \ |
44 | | - "${paths[@]}" --output 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 |
45 | 42 | """ |
46 | | -sources = ["buf.gen.yaml"] |
| 43 | +sources = ["mise.toml"] |
47 | 44 | outputs = ["proto/openshell.proto"] |
48 | 45 |
|
49 | 46 | [tasks."proto:gen"] |
|
65 | 62 | """ |
66 | 63 |
|
67 | 64 | [tasks."conformance:check"] |
68 | | -description = "Fail if vendored fixtures differ from core at the pinned tag" |
| 65 | +description = "Fail if vendored fixtures differ from core at the pinned ref" |
69 | 66 | run = """ |
70 | 67 | #!/usr/bin/env bash |
71 | 68 | set -euo pipefail |
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" |
| 69 | +core=$(mktemp -d) |
| 70 | +trap 'rm -rf "$core"' EXIT |
| 71 | +scripts/fetch-core.sh "$OPENSHELL_CORE_REF" "$core" sdk/conformance |
76 | 72 | for fixture in oauth-client-credentials.json oauth-client-credentials.json.license; do |
77 | | - curl -fsSL "$BASE/$fixture" | diff -u - "tests/fixtures/$fixture" |
| 73 | + diff -u "$core/sdk/conformance/$fixture" "tests/fixtures/$fixture" |
78 | 74 | done |
79 | 75 | """ |
80 | 76 |
|
|
0 commit comments