MCPcopy Index your code
hub / github.com/dagger/dagger / WithUpdates

Method WithUpdates

sdk/python/runtime/main.go:459–493  ·  view source on GitHub ↗

Make any updates to current source

()

Source from the content-addressed store, hash-verified

457
458// Make any updates to current source
459func (m *PythonSdk) WithUpdates() *PythonSdk {
460 if !m.UseUv() {
461 return m
462 }
463
464 ctr := m.Container
465 d := m.Discovery
466
467 // Update lock file but without upgrading dependencies.
468 switch {
469 case m.UseUvLock():
470 // Support uv.lock. Takes precedence.
471 // Always update if uv.lock exists, but only create a new uv.lock
472 // if init and there's not already a requirements.lock.
473 ctr = ctr.WithExec([]string{"uv", "lock"})
474
475 case d.HasFile(PipCompileLock) && !m.IsInit:
476 // Support requirements.lock (legacy).
477 args := []string{
478 "uv", "pip", "compile", "-q", "--universal",
479 "-o", PipCompileLock,
480 ProjectCfg,
481 }
482
483 if m.VendorPath != "" {
484 args = append(args, path.Join(m.VendorPath, ProjectCfg))
485 }
486
487 ctr = ctr.WithExec(args)
488 }
489
490 m.Container = ctr
491
492 return m
493}
494
495// Install the module's package and dependencies
496func (m *PythonSdk) WithInstall() *PythonSdk {

Callers 2

invokeFunction · 0.80
CommonMethod · 0.80

Calls 4

UseUvMethod · 0.95
UseUvLockMethod · 0.95
HasFileMethod · 0.80
WithExecMethod · 0.45

Tested by

no test coverage detected