From ebeab1aac0b3cc3e83517f99fa8f6045a0a76416 Mon Sep 17 00:00:00 2001 From: Yves Brissaud Date: Tue, 10 Nov 2026 12:10:39 +0100 Subject: [PATCH 1/3] python-sdk: read pyproject.toml in Dang The pyproject helper built a Go container for every read of a pyproject.toml. Read the file with TOML.decode instead: requires-python, use-uv, base-image, global-client, the workspace members and the generated marker, and the Python floor refusal, which now takes the floor from sdk/pyproject.toml instead of a copy of it. A value of another type than the one read stays unset, and a marker that does not parse reads as no marker, as before. The set-* commands stay in Go: TOML.encode does not write the bytes go-toml writes (quoting, indentation, trailing newline, datetimes), so moving them would change every file they edit. Signed-off-by: Yves Brissaud --- .dagger/modules/e2e/main.dang | 9 ++ helpers/pyproject/main.go | 60 +--------- helpers/pyproject/main_test.go | 65 ---------- helpers/pyproject/members.go | 59 --------- helpers/pyproject/members_test.go | 68 ----------- helpers/pyproject/pyproject.go | 48 -------- helpers/pyproject/pyproject_test.go | 61 +--------- helpers/pyproject/python.go | 102 ---------------- helpers/pyproject/python_test.go | 122 ------------------- mod-config.dang | 50 ++------ mod.dang | 5 +- python-sdk.dang | 4 +- scope.dang | 179 ++++++++++++++++++++-------- 13 files changed, 163 insertions(+), 669 deletions(-) delete mode 100644 helpers/pyproject/members.go delete mode 100644 helpers/pyproject/members_test.go delete mode 100644 helpers/pyproject/python.go delete mode 100644 helpers/pyproject/python_test.go diff --git a/.dagger/modules/e2e/main.dang b/.dagger/modules/e2e/main.dang index e97203af..0a017867 100644 --- a/.dagger/modules/e2e/main.dang +++ b/.dagger/modules/e2e/main.dang @@ -833,6 +833,7 @@ type E2e { .withNewFile("/" + scope + "/tools/mine/pyproject.toml", "[project]\nname = \"mine\"\n") .withNewFile("/" + scope + "/clients/tools/pyproject.toml", "[project]\nname = \"tools\"\n") .withNewFile("/" + scope + "/clients/notes/README.md", "not a member\n") + .withNewFile("/" + scope + "/clients/README.md", "not a member either\n") .withNewFile("/" + scope + "/clients/handmade/pyproject.toml", "[project]\nname = \"handmade\"\ndescription = \"\"\"\n[tool.dagger]\ngenerated = \"client\"\n\"\"\"\n") .withNewFile("/" + scope + "/clients/handmade/secret.txt", "mine\n") # A marker that cannot be read never licenses a delete. @@ -865,6 +866,9 @@ type E2e { null } assert(removed.directory("/" + scope).exists(clientDepMember) == false, "a removed client's member was left behind") + let aliased = generated.withDirectory("/" + scope + "/clients", directory.withSymlink("client-dep", "alias")).withWorkdir(scope) + let aliasKept = pythonSdk.generateScope(aliased, isModule: false, name: "user-content", clients: []).withWorkdir(".") + assert(aliasKept.directory("/" + scope).exists("clients/alias", expectedType: ExistsType.SYMLINK_TYPE, doNotFollowSymlinks: true), "a symlink under clients/ was taken for the generated client it points to") let removedFile = removed.file("/" + scope + "/pyproject.toml").contents assertNotContains(removedFile, "\"" + clientDepMember + "\"", "a removed client stayed a workspace member") assertContains(removedFile, "\"clients/tools\"", "removing a client dropped the user's member under clients/") @@ -2219,6 +2223,11 @@ type E2e { let pyproj = configModulePath + "/pyproject.toml" + let mistypedToml = "[project]\nrequires-python = \" ~= 3.12 \"\n\n[tool.dagger]\nuse-uv = \"false\"\nbase-image = 3\nglobal-client = [true]\n" + let mistyped = pythonSdk.mod(ws.withNewFile("/" + pyproj, mistypedToml), path: configModulePath).config.get + assert(mistyped.pythonVersion == "3.12", "pythonVersion should read without its operator, got " + (mistyped.pythonVersion ?? "null")) + assert(mistyped.useUv == null and mistyped.baseImage == null and mistyped.globalClient == null, "a mistyped setting should read as unset") + let py = app.set(pythonVersion: "3.13") assert(contains(py.modifiedPaths, pyproj), "set should modify pyproject.toml") assert(py.modifiedPaths.length == 1, "set modified more than pyproject.toml") diff --git a/helpers/pyproject/main.go b/helpers/pyproject/main.go index f815d01a..14c26879 100644 --- a/helpers/pyproject/main.go +++ b/helpers/pyproject/main.go @@ -15,36 +15,21 @@ func main() { } } -// run dispatches a subcommand. get-* commands print to stdout (no trailing -// newline). set-* commands edit the file in place and re-emit it. -// edit-scope and set-global-client edit the file in place and keep its -// formatting: they touch a scope file that generation also owns. -// -// get-member-kinds takes a scope directory instead of a file, and -// python-refusal a module directory. +// run dispatches a subcommand. set-* commands edit the file in place and +// re-emit it. edit-scope and set-global-client edit the file in place and keep +// its formatting: they touch a scope file that generation also owns. // // derive-resources takes a directory of pyproject.toml files at their // workspace paths and a module directory in it, and prints as JSON the paths // the module's build reads outside the module directory, each relative to the // module directory ("pattern") and to the workspace root ("rooted"). // -// get-generated prints nothing for a file that does not parse: such a file is -// no member of the SDK's, which is all its callers ask. -// // usage: pyproject [value | flags] func run(args []string) error { if len(args) < 2 { return fmt.Errorf("usage: pyproject [value | flags]") } cmd, path := args[0], args[1] - if cmd == "get-member-kinds" { - out, err := memberKinds(path) - if err != nil { - return err - } - fmt.Print(out) - return nil - } if cmd == "derive-resources" { module, err := value(args) if err != nil { @@ -61,14 +46,6 @@ func run(args []string) error { fmt.Print(string(out)) return nil } - if cmd == "python-refusal" { - out, err := pythonRefusal(path) - if err != nil { - return err - } - fmt.Print(out) - return nil - } data, err := os.ReadFile(path) if err != nil { @@ -79,9 +56,6 @@ func run(args []string) error { return runEditScope(path, data, args[2:]) case "set-global-client": return runSetGlobalClient(path, data, args) - case "get-generated": - fmt.Print(generatedKind(data)) - return nil } doc, err := load(data) if err != nil { @@ -89,27 +63,6 @@ func run(args []string) error { } switch cmd { - case "get-python-version": - fmt.Print(getPythonVersion(doc)) - return nil - case "get-use-uv": - // Print nothing when unset so callers can tell an absent setting from - // an explicit value, instead of guessing the true default. - if v, ok := getUseUv(doc); ok { - fmt.Print(boolStr(v)) - } - return nil - case "get-base-image": - fmt.Print(getBaseImage(doc)) - return nil - case "get-members": - fmt.Print(getMembers(doc)) - return nil - case "get-global-client": - if v, ok := getGlobalClient(doc); ok { - fmt.Print(boolStr(v)) - } - return nil case "set-python-version": v, err := value(args) if err != nil { @@ -215,10 +168,3 @@ func value(args []string) (string, error) { } return args[2], nil } - -func boolStr(b bool) string { - if b { - return "true" - } - return "false" -} diff --git a/helpers/pyproject/main_test.go b/helpers/pyproject/main_test.go index f62cd7c3..bd50377e 100644 --- a/helpers/pyproject/main_test.go +++ b/helpers/pyproject/main_test.go @@ -33,24 +33,6 @@ func TestRunSetThenGet(t *testing.T) { } } -func TestRunGetDoesNotWrite(t *testing.T) { - p := writeTemp(t, sample) - before, err := os.ReadFile(p) - if err != nil { - t.Fatalf("read: %v", err) - } - if err := run([]string{"get-python-version", p}); err != nil { - t.Fatalf("get: %v", err) - } - after, err := os.ReadFile(p) - if err != nil { - t.Fatalf("read: %v", err) - } - if string(before) != string(after) { - t.Errorf("get-* must not modify the file:\nbefore:\n%s\nafter:\n%s", before, after) - } -} - func TestRunUnknownCommand(t *testing.T) { p := writeTemp(t, sample) if err := run([]string{"bogus", p}); err == nil { @@ -215,50 +197,3 @@ func printed(t *testing.T, args ...string) string { } return string(out) } - -func TestRunGetGenerated(t *testing.T) { - for name, tc := range map[string]struct { - src string - want string - }{ - "marked": {"[project]\nname = \"dagger-clients-linter\"\n\n[tool.dagger]\ngenerated = \"client\"\n", "client"}, - "not marked": {sample, ""}, - "inside a multiline string": {`[project] -name = "notes" -description = """ -[tool.dagger] -generated = "client" -""" -`, ""}, - "unparsable": {"[tool.dagger]\ngenerated = \"client\"\n[tool.dagger]\n", ""}, - } { - t.Run(name, func(t *testing.T) { - if got := printed(t, "get-generated", writeTemp(t, tc.src)); got != tc.want { - t.Errorf("got %q, want %q", got, tc.want) - } - }) - } -} - -func TestRunGetGlobalClientReadsTheFlagAsTOML(t *testing.T) { - for name, tc := range map[string]struct { - src string - want string - }{ - "set": {"[tool.dagger]\nglobal-client = true\n", "true"}, - "unset": {sample, ""}, - "inside a multiline string": {`[project] -name = "notes" -description = """ -[tool.dagger] -global-client = true -""" -`, ""}, - } { - t.Run(name, func(t *testing.T) { - if got := printed(t, "get-global-client", writeTemp(t, tc.src)); got != tc.want { - t.Errorf("got %q, want %q", got, tc.want) - } - }) - } -} diff --git a/helpers/pyproject/members.go b/helpers/pyproject/members.go deleted file mode 100644 index e307edcc..00000000 --- a/helpers/pyproject/members.go +++ /dev/null @@ -1,59 +0,0 @@ -package main - -import ( - "fmt" - "os" - "path/filepath" - "sort" - "strings" -) - -// generatedKinds are the values of [tool.dagger] generated the SDK writes. A -// member marked with anything else is a file the SDK does not understand, so -// it is never the SDK's to delete or to write over. -var generatedKinds = map[string]bool{"client": true, "core": true, "runtime": true} - -// generatedKind reads the marker of a member's pyproject.toml as TOML: a -// string that merely looks like the table is not the table. Empty when the -// file does not parse, has no marker, or has one of an unknown kind. -func generatedKind(data []byte) string { - doc, err := load(data) - if err != nil { - return "" - } - kind, _ := table(table(doc, "tool"), "dagger")["generated"].(string) - if !generatedKinds[kind] { - return "" - } - return kind -} - -// memberKinds lists the members of a scope that carry a known marker, one -// " " line each: sdk/ and every directory under clients/. -func memberKinds(scope string) (string, error) { - candidates := []string{"sdk"} - entries, err := os.ReadDir(filepath.Join(scope, "clients")) - if err != nil && !os.IsNotExist(err) { - return "", err - } - for _, e := range entries { - if e.IsDir() { - candidates = append(candidates, "clients/"+e.Name()) - } - } - sort.Strings(candidates) - var out strings.Builder - for _, member := range candidates { - data, err := os.ReadFile(filepath.Join(scope, member, "pyproject.toml")) - if err != nil { - if os.IsNotExist(err) { - continue - } - return "", err - } - if kind := generatedKind(data); kind != "" { - fmt.Fprintf(&out, "%s %s\n", member, kind) - } - } - return out.String(), nil -} diff --git a/helpers/pyproject/members_test.go b/helpers/pyproject/members_test.go deleted file mode 100644 index 5e91b795..00000000 --- a/helpers/pyproject/members_test.go +++ /dev/null @@ -1,68 +0,0 @@ -package main - -import ( - "os" - "path/filepath" - "testing" -) - -func TestGeneratedKindReadsTheMarkerAsTOML(t *testing.T) { - for name, tc := range map[string]struct { - src string - want string - }{ - "client": {"[project]\nname = \"x\"\n\n[tool.dagger]\ngenerated = \"client\"\n", "client"}, - "core": {"[tool.dagger]\ngenerated = 'core'\n", "core"}, - "runtime": {"[tool.dagger] # the SDK files\ngenerated = \"runtime\"\n", "runtime"}, - "dotted": {"tool.dagger.generated = \"client\"\n", "client"}, - "none": {"[project]\nname = \"x\"\n", ""}, - "unknown kind": {"[tool.dagger]\ngenerated = \"hand-written\"\n", ""}, - "not a string": {"[tool.dagger]\ngenerated = true\n", ""}, - "unparsable": {"[tool.dagger]\ngenerated = \"client\"\n[tool.dagger]\n", ""}, - "inside a multiline string": {`[project] -name = "handmade" -description = """ -[tool.dagger] -generated = "client" -""" -`, ""}, - } { - t.Run(name, func(t *testing.T) { - if got := generatedKind([]byte(tc.src)); got != tc.want { - t.Errorf("got %q, want %q", got, tc.want) - } - }) - } -} - -func TestRunGetMemberKinds(t *testing.T) { - scope := t.TempDir() - write := func(rel, contents string) { - p := filepath.Join(scope, rel) - if err := os.MkdirAll(filepath.Dir(p), 0o755); err != nil { - t.Fatal(err) - } - if err := os.WriteFile(p, []byte(contents), 0o644); err != nil { - t.Fatal(err) - } - } - write("sdk/pyproject.toml", "[tool.dagger]\ngenerated = \"runtime\"\n") - write("clients/core/pyproject.toml", "[tool.dagger]\ngenerated = \"core\"\n") - write("clients/linter/pyproject.toml", "[tool.dagger]\ngenerated = \"client\"\n") - write("clients/handmade/pyproject.toml", "description = \"\"\"\n[tool.dagger]\ngenerated = \"client\"\n\"\"\"\n") - write("clients/odd/pyproject.toml", "[tool.dagger]\ngenerated = \"hand-written\"\n") - write("clients/notes/README.md", "no project\n") - - got, err := memberKinds(scope) - if err != nil { - t.Fatal(err) - } - want := "clients/core core\nclients/linter client\nsdk runtime\n" - if got != want { - t.Errorf("got:\n%s\nwant:\n%s", got, want) - } - - if got, err := memberKinds(t.TempDir()); err != nil || got != "" { - t.Errorf("an empty scope: got %q, %v", got, err) - } -} diff --git a/helpers/pyproject/pyproject.go b/helpers/pyproject/pyproject.go index 9c5aaf0c..27be5119 100644 --- a/helpers/pyproject/pyproject.go +++ b/helpers/pyproject/pyproject.go @@ -42,54 +42,6 @@ func ensureTable(doc map[string]any, key string) map[string]any { return t } -// getPythonVersion returns the version from a single requires-python specifier, -// stripping a leading comparison operator (e.g. ">=3.14" -> "3.14"). It assumes -// the simple form this SDK writes; a multi-clause range is returned as-is after -// the leading operator. -func getPythonVersion(doc map[string]any) string { - rp, _ := table(doc, "project")["requires-python"].(string) - rp = strings.TrimSpace(rp) - for _, op := range []string{">=", "<=", "==", "!=", "~=", ">", "<"} { - if strings.HasPrefix(rp, op) { - return strings.TrimSpace(strings.TrimPrefix(rp, op)) - } - } - return rp -} - -// getUseUv reports the [tool.dagger].use-uv setting and whether it was set at -// all. Reporting unset (ok == false) lets callers distinguish "not configured" -// from an explicit choice instead of guessing the uv default. -func getUseUv(doc map[string]any) (value bool, ok bool) { - value, ok = table(table(doc, "tool"), "dagger")["use-uv"].(bool) - return value, ok -} - -// getMembers lists the [tool.uv.workspace] members uv reads, one a line. -// What is not a string, such as a nested array, is not a member. -func getMembers(doc map[string]any) string { - members, _ := table(table(table(doc, "tool"), "uv"), "workspace")["members"].([]any) - var out strings.Builder - for _, m := range members { - if s, ok := m.(string); ok { - out.WriteString(s + "\n") - } - } - return out.String() -} - -// getGlobalClient reports the [tool.dagger].global-client flag and whether it -// was set at all, like getUseUv. -func getGlobalClient(doc map[string]any) (value bool, ok bool) { - value, ok = table(table(doc, "tool"), "dagger")["global-client"].(bool) - return value, ok -} - -func getBaseImage(doc map[string]any) string { - s, _ := table(table(doc, "tool"), "dagger")["base-image"].(string) - return s -} - func setPythonVersion(doc map[string]any, v string) { ensureTable(doc, "project")["requires-python"] = ">=" + v } diff --git a/helpers/pyproject/pyproject_test.go b/helpers/pyproject/pyproject_test.go index e5f3cad4..7a99fcac 100644 --- a/helpers/pyproject/pyproject_test.go +++ b/helpers/pyproject/pyproject_test.go @@ -36,36 +36,6 @@ func mustLoad(t *testing.T, s string) map[string]any { return doc } -func TestGetPythonVersion(t *testing.T) { - if got := getPythonVersion(mustLoad(t, sample)); got != "3.14" { - t.Errorf("sample: got %q, want 3.14", got) - } - if got := getPythonVersion(mustLoad(t, configured)); got != "3.12" { - t.Errorf("configured: got %q, want 3.12", got) - } - if got := getPythonVersion(mustLoad(t, "")); got != "" { - t.Errorf("empty: got %q, want \"\"", got) - } -} - -func TestGetUseUv(t *testing.T) { - if _, ok := getUseUv(mustLoad(t, sample)); ok { - t.Error("sample: use-uv should report unset when absent") - } - if v, ok := getUseUv(mustLoad(t, configured)); !ok || v { - t.Errorf("configured: use-uv should report set and false, got value=%v ok=%v", v, ok) - } -} - -func TestGetBaseImage(t *testing.T) { - if got := getBaseImage(mustLoad(t, sample)); got != "" { - t.Errorf("sample: got %q, want \"\"", got) - } - if got := getBaseImage(mustLoad(t, configured)); got != "python:3.12-slim" { - t.Errorf("configured: got %q, want python:3.12-slim", got) - } -} - func TestSetPythonVersionPreservesData(t *testing.T) { doc := mustLoad(t, sample) setPythonVersion(doc, "3.13") @@ -97,11 +67,12 @@ func TestSetUseUvFalseWritesKey(t *testing.T) { func TestSetUseUvTrueRemovesKey(t *testing.T) { doc := mustLoad(t, configured) setUseUv(doc, true) - if _, ok := getUseUv(doc); ok { - t.Error("use-uv should report unset after reset to the default true") + dagger := table(table(doc, "tool"), "dagger") + if _, ok := dagger["use-uv"]; ok { + t.Error("use-uv should be unset after reset to the default true") } // removing use-uv must not drop the sibling base-image key. - if got := getBaseImage(doc); got != "python:3.12-slim" { + if got := dagger["base-image"]; got != "python:3.12-slim" { t.Errorf("setUseUv(true) clobbered base-image, got %q", got) } out, err := dump(doc) @@ -130,29 +101,7 @@ use-uv = false func TestSetBaseImage(t *testing.T) { doc := mustLoad(t, sample) setBaseImage(doc, "python:3.13-slim") - if got := getBaseImage(doc); got != "python:3.13-slim" { + if got := table(table(doc, "tool"), "dagger")["base-image"]; got != "python:3.13-slim" { t.Errorf("got %q", got) } } - -func TestGetGlobalClient(t *testing.T) { - if _, ok := getGlobalClient(mustLoad(t, sample)); ok { - t.Error("sample: global-client should report unset when absent") - } - doc := mustLoad(t, "[tool.dagger]\nglobal-client = true\nuse-uv = false\n") - if v, ok := getGlobalClient(doc); !ok || !v { - t.Errorf("should report set and true, got value=%v ok=%v", v, ok) - } -} - -func TestGetMembers(t *testing.T) { - doc := mustLoad(t, `["tool"."uv"."workspace"] -members = ["sdk", "clients/core", ["clients/unowned"]] -`) - if got := getMembers(doc); got != "sdk\nclients/core\n" { - t.Errorf("got %q", got) - } - if got := getMembers(mustLoad(t, sample)); got != "" { - t.Errorf("a file without a workspace: got %q", got) - } -} diff --git a/helpers/pyproject/python.go b/helpers/pyproject/python.go deleted file mode 100644 index 926174fd..00000000 --- a/helpers/pyproject/python.go +++ /dev/null @@ -1,102 +0,0 @@ -package main - -import ( - "errors" - "fmt" - "io/fs" - "os" - "path/filepath" - "regexp" - "strconv" - "strings" -) - -// pythonFloor is the oldest Python the SDK runs on. A test holds it to the -// requires-python of sdk/pyproject.toml. -const pythonFloor = "3.11" - -// lastReleaseBelowPythonFloor is the last release of this SDK, whose floor -// was lastReleasePythonFloor. A refusal offers it only to a Python that -// release runs on, as engineRefusal in python-sdk.dang does for engines. -const ( - lastReleaseBelowPythonFloor = "v1.2.0" - lastReleasePythonFloor = "3.10" -) - -var pythonVersion = regexp.MustCompile(`^(\d+)(?:\.(\d+)(?:\.(\d+))?)?(a|b|rc|\.?dev)?`) - -// below reports whether v names a Python older than floor: an older major or -// minor, or a prerelease of the floor's first release. A version it cannot -// read is not below, so an unexpected format never blocks. -func below(v, floor string) bool { - m := pythonVersion.FindStringSubmatch(v) - if m == nil { - return false - } - f := pythonVersion.FindStringSubmatch(floor) - major, floorMajor := atoi(m[1]), atoi(f[1]) - if major != floorMajor || m[2] == "" { - return major < floorMajor - } - minor, floorMinor := atoi(m[2]), atoi(f[2]) - if minor != floorMinor { - return minor < floorMinor - } - return m[4] != "" && (m[3] == "" || m[3] == "0") -} - -func atoi(s string) int { - n, _ := strconv.Atoi(s) - return n -} - -// pythonRefusal says why the module in dir cannot run this SDK, or returns "" -// when it can. uv locks the module to the SDK's floor, but the runtime builds -// it on the Python the module asks for, where the install then fails. -// -// The Python is read the way baseImageFor and pythonVersionFor in -// runtime/build.dang pick the base image; keep them in step. -func pythonRefusal(dir string) (string, error) { - data, err := os.ReadFile(filepath.Join(dir, "pyproject.toml")) - if err != nil && !errors.Is(err, fs.ErrNotExist) { - return "", err - } - doc, err := load(data) - if err != nil { - return "", err - } - if getBaseImage(doc) != "" { - return "", nil - } - - pin, err := os.ReadFile(filepath.Join(dir, ".python-version")) - if err == nil { - v := strings.TrimSpace(string(pin)) - if !below(v, pythonFloor) { - return "", nil - } - return fmt.Sprintf("this Python SDK needs Python %s or later, and .python-version pins Python %s. %s", pythonFloor, v, remedy("Set it to Python "+pythonFloor+" or later", v)), nil - } - if !errors.Is(err, fs.ErrNotExist) { - return "", err - } - - rp, _ := table(doc, "project")["requires-python"].(string) - rp = strings.TrimSpace(rp) - for _, op := range []string{">=", "=="} { - v, ok := strings.CutPrefix(rp, op) - lowest, _, _ := strings.Cut(v, ",") - lowest = strings.TrimSpace(lowest) - if ok && below(lowest, pythonFloor) { - return fmt.Sprintf("this Python SDK needs Python %s or later, and requires-python = %q asks for Python %s. %s", pythonFloor, rp, lowest, remedy("Ask for Python "+pythonFloor+" or later", lowest)), nil - } - } - return "", nil -} - -func remedy(fix, v string) string { - if below(v, lastReleasePythonFloor) { - return fix - } - return fix + ", or pin the last release of this SDK that runs on it: dagger module install github.com/dagger/python-sdk@" + lastReleaseBelowPythonFloor -} diff --git a/helpers/pyproject/python_test.go b/helpers/pyproject/python_test.go deleted file mode 100644 index 81f6e42d..00000000 --- a/helpers/pyproject/python_test.go +++ /dev/null @@ -1,122 +0,0 @@ -package main - -import ( - "os" - "path/filepath" - "strings" - "testing" -) - -func TestPythonFloorIsTheSDKs(t *testing.T) { - data, err := os.ReadFile(filepath.Join("..", "..", "sdk", "pyproject.toml")) - if err != nil { - t.Fatal(err) - } - doc, err := load(data) - if err != nil { - t.Fatal(err) - } - if got := table(doc, "project")["requires-python"]; got != ">="+pythonFloor { - t.Errorf("sdk/pyproject.toml requires-python is %q, pythonFloor is %q", got, pythonFloor) - } -} - -func TestBelowPythonFloor(t *testing.T) { - for v, want := range map[string]bool{ - "3.10": true, - "3.10.9": true, - "2.7": true, - "2": true, - "3.11.0rc1": true, - "3.11rc1": true, - "3.11.dev0": true, - "3.11": false, - "3.11.0": false, - "3.11.1rc1": false, - "3.12": false, - "3.13.0b2": false, - "3": false, - "4": false, - "pypy3.10": false, - "": false, - } { - if got := below(v, pythonFloor); got != want { - t.Errorf("below(%q, %q) = %v, want %v", v, pythonFloor, got, want) - } - } -} - -func moduleDir(t *testing.T, files map[string]string) string { - t.Helper() - dir := t.TempDir() - for name, contents := range files { - if err := os.WriteFile(filepath.Join(dir, name), []byte(contents), 0o644); err != nil { - t.Fatal(err) - } - } - return dir -} - -func TestPythonRefusal(t *testing.T) { - project := func(requires string) string { - return "[project]\nname = \"app\"\nrequires-python = \"" + requires + "\"\n" - } - for name, tc := range map[string]struct { - files map[string]string - want string - }{ - "floor": {map[string]string{"pyproject.toml": project(">=3.11")}, ""}, - "newer": {map[string]string{"pyproject.toml": project(">=3.14")}, ""}, - "older floor": {map[string]string{"pyproject.toml": project(">=3.10")}, `this Python SDK needs Python 3.11 or later, and requires-python = ">=3.10" asks for Python 3.10. Ask for Python 3.11 or later, or pin the last release of this SDK that runs on it: dagger module install github.com/dagger/python-sdk@v1.2.0`}, - "older range": {map[string]string{"pyproject.toml": project(">=3.10,<4")}, "asks for Python 3.10."}, - "older exact": {map[string]string{"pyproject.toml": project("==3.10.4")}, "asks for Python 3.10.4."}, - "another major": {map[string]string{"pyproject.toml": project(">=2.7")}, "asks for Python 2.7."}, - "older major only": {map[string]string{"pyproject.toml": project(">=2")}, "asks for Python 2."}, - "range the runtime ignores": {map[string]string{"pyproject.toml": project("~=3.10")}, ""}, - "no requires-python": {map[string]string{"pyproject.toml": "[project]\nname = \"app\"\n"}, ""}, - "no pyproject.toml": {map[string]string{}, ""}, - "older pin": { - map[string]string{".python-version": "3.10.9\n", "pyproject.toml": project(">=3.14")}, - "this Python SDK needs Python 3.11 or later, and .python-version pins Python 3.10.9. Set it to Python 3.11 or later, or pin the last release", - }, - "pin over requires-python": {map[string]string{".python-version": "3.13\n", "pyproject.toml": project(">=3.10")}, ""}, - "base image over requires-python": { - map[string]string{"pyproject.toml": project(">=3.10") + "\n[tool.dagger]\nbase-image = \"python:3.14-slim\"\n"}, - "", - }, - "base image over pin": { - map[string]string{".python-version": "3.10\n", "pyproject.toml": "[tool.dagger]\nbase-image = \"python:3.14-slim\"\n"}, - "", - }, - "unreadable pin": {map[string]string{".python-version": "pypy3.10\n"}, ""}, - } { - t.Run(name, func(t *testing.T) { - got, err := pythonRefusal(moduleDir(t, tc.files)) - if err != nil { - t.Fatal(err) - } - if tc.want == "" && got != "" || !strings.Contains(got, tc.want) { - t.Errorf("got %q, want %q", got, tc.want) - } - }) - } -} - -func TestPythonRefusalOffersTheLastReleaseOnlyWhereItRuns(t *testing.T) { - for requires, offered := range map[string]bool{">=3.10": true, ">=3.9": false, ">=2.7": false} { - got, err := pythonRefusal(moduleDir(t, map[string]string{"pyproject.toml": "[project]\nrequires-python = \"" + requires + "\"\n"})) - if err != nil { - t.Fatal(err) - } - if strings.Contains(got, "python-sdk@v1.2.0") != offered { - t.Errorf("%s: got %q, want the last release offered: %v", requires, got, offered) - } - } -} - -func TestRunPythonRefusalTakesADirectory(t *testing.T) { - dir := moduleDir(t, map[string]string{"pyproject.toml": "[project]\nrequires-python = \">=3.10\"\n"}) - if got := printed(t, "python-refusal", dir); !strings.Contains(got, "needs Python 3.11 or later") { - t.Errorf("got %q", got) - } -} diff --git a/mod-config.dang b/mod-config.dang index 48de9d4a..94ddd0a3 100644 --- a/mod-config.dang +++ b/mod-config.dang @@ -58,11 +58,14 @@ type ModConfig { null rather than guessed. """ pub get: ModConfigValues! { + let pyproject = PyprojectToml(ws.file("/" + pyprojectPath).contents) + let pythonVersion = pyproject.pythonVersion + let baseImage = pyproject.baseImage ModConfigValues( - pythonVersion: readPythonVersion, - useUv: readUseUv, - baseImage: readBaseImage, - globalClient: readGlobalClient, + pythonVersion: if (pythonVersion == "") { null } else { pythonVersion }, + useUv: pyproject.useUv, + baseImage: if (baseImage == "") { null } else { baseImage }, + globalClient: pyproject.globalClient, ) } @@ -98,52 +101,19 @@ type ModConfig { withImage } - let refusal = if (pythonVersion != null) { withGlobal.withExec(["pyproject", "python-refusal", toolDir]).stdout } else { "" } + let edited = withGlobal.file(toolPath).contents + let refusal = if (pythonVersion != null) { PyprojectToml(edited).pythonRefusal(null) } else { "" } if (refusal != "") { raise refusal + "." } - let edited = withGlobal.file(toolPath).contents ws.withNewFile("/" + pyprojectPath, edited).changes(ws) } - """ - The required Python version from requires-python, or null when unset. - """ - let readPythonVersion: String { - let value = tool.withExec(["pyproject", "get-python-version", toolPath]).stdout - if (value == "") { null } else { value } - } - - """ - Whether the module builds with uv, or null when unset. - """ - let readUseUv: Boolean { - let value = tool.withExec(["pyproject", "get-use-uv", toolPath]).stdout - if (value == "true") { true } else if (value == "false") { false } else { null } - } - - """ - The base container image override, or null when unset. - """ - let readBaseImage: String { - let value = tool.withExec(["pyproject", "get-base-image", toolPath]).stdout - if (value == "") { null } else { value } - } - - """ - Whether generation emits the global client, or null when unset. - """ - let readGlobalClient: Boolean { - let value = tool.withExec(["pyproject", "get-global-client", toolPath]).stdout - if (value == "true") { true } else if (value == "false") { false } else { null } - } - let pyprojectPath: String! { if (path == ".") { "pyproject.toml" } else { path + "/pyproject.toml" } } - let toolDir: String! = "/work" - let toolPath: String! = toolDir + "/pyproject.toml" + let toolPath: String! = "/work/pyproject.toml" """ Container with the pyproject helper built and the module's pyproject.toml diff --git a/mod.dang b/mod.dang index 19cf7a2c..99ac9c57 100644 --- a/mod.dang +++ b/mod.dang @@ -157,7 +157,10 @@ type Mod { generation runs it, and config set stays open to fix the module. """ let checkPython: Void { - let refusal = PyprojectHelper().pythonRefusal(ws.directory("/" + rootPath, include: ["pyproject.toml", ".python-version"])) + let files = ws.directory("/" + rootPath, include: ["pyproject.toml", ".python-version"]) + let toml = if (files.exists("pyproject.toml")) { files.file("pyproject.toml").contents } else { "" } + let pin = if (files.exists(".python-version")) { files.file(".python-version").contents } else { null } + let refusal = PyprojectToml(toml).pythonRefusal(pin) if (refusal != "") { raise "the module at " + rootPath + ": " + refusal + ", then run dagger generate again" } diff --git a/python-sdk.dang b/python-sdk.dang index 434b512a..5c1e972e 100644 --- a/python-sdk.dang +++ b/python-sdk.dang @@ -93,7 +93,7 @@ type PythonSdk { """ let isGeneratedMember(ws: Workspace!, scope: String!): Boolean! { scopeHasFile(ws, scope, "pyproject.toml") and - PyprojectHelper().generatedKind(ws.file("/" + scopePath(scope, "pyproject.toml"))) != "" + PyprojectToml(ws.file("/" + scopePath(scope, "pyproject.toml")).contents).generatedKind != "" } let parentPath(path: String!): String! { @@ -914,7 +914,7 @@ type PythonSdk { let withPy = if (pythonVersion == "") { built } else { built.withExec(["pyproject", "set-python-version", pyproj, pythonVersion]) } let withUv = if (useUv) { withPy } else { withPy.withExec(["pyproject", "set-use-uv", pyproj, "false"]) } let withImg = if (baseImage == "") { withUv } else { withUv.withExec(["pyproject", "set-base-image", pyproj, baseImage]) } - let refusal = withImg.withExec(["pyproject", "python-refusal", "/rendered"]).stdout + let refusal = PyprojectToml(withImg.file(pyproj).contents).pythonRefusal(null) if (refusal != "") { raise refusal + "." } else { withImg.directory("/rendered") } } } diff --git a/scope.dang b/scope.dang index 115ce15a..af94e5b4 100644 --- a/scope.dang +++ b/scope.dang @@ -94,12 +94,7 @@ type Scope { let read = pythonSdkRuntime.scopeMembers(file).join("\n") rescue { err: Error => "\n" + err.message } - let uvReads = PyprojectHelper().tool - .withFile(toolPath, file) - .withExec(["pyproject", "get-members", toolPath]) - .stdout - .split("\n") - .filter { line => line != "" } + let uvReads = PyprojectToml(file.contents).members let form = "Write members as an array of strings, not a nested array or other values, then run dagger generate again" # The runtime reads [project] dependencies with the members, and names # the key it refuses. @@ -180,7 +175,7 @@ type Scope { let globalClient: Boolean! { let existing = ws.directory(root, gitignore: true) let setting = if (existing.exists(scopeFileName)) { - PyprojectHelper().globalClientSetting(existing.file(scopeFileName)) + PyprojectToml(existing.file(scopeFileName).contents).globalClient } else { null } @@ -344,33 +339,17 @@ type Scope { """ What `[tool.dagger] generated` says in a member's pyproject.toml, or empty. - The helper reads it as TOML, so text that only looks like the marker, in a + It is read as TOML, so text that only looks like the marker, in a string, is not one; and only the kinds the SDK writes count, so a member marked with anything else is the user's, never deleted or written over. """ let generatedKind(existing: Directory!, rel: String!): String! { - let prefix = rel + " " - memberKinds(existing) - .filter { line => line.hasPrefix(prefix) } - .takeFirst(1) - .join("") - .trimPrefix(prefix) - } - - """ - One " " line for sdk/ and each directory under clients/ that - carries a known marker. - """ - let memberKinds(existing: Directory!): [String!]! { - PyprojectHelper().tool - .withDirectory("/scope", existing, include: [ - sdkDirName + "/" + scopeFileName, - clientsDirName + "/*/" + scopeFileName, - ]) - .withExec(["pyproject", "get-member-kinds", "/scope"]) - .stdout - .split("\n") - .filter { line => line != "" } + let file = rel + "/" + scopeFileName + if (existing.exists(rel, expectedType: ExistsType.DIRECTORY_TYPE, doNotFollowSymlinks: true) and existing.exists(file)) { + PyprojectToml(existing.file(file).contents).generatedKind + } else { + "" + } } """ @@ -801,14 +780,6 @@ type PyprojectHelper { .withExec(["go", "build", "-o", "/usr/local/bin/pyproject", "."]) } - """ - The kind a generated member's marker names, or empty for a file that is no - member of the SDK's. - """ - pub generatedKind(pyproject: File!): String! { - tool.withFile(path, pyproject).withExec(["pyproject", "get-generated", path]).stdout - } - """ What the build of the scope at a workspace path reads outside it, as uv follows the scope's pyproject.toml: its path sources, its workspace members, @@ -832,26 +803,136 @@ type PyprojectHelper { } } } +} + +"""A pyproject.toml read as TOML; a mistyped value reads as unset.""" +type PyprojectToml { + pub toml: String! + + new(toml: String! = "") { + self.toml = toml + self + } + + """requires-python without its comparison operator, as this SDK writes it.""" + pub pythonVersion: String! { + let spec = stringAt(["project", "requires-python"]).trimSpace + let op = [">=", "<=", "==", "!=", "~=", ">", "<"].filter { op => spec.hasPrefix(op) }.takeFirst(1).join("") + spec.trimPrefix(op).trimSpace + } + + pub useUv: Boolean { booleanAt(["tool", "dagger", "use-uv"]) } + + pub baseImage: String! { stringAt(["tool", "dagger", "base-image"]) } + + """A file that turns it off keeps it off whatever the module looks like.""" + pub globalClient: Boolean { booleanAt(["tool", "dagger", "global-client"]) } + + pub members: [String!]! { + let doc = config + let items = doc.field(["tool", "uv", "workspace", "members"]).asArray.{{contents}} rescue { err: Error => [] } + items.reduce([] :: [String!]!) { found, item => + found + ([json.withContents(item.contents).asString] rescue { err: Error => [] :: [String!]! }) + } + } + + """ + Empty for a file that does not parse or names a kind the SDK does not + write: such a member is the user's. + """ + pub generatedKind: String! { + let kind = stringAt(["tool", "dagger", "generated"]) rescue { err: Error => "" } + if (kind == "client" or kind == "core" or kind == "runtime") { kind } else { "" } + } """ - What a scope file says about the global client, or null when it says - nothing: a file that turns it off keeps it off whatever the module looks - like. + uv locks the module to the SDK's floor, but the runtime builds it on the + Python the module asks for, where the install then fails. The Python is + read the way runtime/build.dang picks the base image; keep them in step. """ - pub globalClientSetting(pyproject: File!): Boolean { - let value = tool.withFile(path, pyproject).withExec(["pyproject", "get-global-client", path]).stdout - if (value == "true") { true } else if (value == "false") { false } else { null } + pub pythonRefusal(pin: String): String! { + let floor = PyprojectToml(currentModule.source.file("sdk/pyproject.toml").contents).pythonVersion + if (baseImage != "") { + "" + } else if (pin != null) { + let v = pin.trimSpace + if (below(v, floor)) { + "this Python SDK needs Python " + floor + " or later, and .python-version pins Python " + v + ". " + + remedy("Set it to Python " + floor + " or later", v) + } else { + "" + } + } else { + let spec = stringAt(["project", "requires-python"]).trimSpace + let op = [">=", "=="].filter { op => spec.hasPrefix(op) }.takeFirst(1).join("") + let lowest = (spec.trimPrefix(op).split(",")[0] ?? "").trimSpace + if (op != "" and below(lowest, floor)) { + let quoted = "\"" + spec.replace("\\", "\\\\").replace("\"", "\\\"").replace("\n", "\\n").replace("\t", "\\t").replace("\r", "\\r") + "\"" + "this Python SDK needs Python " + floor + " or later, and requires-python = " + quoted + " asks for Python " + lowest + ". " + + remedy("Ask for Python " + floor + " or later", lowest) + } else { + "" + } + } + } + + """Offered only to a Python the last release runs on, as engineRefusal does for engines.""" + let lastReleaseBelowPythonFloor: String! = "v1.2.0" + let lastReleasePythonFloor: String! = "3.10" + + let remedy(fix: String!, v: String!): String! { + if (below(v, lastReleasePythonFloor)) { fix } else { fix + ", or pin the last release of this SDK that runs on it: dagger module install github.com/dagger/python-sdk@" + lastReleaseBelowPythonFloor } + } + + """A version it cannot read is not below, so an unexpected format never blocks.""" + let below(v: String!, floor: String!): Boolean! { + let pattern: Regexp! = "^(\\d+)(?:\\.(\\d+)(?:\\.(\\d+))?)?(a|b|rc|\\.?dev)?" + let m = v.match(pattern) + if (m == null) { + false + } else { + let parts = m.captures + let floorParts = floor.match(pattern).captures + let major = number(parts[0] ?? "") + let floorMajor = number(floorParts[0] ?? "") + if (major != floorMajor or (parts[1] ?? "") == "") { + major < floorMajor + } else { + let minor = number(parts[1] ?? "") + let floorMinor = number(floorParts[1] ?? "") + if (minor != floorMinor) { + minor < floorMinor + } else { + let patch = parts[2] ?? "" + (parts[3] ?? "") != "" and (patch == "" or patch == "0") + } + } + } + } + + let number(digits: String!): Int! { + let significant = digits.trimLeft("0") + JSON.decode(if (significant == "") { "0" } else { significant }) :: Int! } """ - Why a module directory asks for a Python older than this SDK runs on, or - empty when it does not. + A whitespace-only file is an empty document; a file that does not parse + raises here, outside the rescues of the reads. """ - pub pythonRefusal(module: Directory!): String! { - tool.withDirectory("/module", module).withExec(["pyproject", "python-refusal", "/module"]).stdout + let config: JSONValue! { + let contents = if (toml.trimSpace == "") { "{}" } else { JSON.encode(TOML.decode(toml)) } + json.withContents((contents :: Dagger.JSON!)) } - let path: String! = "/work/pyproject.toml" + let stringAt(path: [String!]!): String! { + let doc = config + doc.field(path).asString rescue { err: Error => "" } + } + + let booleanAt(path: [String!]!): Boolean { + let doc = config + doc.field(path).asBoolean rescue { err: Error => null } + } } type OutsidePath { From ecb0c774b72d38af2a4e562a38619df5da63c6c2 Mon Sep 17 00:00:00 2001 From: Yves Brissaud Date: Tue, 10 Nov 2026 15:52:45 +0100 Subject: [PATCH 2/3] python-sdk: require the toml of PyprojectToml Every caller passes the file, so its toml takes no default. Signed-off-by: Yves Brissaud --- scope.dang | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scope.dang b/scope.dang index af94e5b4..844e70b8 100644 --- a/scope.dang +++ b/scope.dang @@ -809,7 +809,7 @@ type PyprojectHelper { type PyprojectToml { pub toml: String! - new(toml: String! = "") { + new(toml: String!) { self.toml = toml self } From 23f05ef0c713fe78acae7da61b0914df749616af Mon Sep 17 00:00:00 2001 From: Yves Brissaud Date: Tue, 10 Nov 2026 15:53:10 +0100 Subject: [PATCH 3/3] test: cover the Python floor refusal in Dang The Go helper's tables for the refusal went with its code. Run the same cases through generation: a .python-version pin, requires-python ranges and exact pins, prereleases of the floor, unreadable versions, a base image of the module's own, and the last release offered only to a Python it runs on. An sdk/ of the user's own stops each case right after the refusal, so the cases cost no generation. Signed-off-by: Yves Brissaud --- .dagger/modules/e2e/main.dang | 73 ++++++++++++++++++++++++++++ .dagger/modules/engine-e2e/main.dang | 2 + 2 files changed, 75 insertions(+) diff --git a/.dagger/modules/e2e/main.dang b/.dagger/modules/e2e/main.dang index 0a017867..c7d2f658 100644 --- a/.dagger/modules/e2e/main.dang +++ b/.dagger/modules/e2e/main.dang @@ -1049,6 +1049,79 @@ type E2e { null } + """ + The Python floor refusal case by case: each version form generation reads, + from .python-version or requires-python. A user-owned sdk/ ends generation + right after the refusal check, so a case that is not refused costs no + generation. + """ + pub pythonRefusalCasesCheck(scope: Workspace!): Void @check { + let ws = withScope(scope, tomlGenerateModulePath, "toml-generate-app") + .withNewFile("/" + tomlGenerateModulePath + "/sdk/mine.txt", "mine\n") + let pyprojectPath = "/" + tomlGenerateModulePath + "/pyproject.toml" + let project = "[project]\nname = \"app\"\nrequires-python = \"" + let newer = project + ">=3.14\"\n" + let ownImage = "\n[tool.dagger]\nbase-image = \"python:3.14-slim\"\n" + let floorNeeded = "this Python SDK needs Python 3.11 or later, and " + let pinRefusal = floorNeeded + ".python-version pins Python " + let pinFix = ". Set it to Python 3.11 or later" + let requiresRefusal = floorNeeded + "requires-python = \"" + let requiresFix = ". Ask for Python 3.11 or later" + let lastReleaseOffer = ", or pin the last release of this SDK that runs on it: dagger module install github.com/dagger/python-sdk@v1.2.0" + # file "" is no pyproject.toml, pin "" no .python-version, want "" no refusal. + [ + {{file: newer, pin: "3.10", want: pinRefusal + "3.10" + pinFix + lastReleaseOffer}}, + {{file: newer, pin: "3.10.9", want: pinRefusal + "3.10.9" + pinFix + lastReleaseOffer}}, + {{file: newer, pin: "2.7", want: pinRefusal + "2.7" + pinFix}}, + {{file: newer, pin: "2", want: pinRefusal + "2" + pinFix}}, + {{file: newer, pin: "3.11.0rc1", want: pinRefusal + "3.11.0rc1" + pinFix + lastReleaseOffer}}, + {{file: newer, pin: "3.11rc1", want: pinRefusal + "3.11rc1" + pinFix + lastReleaseOffer}}, + {{file: newer, pin: "3.11.dev0", want: pinRefusal + "3.11.dev0" + pinFix + lastReleaseOffer}}, + {{file: newer, pin: "3.11", want: ""}}, + {{file: newer, pin: "3.11.0", want: ""}}, + {{file: newer, pin: "3.11.1rc1", want: ""}}, + {{file: newer, pin: "3.12", want: ""}}, + {{file: newer, pin: "3.13.0b2", want: ""}}, + {{file: newer, pin: "3", want: ""}}, + {{file: newer, pin: "4", want: ""}}, + {{file: newer, pin: " ", want: ""}}, + {{file: "", pin: "pypy3.10", want: ""}}, + {{file: project + ">=3.10\"\n", pin: "3.13", want: ""}}, + {{file: ownImage, pin: "3.10", want: ""}}, + {{file: project + ">=3.11\"\n", pin: "", want: ""}}, + {{file: newer, pin: "", want: ""}}, + {{file: project + ">=3.10\"\n", pin: "", want: requiresRefusal + ">=3.10\" asks for Python 3.10" + requiresFix + lastReleaseOffer}}, + {{file: project + ">=3.10,<4\"\n", pin: "", want: requiresRefusal + ">=3.10,<4\" asks for Python 3.10" + requiresFix + lastReleaseOffer}}, + {{file: project + "==3.10.4\"\n", pin: "", want: requiresRefusal + "==3.10.4\" asks for Python 3.10.4" + requiresFix + lastReleaseOffer}}, + {{file: project + ">=3.9\"\n", pin: "", want: requiresRefusal + ">=3.9\" asks for Python 3.9" + requiresFix}}, + {{file: project + ">=2.7\"\n", pin: "", want: requiresRefusal + ">=2.7\" asks for Python 2.7" + requiresFix}}, + {{file: project + ">=2\"\n", pin: "", want: requiresRefusal + ">=2\" asks for Python 2" + requiresFix}}, + {{file: project + "~=3.10\"\n", pin: "", want: ""}}, + {{file: project + ">=3.10\"\n" + ownImage, pin: "", want: ""}}, + {{file: "[project]\nname = \"app\"\n", pin: "", want: ""}}, + {{file: "", pin: "", want: ""}}, + ].each { row => + let files = if (row.file == "") { ws.withoutFile(pyprojectPath) } else { ws.withNewFile(pyprojectPath, row.file) } + let module = if (row.pin == "") { files } else { files.withNewFile("/" + tomlGenerateModulePath + "/.python-version", row.pin + "\n") } + # checkPython runs before generation, and a user-owned sdk/ makes the next + # step raise (scope.dang checkMembers), so a case that passes the refusal + # ends there without generating. + let got = pythonSdk.mod(module, path: tomlGenerateModulePath, findUp: false).generated.cwd rescue { + err: Error => err.message + } + let pinLabel = if (row.pin == "") { "no .python-version" } else { ".python-version " + row.pin } + let fileLabel = if (row.file == "") { "no pyproject.toml" } else { "pyproject.toml " + row.file } + let label = pinLabel + ", " + fileLabel + ": " + if (row.want == "") { + assertContains(got, "sdk/ exists in " + tomlGenerateModulePath, label + "refused or failed otherwise: " + got) + } else { + assertContains(got, "the module at " + tomlGenerateModulePath + ": " + row.want + ", then run dagger generate again", label + "got " + got) + } + null + } + null + } + """ A module on this repository's runtime builds and runs, driven through the floor release's CLI. The fixture points `[runtime] source` at `runtime/` by relative diff --git a/.dagger/modules/engine-e2e/main.dang b/.dagger/modules/engine-e2e/main.dang index 2027e2ab..408732dd 100644 --- a/.dagger/modules/engine-e2e/main.dang +++ b/.dagger/modules/engine-e2e/main.dang @@ -189,6 +189,8 @@ type EngineE2e { pub pythonFloorRefusalCheck(ws: Workspace!): Void @check { onFloor(ws, "python-floor-refusal-check") } + pub pythonRefusalCasesCheck(ws: Workspace!): Void @check { onFloor(ws, "python-refusal-cases-check") } + pub runtimeCallCheck(ws: Workspace!): Void @check { onFloor(ws, "runtime-call-check") } pub runtimeRequiresGeneratedFilesCheck(ws: Workspace!): Void @check { onFloor(ws, "runtime-requires-generated-files-check") }