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

Function New

sdk/python/runtime/main.go:49–72  ·  view source on GitHub ↗
(
	// Directory with the Python SDK source code.
	// +defaultPath=".."
	// +ignore=["**", "!pyproject.toml", "!uv.lock", "!src/**/*.py", "!src/**/*.typed", "!codegen/pyproject.toml", "!codegen/**/*.py", "!LICENSE", "!README.md", "!dist/*"]
	sdkSourceDir *dagger.Directory,
)

Source from the content-addressed store, hash-verified

47}
48
49func New(
50 // Directory with the Python SDK source code.
51 // +defaultPath=".."
52 // +ignore=["**", "!pyproject.toml", "!uv.lock", "!src/**/*.py", "!src/**/*.typed", "!codegen/pyproject.toml", "!codegen/**/*.py", "!LICENSE", "!README.md", "!dist/*"]
53 sdkSourceDir *dagger.Directory,
54) (*PythonSdk, error) {
55 // Shouldn't happen due to defaultPath, but just in case.
56 if sdkSourceDir == nil {
57 return nil, fmt.Errorf("sdk source directory not provided")
58 }
59 d, err := NewDiscovery(UserConfig{
60 UseUv: true,
61 })
62 if err != nil {
63 return nil, err
64 }
65 return &PythonSdk{
66 Discovery: d,
67 SdkSourceDir: sdkSourceDir,
68 Container: dag.Container(),
69 // TODO: remove the following when we no longer vendor every time
70 VendorPath: GenDir,
71 }, nil
72}
73
74//go:embed template/pyproject.toml
75var tplToml string

Callers 1

invokeFunction · 0.70

Calls 2

NewDiscoveryFunction · 0.85
ContainerMethod · 0.45

Tested by

no test coverage detected