Skip to content

Commit

Permalink
python updates (dagger#9380)
Browse files Browse the repository at this point in the history
Signed-off-by: Helder Correia <[email protected]>
  • Loading branch information
helderco authored Jan 19, 2025
1 parent e8921f0 commit 1da962f
Show file tree
Hide file tree
Showing 17 changed files with 417 additions and 412 deletions.
4 changes: 2 additions & 2 deletions core/integration/module_python_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -847,15 +847,15 @@ class Test:
// newer feature.
With(pyprojectExtra(nil, `
[tool.dagger]
uv-version = "0.4.5"
uv-version = "0.5.20"
`)).
With(source).
With(daggerInitPython()).
With(daggerCall("version")).
Stdout(ctx)

require.NoError(t, err)
require.Equal(t, "0.4.5", out)
require.Equal(t, "0.5.20", out)
})

t.Run("index-url", func(ctx context.Context, t *testctx.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ async def main():
.with_directory(
"/src",
client.host().directory(
".", exclude=["node_modules/", "ci/", "build/"]),
".", exclude=["node_modules/", "ci/", "build/"]
),
)
)

Expand All @@ -31,15 +32,13 @@ async def main():

# build application
# write the build output to the host
build_dir = (
test.with_exec(["npm", "run", "build"])
.directory("./build")
)
build_dir = test.with_exec(["npm", "run", "build"]).directory("./build")

await build_dir.export("./build")

e = await build_dir.entries()

print(f"build dir contents:\n{e}")


anyio.run(main)
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def publish(self, source: dagger.Directory) -> str:
"""Publish the application container after building and testing it on-the-fly"""
await self.test(source)
return await self.build(source).publish(
f"ttl.sh/myapp-{random.randrange(10 ** 8)}"
f"ttl.sh/myapp-{random.randrange(10**8)}"
)

@function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ async def publish(self, source: dagger.Directory) -> str:
# call Dagger Function to build the application image
# publish the image to ttl.sh
return await self.build(source).publish(
f"ttl.sh/myapp-{random.randrange(10 ** 8)}"
f"ttl.sh/myapp-{random.randrange(10**8)}"
)
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ async def publish(self, source: dagger.Directory) -> str:
"""Publish the application container after building and testing it on-the-fly"""
await self.test(source)
return await self.build(source).publish(
f"ttl.sh/hello-dagger-{random.randrange(10 ** 8)}"
f"ttl.sh/hello-dagger-{random.randrange(10**8)}"
)

@function
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/dev/dagger.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "python-sdk-dev",
"engineVersion": "v0.14.0",
"engineVersion": "v0.15.2",
"sdk": "python",
"exclude": [
"**/.venv",
Expand Down
6 changes: 3 additions & 3 deletions sdk/python/dev/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[project]
name = "main"
name = "python-sdk-dev"
version = "0.0.0"
requires-python = ">=3.12"
dependencies = ["dagger-io"]

[tool.dagger]
# Ensure the dev module works both with released and dev engine.
uv-version = "0.5.7"
uv-version = "0.5.21"

[tool.uv.sources]
dagger-io = { path = "sdk", editable = true }

[build-system]
requires = ["hatchling==1.25.0"]
requires = ["hatchling==1.27.0"]
build-backend = "hatchling.build"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
241 changes: 121 additions & 120 deletions sdk/python/dev/uv.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sdk/python/runtime/dagger.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "python-sdk",
"engineVersion": "v0.13.7",
"engineVersion": "v0.15.2",
"sdk": "go",
"source": "."
}
2 changes: 1 addition & 1 deletion sdk/python/runtime/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ require (
github.com/grpc-ecosystem/grpc-gateway/v2 v2.22.0 // indirect
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
github.com/sosodev/duration v1.3.1 // indirect
github.com/vektah/gqlparser/v2 v2.5.19
github.com/vektah/gqlparser/v2 v2.5.20
go.opentelemetry.io/otel v1.27.0
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.0.0-20240518090000-14441aefdf88
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.3.0
Expand Down
4 changes: 2 additions & 2 deletions sdk/python/runtime/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/vektah/gqlparser/v2 v2.5.19 h1:bhCPCX1D4WWzCDvkPl4+TP1N8/kLrWnp43egplt7iSg=
github.com/vektah/gqlparser/v2 v2.5.19/go.mod h1:y7kvl5bBlDeuWIvLtA9849ncyvx6/lj06RsMrEjVy3U=
github.com/vektah/gqlparser/v2 v2.5.20 h1:kPaWbhBntxoZPaNdBaIPT1Kh0i1b/onb5kXgEdP5JCo=
github.com/vektah/gqlparser/v2 v2.5.20/go.mod h1:xMl+ta8a5M1Yo1A1Iwt/k7gSpscwSnHZdw7tfhEGfTM=
go.opentelemetry.io/otel v1.27.0 h1:9BZoF3yMK/O1AafMiQTVu0YDj5Ea4hPhxCs7sGva+cg=
go.opentelemetry.io/otel v1.27.0/go.mod h1:DMpAK8fzYRzs+bi3rS5REupisuqTheUlSZJ1WnZaPAQ=
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.0.0-20240518090000-14441aefdf88 h1:oM0GTNKGlc5qHctWeIGTVyda4iFFalOzMZ3Ehj5rwB4=
Expand Down
Loading

0 comments on commit 1da962f

Please sign in to comment.