Repository navigation
python: add support for defining interfaces - #8097
Merged
helderco merged 3 commits intoApr 22, 2025
Merged
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
helderco
force-pushed
the
helder/dev-3249-support-interfaces-in-python
branch
from
October 14, 2024 18:40
4b09bb9 to
51f4162
Compare
This comment was marked as resolved.
This comment was marked as resolved.
helderco
force-pushed
the
helder/dev-3249-support-interfaces-in-python
branch
from
October 30, 2024 00:05
51f4162 to
da1bbb5
Compare
helderco
force-pushed
the
helder/dev-3249-support-interfaces-in-python
branch
2 times, most recently
from
November 8, 2024 19:03
18d58ff to
554fe8a
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
helderco
force-pushed
the
helder/dev-3249-support-interfaces-in-python
branch
from
March 28, 2025 01:13
001bb25 to
d07bcef
Compare
helderco
force-pushed
the
helder/dev-3249-support-interfaces-in-python
branch
2 times, most recently
from
April 15, 2025 15:27
800d7be to
07d7c52
Compare
Contributor
Author
|
This can be reviewed, just keeping in draft until #9538 is merged. |
helderco
force-pushed
the
helder/dev-3249-support-interfaces-in-python
branch
2 times, most recently
from
April 16, 2025 01:05
f47c672 to
2e92add
Compare
helderco
force-pushed
the
helder/dev-3249-support-interfaces-in-python
branch
3 times, most recently
from
April 16, 2025 19:26
dbc8727 to
03ab103
Compare
helderco
force-pushed
the
helder/dev-3249-support-interfaces-in-python
branch
2 times, most recently
from
April 20, 2025 23:07
2ac9552 to
f017524
Compare
Contributor
Author
|
Marking as ready for review because the draft state is confusing. |
helderco
marked this pull request as ready for review
April 21, 2025 09:51
helderco
force-pushed
the
helder/dev-3249-support-interfaces-in-python
branch
from
April 21, 2025 11:25
f017524 to
bfdc8d3
Compare
Signed-off-by: Helder Correia <[email protected]>
Signed-off-by: Helder Correia <[email protected]>
Signed-off-by: Helder Correia <[email protected]>
helderco
force-pushed
the
helder/dev-3249-support-interfaces-in-python
branch
from
April 21, 2025 18:29
bfdc8d3 to
2eadac5
Compare
jedevc
approved these changes
Apr 22, 2025
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.
This is a long time coming!
Closes #6213
What?
This adds support for defining Dagger interfaces in Dagger modules written in Python.
How?
To define an interface, create a Protocol class, decorated with
@dagger.interface:Note that:
@dagger.functiontoo.typing.Self.Example
Here’s the same toy example in the original issue.
Pondmodule (no deps):Mallardmodule (no deps):Crestedmodule (no deps):Callermodule (deps onMallard,Crested, andPond):Future improvements
Support passing an implementation directly to an argument that expects an interface: