()
| 294 | } |
| 295 | |
| 296 | func (m *PythonSdk) uv() dagger.WithContainerFunc { |
| 297 | uvImage := m.getImage(UvImageName) |
| 298 | |
| 299 | return func(ctr *dagger.Container) *dagger.Container { |
| 300 | var bins *dagger.Directory |
| 301 | // Use bundled uv binaries if version wasn't overridden. |
| 302 | if m.Discovery.SdkHasFile("dist/uv") && uvImage.Equal(m.Discovery.DefaultImages[UvImageName]) { |
| 303 | bins = m.SdkSourceDir.Directory("dist") |
| 304 | } else { |
| 305 | bins = dag.Container().From(uvImage.String()).Rootfs() |
| 306 | } |
| 307 | |
| 308 | return ctr. |
| 309 | WithMountedFile("/usr/local/bin/uv", bins.File("uv")). |
| 310 | WithMountedFile("/usr/local/bin/uvx", bins.File("uvx")). |
| 311 | WithMountedCache("/root/.cache/uv", dag.CacheVolume("modpython-uv")). |
| 312 | // These are informational only, to be leveraged by the target module if needed. |
| 313 | WithEnvVariable("DAGGER_UV_IMAGE", uvImage.String()). |
| 314 | WithEnvVariable("DAGGER_UV_VERSION", uvImage.Tag()) |
| 315 | } |
| 316 | } |
| 317 | |
| 318 | // Add the template files to skaffold a new module |
| 319 | // |
no test coverage detected