Repository navigation
Python: restructure internal packages and modules - #5558
Conversation
Signed-off-by: Helder Correia <[email protected]>
Signed-off-by: Helder Correia <[email protected]>
|
I'm aware there's an issue with the provisioning download test when more than 4 are run concurrently. This can be reviewed in the meantime. |
There was a problem hiding this comment.
I went through all the files, the changes look good to me.
Apart from the 2 failing checks, I will run the cowsay example, then throw in a few twists and check if everything works as expected.
This is how far I was able to get:
import sys
sys.path.append('./src')
import anyio
import dagger
async def main(args: list[str]):
async with dagger.Connection() as client:
# build container with cowsay entrypoint
ctr = (
client.container()
.from_("python:alpine")
.with_exec(["pip", "install", "cowsay"])
.with_entrypoint(["cowsay"])
)
# run cowsay with requested message
result = await ctr.with_exec(args).stdout()
print(result)
anyio.run(main, sys.argv[1:])Then had to setup a dev Engine:
# at the top level:
./hack/dev
export _EXPERIMENTAL_DAGGER_CLI_BIN=/Users/gerhard/github.com/dagger/dagger/bin/dagger
export _EXPERIMENTAL_DAGGER_RUNNER_HOST=docker-container://dagger-engine.devAnd then just python main.py "foo"
python-main.py.mp4
|
Not the first time I assigned instead of requesting review 😅 |
|
It's been a long week, I know 💪 |
gerhard
left a comment
There was a problem hiding this comment.
Stopping for the day & don't want to stall this anymore than necessary.
LGTM 💪
Signed-off-by: Helder Correia <[email protected]>
Signed-off-by: Helder Correia <[email protected]>
|
@gerhard the failed provision tests are due to the path to The provision tests are too expensive to run on every PR, they're run less often but still early enough to catch something so we can fix before release. Which means, the simplest thing here is to just merge with these provision failures. When merged to main, a new engine is released and that'll have the missing api field that the test will then use. |
What?
This is a restructure of internal packages and modules in the Python SDK, mainly to rename many to private, and secondly to improve organization. This makes it clearer that they're not part of the "public API" of the library.
Reference docs
Additionally, this also updates the reference docs with a few long standing issues.
dagger.api.genshould be justdaggerin reference docs #4685pathandlocationshould be optional in aQueryError#4702Compatibility
This doesn't change anything that was considered public API of the library (imported in
__init__.py, present in reference docs), but it'll likely break users who are importing internal modules. The change makes it clearer what is considered internal due to the leading_(underscore) in module names.Example:
Some users may have been misled by the imports in the reference docs (before PR):
The full path is now
dagger.client.gen.Container, however we've always advised towards simplydagger.Container. The reference documentation has been updated to reflect this and hopefully avoid confusion (with this PR):