python-sdk: add CLI 1.0 client init#4
Merged
tiborvass merged 2 commits intoJun 19, 2026
Conversation
40b2c89 to
138976a
Compare
907e5ad to
45a493e
Compare
CLI 1.0 calls initClient when a workspace adds a managed client. The Python SDK init-contract work lives in the stacked prepare-cli-1.0-init-contract branch, but that branch does not add the client hook. Add initClient with the CLI 1.0 signature, including the dev flag. It returns an empty Changeset on purpose: the engine records the client and owns generated client files through GeneratedContextChangeset. Add an e2e check that calls initClient and verifies the SDK returns no file changes. This keeps the PR narrowly scoped on top of #2. It only adds the client init hook and does not duplicate the targetRuntime or initModule changes from the stacked base. Signed-off-by: Guillaume de Rouville <guillaume@dagger.io>
45a493e to
6905b24
Compare
Dogfood load checks run through workspace modules. The Python SDK repo did not have a dagger.toml, so CI was not loading its in-repo e2e module through the same workspace path as the Go and TypeScript SDK repos. Add a minimal dagger.toml that includes only .dagger/modules/e2e. The Python SDK root module is intentionally not listed as a workspace module; it remains the root module that the e2e module depends on through a local source. The workspace e2e checks call sdk-sdk/polyfill helper binaries such as workspace-module-generate and workspace-snapshot. The old Python SDK pin built those helpers against dagger.io/dagger v0.20.6, which still queried loadWorkspaceFromID and fails against the CLI 1.0 dev engine schema. Bump the polyfill pin and lock to the same commit used by the TypeScript SDK, where those helpers are compatible with the current workspace API. Also bump the e2e module engine pin to v0.21.4 so the workspace-loaded test module runs with the same schema generation baseline as the TypeScript SDK e2e module. Signed-off-by: Guillaume de Rouville <guillaume@dagger.io>
6905b24 to
db199ca
Compare
tiborvass
approved these changes
Jun 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
This PR is stacked on #2 (
prepare-cli-1.0-init-contract). #2 carries the Python SDK module init contract work. This PR keeps the next piece narrow: add the CLI 1.0initClienthook that the engine calls when a workspace adds a managed client, add e2e coverage for that hook, and load the e2e module through workspace config.Dogfood workspace checks also exposed that Python still pinned an older
sdk-sdk/polyfill. Its helper binaries were built againstdagger.io/dagger v0.20.6and queriedloadWorkspaceFromID, which fails against the CLI 1.0 dev engine schema. This PR bumps the polyfill pin/lock to the same commit used by the TypeScript SDK.What Changed
Add
initClient.dev.Changeset.Add e2e coverage.
pythonSdk.initClient(...).Load e2e through workspace config.
dagger.tomlinstalls only.dagger/modules/e2ease2e.v0.21.4, matching the TypeScript SDK e2e module.Refresh the polyfill pin used by workspace helper commands.
sdk-sdk/polyfillfrom09da957...tod1532df.....dagger/lockto the same commit.workspace-module-generateandworkspace-snapshotagainst the CLI 1.0 dev engine schema.What This Does Not Do
This PR does not duplicate the
targetRuntimeorinitModulechanges from the stacked base branch. It should be reviewed as the client-init and workspace-load delta on top of #2.Validation
Run with the local CLI 1.0 dev engine: