MCPcopy
hub / github.com/dagger/dagger / uv

Method uv

sdk/python/runtime/main.go:296–316  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

294}
295
296func (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//

Callers 1

WithBaseMethod · 0.95

Calls 14

getImageMethod · 0.95
FileMethod · 0.95
SdkHasFileMethod · 0.80
EqualMethod · 0.65
DirectoryMethod · 0.65
StringMethod · 0.65
RootfsMethod · 0.45
FromMethod · 0.45
ContainerMethod · 0.45
WithEnvVariableMethod · 0.45
WithMountedCacheMethod · 0.45
WithMountedFileMethod · 0.45

Tested by

no test coverage detected