diff --git a/.dagger/lock b/.dagger/lock index 5d3ee5d..d0e75b6 100644 --- a/.dagger/lock +++ b/.dagger/lock @@ -1,3 +1,3 @@ [["version","1"]] ["","container.from",["docker.io/library/golang:1.25-alpine","linux/arm64"],"sha256:8d22e29d960bc50cd025d93d5b7c7d220b1ee9aa7a239b3c8f55a57e987e8d45","pin"] -["","git.head",["https://github.com/dagger/sdk-sdk"],"09da9576688ec4b495ae4a9443a4719da86ed25e","float"] \ No newline at end of file +["","git.head",["https://github.com/dagger/sdk-sdk"],"d1532df4f7d322a7bdab02487accde9d21bbb464","float"] diff --git a/.dagger/modules/e2e/dagger.json b/.dagger/modules/e2e/dagger.json index 8bbc10f..0466464 100644 --- a/.dagger/modules/e2e/dagger.json +++ b/.dagger/modules/e2e/dagger.json @@ -1,6 +1,6 @@ { "name": "e2e", - "engineVersion": "v0.20.8", + "engineVersion": "v0.21.4", "sdk": { "source": "dang" }, diff --git a/.dagger/modules/e2e/main.dang b/.dagger/modules/e2e/main.dang index f3befa1..255a236 100644 --- a/.dagger/modules/e2e/main.dang +++ b/.dagger/modules/e2e/main.dang @@ -156,6 +156,18 @@ type E2e { null } + """ + initClient should not materialize files itself. The engine records the client + and owns the generated context changeset. + """ + pub initClientCheck(ws: Workspace!): Void @check { + let changes = pythonSdk.initClient(ws, path: outputRoot + "/client", module: generateModulePath, dev: true) + + assert(changes.isEmpty, "initClient should return an empty SDK changeset") + + null + } + """ config.get should reflect pyproject.toml and report unset values as null rather than guessing, and config.set should edit only pyproject.toml. diff --git a/dagger.json b/dagger.json index ee88bef..0cae831 100644 --- a/dagger.json +++ b/dagger.json @@ -8,7 +8,7 @@ { "name": "polyfill", "source": "https://github.com/dagger/sdk-sdk/polyfill@main", - "pin": "09da9576688ec4b495ae4a9443a4719da86ed25e" + "pin": "d1532df4f7d322a7bdab02487accde9d21bbb464" } ] } diff --git a/dagger.toml b/dagger.toml new file mode 100644 index 0000000..eac285e --- /dev/null +++ b/dagger.toml @@ -0,0 +1,10 @@ +# Dagger workspace configuration +# Install modules with: dagger install +# Example: +# dagger install github.com/dagger/dagger/modules/wolfi + +# Marker filename that skips generate when found at or above a Python SDK module root. +# settings.skipGenerateFilename = "" + +[modules.e2e] +source = ".dagger/modules/e2e" diff --git a/python-sdk.dang b/python-sdk.dang index 6bf7e19..2c53cc2 100644 --- a/python-sdk.dang +++ b/python-sdk.dang @@ -145,6 +145,16 @@ type PythonSdk { } } + """ + Generate a typed Python client for `module` at `path`. + + The engine records the managed client in workspace config before calling + this function. The engine owns materializing the generated client files. + """ + pub initClient(ws: Workspace!, path: String!, module: String!, dev: Boolean! = false): Changeset! { + polyfill.workspace(ws).fork.changes + } + """ Render a Python template with the requested module name. """