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

Method WithSource

sdk/python/runtime/main.go:442–456  ·  view source on GitHub ↗

Add the module's source code

()

Source from the content-addressed store, hash-verified

440
441// Add the module's source code
442func (m *PythonSdk) WithSource() *PythonSdk {
443 m.Container = m.Container.
444 WithWorkdir(path.Join(m.ContextDirPath, m.SubPath)).
445 WithMountedDirectory(m.ContextDirPath, m.ContextDir).
446 // These are added as late as possible to avoid cache invalidation
447 // between different modules. It may be used by the runtime entrypoint
448 // so only needed in ModuleRuntime but added here so that extension
449 // modules get it for free since they need to reimplement ModuleRuntime.
450 // It's ok since the previous layer is already dependent on the target
451 // module's sources.
452 WithEnvVariable("DAGGER_MODULE", m.ModName).
453 WithEnvVariable("DAGGER_DEFAULT_PYTHON_PACKAGE", m.PackageName).
454 WithEnvVariable("DAGGER_MAIN_OBJECT", m.MainObjectName)
455 return m
456}
457
458// Make any updates to current source
459func (m *PythonSdk) WithUpdates() *PythonSdk {

Callers 2

invokeFunction · 0.45
CommonMethod · 0.45

Calls 3

WithEnvVariableMethod · 0.45
WithMountedDirectoryMethod · 0.45
WithWorkdirMethod · 0.45

Tested by

no test coverage detected