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

Method Codegen

sdk/python/runtime/main.go:147–174  ·  view source on GitHub ↗

Generated code for the Python module

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

Source from the content-addressed store, hash-verified

145
146// Generated code for the Python module
147func (m *PythonSdk) Codegen(
148 ctx context.Context,
149 modSource *dagger.ModuleSource,
150 introspectionJSON *dagger.File,
151) (*dagger.GeneratedCode, error) {
152 m, err := m.Common(ctx, modSource, introspectionJSON)
153 if err != nil {
154 return nil, err
155 }
156
157 ignorePaths := []string{".venv", "**/__pycache__"}
158 genPaths := []string{
159 // TODO: uncomment when we start generating client bindings outside the library
160 // UserGenPath,
161 }
162
163 if m.VendorPath != "" {
164 ignorePaths = append(ignorePaths, m.VendorPath)
165 genPaths = []string{m.VendorPath + "/**"}
166 }
167
168 return dag.
169 GeneratedCode(
170 m.Container.Directory(m.ContextDirPath).
171 WithoutDirectory("sdk/runtime")).
172 WithVCSGeneratedPaths(genPaths).
173 WithVCSIgnoredPaths(ignorePaths), nil
174}
175
176// Container for executing the Python module runtime
177func (m *PythonSdk) ModuleRuntime(

Callers

nothing calls this directly

Calls 6

CommonMethod · 0.95
DirectoryMethod · 0.65
WithVCSIgnoredPathsMethod · 0.45
WithVCSGeneratedPathsMethod · 0.45
GeneratedCodeMethod · 0.45
WithoutDirectoryMethod · 0.45

Tested by

no test coverage detected