Repository navigation
Conversation
55447f8 to
e704612
Compare
e704612 to
a1e8d96
Compare
sipsma
left a comment
There was a problem hiding this comment.
Looks great so far! Like you said in discord, it would be good to add this to the integ test suite. I first added utils in the host export PR and have since done another iteration on them in the project CLI PR.
I'm hoping those can be merged in the next day or two, just waiting on reviews, but if something comes up and it takes a long time to merge them, I will split the integ test utils out to their own separate PR that can be merged quickly so you can just rebase on that.
There was a problem hiding this comment.
Yeah you probably already saw it, but I added this to the go codegen to help out with what I think is the same (or similar-ish) problem, just in case that's helpful: https://github.com/dagger/dagger/pull/5157/files#diff-31244223d8a860c03288b53863173f3e261164aa5a30c6656810826206939c39R19
There was a problem hiding this comment.
Yep. 😄 I noticed you had the same kind of TODO comment after I added it. Planning on doing it in this PR, just had to focus on other things for 2 days. Also noticed your fix 👍
There was a problem hiding this comment.
This hack does more than that though, it also does this:
Lines 812 to 840 in dc53110
|
@sipsma, yeah I saw those yesterday. I want to make a replica in python of the same commands in |
993a3a0 to
1256a9b
Compare
sipsma
left a comment
There was a problem hiding this comment.
Looks great, including all the updated integ tests. Like you said, there's more cleanup and tests we should add but that's true of go also, so we should feel free to merge this and iterate from there.
There was a problem hiding this comment.
general question, no need to address here, but is python generally backcompat in the 3.x range? Like will users typically be able to write code for python 3.9 and have it still work on 3.11? Or is fine grain version control a requirement?
Just wondering how soon we'll need to prioritize parameterizing this sort of thing (i.e. `"sdk": "python-3.11"). We'll absolutely need that eventually, just wondering if we can put it off or not.
There was a problem hiding this comment.
The Python SDK only supports 3.10+. I took some liberties here that use 3.11+ features since we control the runtime image, but it's not a big change to back-support 3.10 if needed. I think we can put the image customization off for a while longer. If someone needs that customization I imagine it'll be more for other reasons rather than the Python version as this is independent from the version users need to run in production.
Signed-off-by: Helder Correia <[email protected]>
Signed-off-by: Helder Correia <[email protected]>
Signed-off-by: Helder Correia <[email protected]>
Signed-off-by: Helder Correia <[email protected]>
Signed-off-by: Helder Correia <[email protected]>
Signed-off-by: Helder Correia <[email protected]>
Signed-off-by: Helder Correia <[email protected]>
Signed-off-by: Helder Correia <[email protected]>
Signed-off-by: Helder Correia <[email protected]>
…r distribution Signed-off-by: Helder Correia <[email protected]>
Signed-off-by: Helder Correia <[email protected]>
Just looking for a small performance improvement here. Signed-off-by: Helder Correia <[email protected]>
Signed-off-by: Helder Correia <[email protected]>
Signed-off-by: Helder Correia <[email protected]>
1256a9b to
0ddc1e2
Compare
| st.AddMount("/src", wdState, llb.Readonly) // TODO: not actually needed here, just makes go server code easier at moment | ||
| switch p.Config.SDK { | ||
| case "go", "python": | ||
| st.AddMount("/src", wdState, llb.Readonly) |
There was a problem hiding this comment.
@sipsma I only added this to access client.host() in the commands, but otherwise not required. I know you have other plans to improve accessing the host.
Follow-up on #5060 to improve DX in Python.
Using strawberry should be considered an implementation detail. This adds a thin layer on top of it because it's easier that way. There's still a lot to improve, but this aims to be a minimal experimental proof of concept.
I've placed demos in
sdk/python/experimentalbecause it's easier to run these fromsdk/python. Otherwise it takes too long to load the context if run from the root of the repo.Example
Simple cowsay example:
Run from
sdk/python:General usage notes
@command.@commandsand behave like a@dataclassfor any defined attributes.Annotated[<type>, "Description."].dagger.Clientparameter. The parameter name doesn’t matter, it’s the type that’s important.Implementation notes
Queryand that doesn’t fit the CLI based mental model;Packaging notes
Minimum required files:
main.pydagger.jsonpyproject.tomlMinimum
pyproject.tomlcontents:Note that the examples in
experimentalhave a bit more boilerplate to allow referencing a local path. We need this here to get the latest SDK code while developing this feature.Remaining
Add more tests and clean up more things. However we can improve those in follow ups.
\cc @sipsma @cpdeethree