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

Method Common

sdk/python/runtime/main.go:214–241  ·  view source on GitHub ↗

Common steps for the ModuleRuntime and Codegen functions

(
	ctx context.Context,
	modSource *dagger.ModuleSource,
	// +optional
	introspectionJSON *dagger.File,
)

Source from the content-addressed store, hash-verified

212
213// Common steps for the ModuleRuntime and Codegen functions
214func (m *PythonSdk) Common(
215 ctx context.Context,
216 modSource *dagger.ModuleSource,
217 // +optional
218 introspectionJSON *dagger.File,
219) (*PythonSdk, error) {
220 // The following functions were built to be composable in a granular way,
221 // to allow a custom SDK to depend on this one and hook into before or
222 // after major steps in the process. For example, you can get the base
223 // container, add system packages, use the new one with `WithContainer`,
224 // and then continue with the rest of the steps. Without this, you'd need
225 // to copy the entire function and modify it.
226
227 // NB: In extension modules, Load is chainable.
228 _, err := m.Load(ctx, modSource)
229 if err != nil {
230 return nil, err
231 }
232 _, err = m.WithBase()
233 if err != nil {
234 return nil, err
235 }
236 return m.
237 WithSDK(introspectionJSON).
238 WithTemplate().
239 WithSource().
240 WithUpdates(), nil
241}
242
243// Get all the needed information from the module's metadata and source files
244func (m *PythonSdk) Load(ctx context.Context, modSource *dagger.ModuleSource) (*PythonSdk, error) {

Callers 4

CodegenMethod · 0.95
ModuleRuntimeMethod · 0.95
ModuleTypesExpMethod · 0.95
invokeFunction · 0.45

Calls 6

LoadMethod · 0.95
WithBaseMethod · 0.95
WithSDKMethod · 0.95
WithUpdatesMethod · 0.80
WithTemplateMethod · 0.80
WithSourceMethod · 0.45

Tested by

no test coverage detected