Skip to content

chore(python): refactor origin usage - #8812

Merged
helderco merged 3 commits into
dagger:mainfrom
helderco:python/mod-refactor-origin-usage
Nov 3, 2024
Merged

helderco merged 3 commits into
dagger:mainfrom
helderco:python/mod-refactor-origin-usage

Conversation

@helderco

@helderco helderco commented Oct 29, 2024 •

Copy link
Copy Markdown
Contributor

Note

This is a split from #8709

Follow-up cleanup from:

It's now possible to simplify a lot of things since we no longer support top-level functions. Makes the code easier to read and maintain, fixes a few typing bugs, and is more approachable as a example for new SDKs.

These changes are implementation details. No user facing feature is supposed to have changed. Relying on tests to confirm that.

Moved all registration to dagger.mod.Module:register

I felt a bit frustrated on multiple occasions that I had to move between _module.py and _resolver.py (in FieldResolver in FunctionResolver) to teach how an SDK registers a module’s types.

As I was simplifying things, I also moved all the registration code into the single dagger.mod.Module:_register method, so it can be more easily understood.

@helderco
helderco marked this pull request as ready for review October 29, 2024 22:51
@helderco
helderco requested a review from a team as a code owner October 29, 2024 22:51
@helderco
helderco requested review from TomChv and jedevc and removed request for a team October 29, 2024 22:51
@helderco
helderco force-pushed the python/mod-refactor-origin-usage branch from d3ff37d to 4745548 Compare October 29, 2024 23:39
@jedevc

jedevc commented Oct 30, 2024

Copy link
Copy Markdown
Contributor

LGTM once checks are passing 🎉

@helderco
helderco force-pushed the python/mod-refactor-origin-usage branch 2 times, most recently from a0d01e9 to e927c7c Compare October 30, 2024 16:48
@helderco

Copy link
Copy Markdown
Contributor Author

What's up with CI? I keep getting:

Error: response from query: Post "http://dagger/query": unexpected EOF

It's flaking a lot.

@jedevc
jedevc force-pushed the python/mod-refactor-origin-usage branch 2 times, most recently from 1c81e36 to fe7f1c4 Compare October 31, 2024 11:38
@helderco
helderco force-pushed the python/mod-refactor-origin-usage branch 3 times, most recently from 3db59d2 to f57468a Compare November 2, 2024 15:51
It's now possible to simplify a lot of things since we no longer support top-level functions. Makes the code easier to read and maintain, fixes a few typing bugs, and is more approachable as a example for new SDKs.

Signed-off-by: Helder Correia <[email protected]>
Signed-off-by: Helder Correia <[email protected]>
@helderco
helderco force-pushed the python/mod-refactor-origin-usage branch from f57468a to 0d79a3e Compare November 2, 2024 19:05
@helderco
helderco merged commit b86c493 into dagger:main Nov 3, 2024
@helderco
helderco deleted the python/mod-refactor-origin-usage branch November 3, 2024 11:01
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.

2 participants