Skip to content

sdk: add the @start decorator - #36

Open
eunomie wants to merge 1 commit into
dagger:mainfrom
eunomie:start-rename-python-sdk-6a7fff55
Open

eunomie wants to merge 1 commit into
dagger:mainfrom
eunomie:start-rename-python-sdk-6a7fff55

Conversation

@eunomie

@eunomie eunomie commented Sep 24, 2026

Copy link
Copy Markdown
Member

Adds @start to mark a function as a service for dagger start (dagger/dagger#14218). The engine part is dagger/dagger#14328.

  • @start sets the same flag @up did, so registration still calls Function.withUp. The wire name does not change, so this works on engines that predate start.
  • @up keeps working. It is deprecated with typing_extensions.deprecated, which emits a DeprecationWarning that points at @start. Python filters that warning by default, so existing modules run unchanged.
  • start is exported next to up in dagger.mod.__all__, so from dagger import start works.

This mirrors the sdk/python change in dagger/dagger#14328.

The with_up docstring in sdk/src/dagger/client/gen.py still says "dagger up". That file is generated from the engine schema and changes when the engine pin moves past dagger/dagger#14328.

Testing:

  • uv run --frozen pytest -q tests/client tests/codegen tests/mod: new tests cover @start in both decorator orders, and @up warning while still marking a service.
  • A module vendoring this library, run by the released v1.0.0-beta.14 engine, which predates start: dagger up -l lists both the @start and the @up function, and dagger up proof:web serves the @start service on the forwarded port.

Signed-off-by: Yves Brissaud <yves@dagger.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant