From 118067844cc8bc128df72930a3b952e4380b36b7 Mon Sep 17 00:00:00 2001 From: Guillaume de Rouville Date: Wed, 22 Jul 2026 14:01:59 -0700 Subject: [PATCH 1/3] feat: add a useful default Python template `dagger module init python` currently generates an empty object. It is a valid module, but it does not give users a useful starting point or show how a workspace becomes a container. Generate a small working module by default. It keeps the workspace source, lets users choose the base image, and exposes a container function with the source mounted at `/src`. Python needs the public `create` method because Dagger later rebuilds the object from its fields. Keeping the generated `__init__` available makes that reconstruction work when another function is called. The previous blank template remains available as `empty`, while `legacy` stays unchanged. Name the workspace argument `ws` to avoid clashing with the CLI's top-level `--workspace` flag. Signed-off-by: Guillaume de Rouville --- python-sdk.dang | 9 +++-- .../{minimal => default}/pyproject.toml.tmpl | 0 .../src/{{.ModulePackage}}/__init__.py.tmpl | 39 +++++++++++++++++++ templates/empty/pyproject.toml.tmpl | 12 ++++++ .../src/{{.ModulePackage}}/__init__.py.tmpl | 1 + 5 files changed, 57 insertions(+), 4 deletions(-) rename templates/{minimal => default}/pyproject.toml.tmpl (100%) create mode 100644 templates/default/src/{{.ModulePackage}}/__init__.py.tmpl create mode 100644 templates/empty/pyproject.toml.tmpl rename templates/{minimal => empty}/src/{{.ModulePackage}}/__init__.py.tmpl (98%) diff --git a/python-sdk.dang b/python-sdk.dang index 6f0ca99..ca81d19 100644 --- a/python-sdk.dang +++ b/python-sdk.dang @@ -136,14 +136,15 @@ type PythonSdk { new module's `path`. Engine-owned files (dagger-module.toml, workspace config updates) are produced by the engine and merged with this changeset. - Pass `template` to materialize files from templates/