( // 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, )
| 47 | } |
| 48 | |
| 49 | func 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 |
| 75 | var tplToml string |
no test coverage detected