diff --git a/pkg/universe.dagger.io/python/python.cue b/pkg/universe.dagger.io/python/python.cue index 100adfb2..308ecc4b 100644 --- a/pkg/universe.dagger.io/python/python.cue +++ b/pkg/universe.dagger.io/python/python.cue @@ -42,7 +42,7 @@ import ( docker.#Run & { command: { - name: "python3" + name: string | *"python3" "args": ["\(_mountpoint)/\(script._filename)"] + args } diff --git a/pkg/universe.dagger.io/python/test/test.cue b/pkg/universe.dagger.io/python/test/test.cue index 2aa0ca3c..ef4d9dc4 100644 --- a/pkg/universe.dagger.io/python/test/test.cue +++ b/pkg/universe.dagger.io/python/test/test.cue @@ -3,13 +3,28 @@ package python import ( "dagger.io/dagger" "dagger.io/dagger/core" - + "universe.dagger.io/docker" "universe.dagger.io/python" ) dagger.#Plan & { actions: test: { + // Run with a custom path to python + customPath: { + + // python:3.10-alpine has both python3 and python in the PATH + _image: docker.#Pull & { + source: "python:3.10-alpine" + } + run: python.#Run & { + input: _image.output + command: name: "python" + script: contents: #"print("Hello, world!")"# + } + // This needs no output test because it is only testing that the command runs + } + // Run a script from source directory + filename runFile: {