python-sdk
Runtime module for the Python SDK
Installation
dagger install github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc
Entrypoint
Return Type
PythonSdk !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
sdkSourceDir | Directory | - | Directory with the Python SDK source code. |
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
func (m *myModule) example() *PythonSdk {
return dag.
PythonSdk()
}
@function
def example() -> dag.PythonSdk:
return (
dag.python_sdk()
)
@func()
example(): PythonSdk {
return dag
.pythonSdk()
}
Types
PythonSdk 🔗
Functions for building the runtime module for the Python SDK. The server interacts directly with the ModuleRuntime and Codegen functions. The others were built to be composable and chainable to facilitate the creation of extension modules (custom SDKs that depend on this one).
sdkSourceDir() 🔗
Directory with the Python SDK source code
Return Type
Directory !
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
sdk-source-dir
func (m *myModule) example() *Directory {
return dag.
PythonSdk().
SdkSourceDir()
}
@function
def example() -> dagger.Directory:
return (
dag.python_sdk()
.sdk_source_dir()
)
@func()
example(): Directory {
return dag
.pythonSdk()
.sdkSourceDir()
}
requiredPaths() 🔗
List of patterns to always include when loading Python modules
Return Type
[String ! ] !
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
required-paths
func (m *myModule) example(ctx context.Context) []string {
return dag.
PythonSdk().
RequiredPaths(ctx)
}
@function
async def example() -> List[str]:
return await (
dag.python_sdk()
.required_paths()
)
@func()
async example(): Promise<string[]> {
return dag
.pythonSdk()
.requiredPaths()
}
container() 🔗
Resulting container after each composing step
Return Type
Container !
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
container
func (m *myModule) example() *Container {
return dag.
PythonSdk().
Container()
}
@function
def example() -> dagger.Container:
return (
dag.python_sdk()
.container()
)
@func()
example(): Container {
return dag
.pythonSdk()
.container()
}
modName() 🔗
The original module’s name
Return Type
String !
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
mod-name
func (m *myModule) example(ctx context.Context) string {
return dag.
PythonSdk().
ModName(ctx)
}
@function
async def example() -> str:
return await (
dag.python_sdk()
.mod_name()
)
@func()
async example(): Promise<string> {
return dag
.pythonSdk()
.modName()
}
projectName() 🔗
The normalized python distribution package name (in pyproject.toml)
Return Type
String !
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
project-name
func (m *myModule) example(ctx context.Context) string {
return dag.
PythonSdk().
ProjectName(ctx)
}
@function
async def example() -> str:
return await (
dag.python_sdk()
.project_name()
)
@func()
async example(): Promise<string> {
return dag
.pythonSdk()
.projectName()
}
packageName() 🔗
The normalized python import package name (in the filesystem)
Return Type
String !
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
package-name
func (m *myModule) example(ctx context.Context) string {
return dag.
PythonSdk().
PackageName(ctx)
}
@function
async def example() -> str:
return await (
dag.python_sdk()
.package_name()
)
@func()
async example(): Promise<string> {
return dag
.pythonSdk()
.packageName()
}
mainObjectName() 🔗
The normalized main object name in Python
Return Type
String !
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
main-object-name
func (m *myModule) example(ctx context.Context) string {
return dag.
PythonSdk().
MainObjectName(ctx)
}
@function
async def example() -> str:
return await (
dag.python_sdk()
.main_object_name()
)
@func()
async example(): Promise<string> {
return dag
.pythonSdk()
.mainObjectName()
}
modSource() 🔗
The source needed to load and run a module
Return Type
ModuleSource !
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
mod-source
func (m *myModule) example() *ModuleSource {
return dag.
PythonSdk().
ModSource()
}
@function
def example() -> dag.ModuleSource:
return (
dag.python_sdk()
.mod_source()
)
@func()
example(): ModuleSource {
return dag
.pythonSdk()
.modSource()
}
contextDir() 🔗
ContextDir is a copy of the context directory from the module source
We add files to this directory, always joining paths with the source’s subpath. We could use modSource.Directory(“”) for that if it was read-only, but since we have to mount the context directory in the end, rather than mounting the context dir and then mounting the forked source dir on top, we fork the context dir instead so there’s only one mount in the end.
Return Type
Directory !
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
context-dir
func (m *myModule) example() *Directory {
return dag.
PythonSdk().
ContextDir()
}
@function
def example() -> dagger.Directory:
return (
dag.python_sdk()
.context_dir()
)
@func()
example(): Directory {
return dag
.pythonSdk()
.contextDir()
}
contextDirPath() 🔗
ContextDirPath is a unique host path for the module being loaded
HACK: this property is computed as a unique value for a ModuleSource to provide a unique path on the filesystem. This is because the uv cache uses hashes of source paths - so we need to have something unique, or we can get very real conflicts in the uv cache.
Return Type
String !
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
context-dir-path
func (m *myModule) example(ctx context.Context) string {
return dag.
PythonSdk().
ContextDirPath(ctx)
}
@function
async def example() -> str:
return await (
dag.python_sdk()
.context_dir_path()
)
@func()
async example(): Promise<string> {
return dag
.pythonSdk()
.contextDirPath()
}
subPath() 🔗
Relative path from the context directory to the source directory
Return Type
String !
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
sub-path
func (m *myModule) example(ctx context.Context) string {
return dag.
PythonSdk().
SubPath(ctx)
}
@function
async def example() -> str:
return await (
dag.python_sdk()
.sub_path()
)
@func()
async example(): Promise<string> {
return dag
.pythonSdk()
.subPath()
}
isInit() 🔗
True if the module is new and we need to create files from the template
It’s assumed that this is the case if there’s no pyproject.toml file.
Return Type
Boolean !
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
is-init
func (m *myModule) example(ctx context.Context) bool {
return dag.
PythonSdk().
IsInit(ctx)
}
@function
async def example() -> bool:
return await (
dag.python_sdk()
.is_init()
)
@func()
async example(): Promise<boolean> {
return dag
.pythonSdk()
.isInit()
}
withoutUserConfig() 🔗
Disable the discovery of custom configuration
If it’s not necessary, it’s faster without it.
Return Type
PythonSdk !
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
without-user-config
func (m *myModule) example() *PythonSdk {
return dag.
PythonSdk().
WithoutUserConfig()
}
@function
def example() -> dag.PythonSdk:
return (
dag.python_sdk()
.without_user_config()
)
@func()
example(): PythonSdk {
return dag
.pythonSdk()
.withoutUserConfig()
}
withContainer() 🔗
Replace the underlying container
Since all steps change this container, it’s possible to extract it in one step, change it, and then set it with this function. Can be useful, for example, to add system packages between the WithBase() and WithSource() steps.
Return Type
PythonSdk !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
ctr | Container ! | - | The container to use |
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
with-container --ctr IMAGE:TAG
func (m *myModule) example(ctr *Container) *PythonSdk {
return dag.
PythonSdk().
WithContainer(ctr)
}
@function
def example(ctr: dagger.Container) -> dag.PythonSdk:
return (
dag.python_sdk()
.with_container(ctr)
)
@func()
example(ctr: Container): PythonSdk {
return dag
.pythonSdk()
.withContainer(ctr)
}
baseImage() 🔗
Image reference for the base container
Return Type
String !
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
base-image
func (m *myModule) example(ctx context.Context) string {
return dag.
PythonSdk().
BaseImage(ctx)
}
@function
async def example() -> str:
return await (
dag.python_sdk()
.base_image()
)
@func()
async example(): Promise<string> {
return dag
.pythonSdk()
.baseImage()
}
uvImage() 🔗
Image reference where uv is fetched from
Return Type
String !
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
uv-image
func (m *myModule) example(ctx context.Context) string {
return dag.
PythonSdk().
UvImage(ctx)
}
@function
async def example() -> str:
return await (
dag.python_sdk()
.uv_image()
)
@func()
async example(): Promise<string> {
return dag
.pythonSdk()
.uvImage()
}
withBaseImage() 🔗
Override the base container’s image
Needs to be called before Load.
Return Type
PythonSdk !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
ref | String ! | - | The image reference |
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
with-base-image --ref string
func (m *myModule) example(ref string) *PythonSdk {
return dag.
PythonSdk().
WithBaseImage(ref)
}
@function
def example(ref: str) -> dag.PythonSdk:
return (
dag.python_sdk()
.with_base_image(ref)
)
@func()
example(ref: string): PythonSdk {
return dag
.pythonSdk()
.withBaseImage(ref)
}
useUv() 🔗
Check whether to use uv or not
Return Type
Boolean !
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
use-uv
func (m *myModule) example(ctx context.Context) bool {
return dag.
PythonSdk().
UseUv(ctx)
}
@function
async def example() -> bool:
return await (
dag.python_sdk()
.use_uv()
)
@func()
async example(): Promise<boolean> {
return dag
.pythonSdk()
.useUv()
}
withUv() 🔗
Enable the use of uv
Return Type
PythonSdk !
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
with-uv
func (m *myModule) example() *PythonSdk {
return dag.
PythonSdk().
WithUv()
}
@function
def example() -> dag.PythonSdk:
return (
dag.python_sdk()
.with_uv()
)
@func()
example(): PythonSdk {
return dag
.pythonSdk()
.withUv()
}
withoutUv() 🔗
Disable the use of uv
Return Type
PythonSdk !
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
without-uv
func (m *myModule) example() *PythonSdk {
return dag.
PythonSdk().
WithoutUv()
}
@function
def example() -> dag.PythonSdk:
return (
dag.python_sdk()
.without_uv()
)
@func()
example(): PythonSdk {
return dag
.pythonSdk()
.withoutUv()
}
uvVersion() 🔗
Version to use for uv
Return Type
String !
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
uv-version
func (m *myModule) example(ctx context.Context) string {
return dag.
PythonSdk().
UvVersion(ctx)
}
@function
async def example() -> str:
return await (
dag.python_sdk()
.uv_version()
)
@func()
async example(): Promise<string> {
return dag
.pythonSdk()
.uvVersion()
}
indexUrl() 🔗
Uv’s default index URL setting
Return Type
String !
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
index-url
func (m *myModule) example(ctx context.Context) string {
return dag.
PythonSdk().
IndexUrl(ctx)
}
@function
async def example() -> str:
return await (
dag.python_sdk()
.index_url()
)
@func()
async example(): Promise<string> {
return dag
.pythonSdk()
.indexUrl()
}
extraIndexUrl() 🔗
Uv’s “extra-index-url” setting
Return Type
String !
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
extra-index-url
func (m *myModule) example(ctx context.Context) string {
return dag.
PythonSdk().
ExtraIndexUrl(ctx)
}
@function
async def example() -> str:
return await (
dag.python_sdk()
.extra_index_url()
)
@func()
async example(): Promise<string> {
return dag
.pythonSdk()
.extraIndexUrl()
}
withUvVersion() 🔗
Override the uv version
Needs to be called before Load. Enables uv if not already enabled.
Return Type
PythonSdk !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
version | String ! | - | The uv version |
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
with-uv-version --version string
func (m *myModule) example(version string) *PythonSdk {
return dag.
PythonSdk().
WithUvVersion(version)
}
@function
def example(version: str) -> dag.PythonSdk:
return (
dag.python_sdk()
.with_uv_version(version)
)
@func()
example(version: string): PythonSdk {
return dag
.pythonSdk()
.withUvVersion(version)
}
addNewFile() 🔗
AddNewFile adds a new file, with contents, to the module’s source.
Return Type
Void !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
name | String ! | - | No description provided |
contents | String ! | - | No description provided |
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
add-new-file --name string --contents string
func (m *myModule) example(ctx context.Context, name string, contents string) {
return dag.
PythonSdk().
AddNewFile(ctx, name, contents)
}
@function
async def example(name: str, contents: str) -> None:
return await (
dag.python_sdk()
.add_new_file(name, contents)
)
@func()
async example(name: string, contents: string): Promise<void> {
return dag
.pythonSdk()
.addNewFile(name, contents)
}
addFile() 🔗
AddFile adds a file to the module’s source.
Return Type
Void !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
name | String ! | - | No description provided |
file | File ! | - | No description provided |
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
add-file --name string --file file:path
func (m *myModule) example(ctx context.Context, name string, file *File) {
return dag.
PythonSdk().
AddFile(ctx, name, file)
}
@function
async def example(name: str, file: dagger.File) -> None:
return await (
dag.python_sdk()
.add_file(name, file)
)
@func()
async example(name: string, file: File): Promise<void> {
return dag
.pythonSdk()
.addFile(name, file)
}
getFile() 🔗
GetFile returns a file from the module’s source.
Return Type
File !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
name | String ! | - | No description provided |
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
get-file --name string
func (m *myModule) example(name string) *File {
return dag.
PythonSdk().
GetFile(name)
}
@function
def example(name: str) -> dagger.File:
return (
dag.python_sdk()
.get_file(name)
)
@func()
example(name: string): File {
return dag
.pythonSdk()
.getFile(name)
}
useUvLock() 🔗
UseUvLock returns true if the runtime should expect a uv.lock file.
Return Type
Boolean !
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
use-uv-lock
func (m *myModule) example(ctx context.Context) bool {
return dag.
PythonSdk().
UseUvLock(ctx)
}
@function
async def example() -> bool:
return await (
dag.python_sdk()
.use_uv_lock()
)
@func()
async example(): Promise<boolean> {
return dag
.pythonSdk()
.useUvLock()
}
addDirectory() 🔗
AddDirectory adds a directory to the module’s source.
Return Type
Void !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
name | String ! | - | No description provided |
dir | Directory ! | - | No description provided |
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
add-directory --name string --dir DIR_PATH
func (m *myModule) example(ctx context.Context, name string, dir *Directory) {
return dag.
PythonSdk().
AddDirectory(ctx, name, dir)
}
@function
async def example(name: str, dir: dagger.Directory) -> None:
return await (
dag.python_sdk()
.add_directory(name, dir)
)
@func()
async example(name: string, dir: Directory): Promise<void> {
return dag
.pythonSdk()
.addDirectory(name, dir)
}
source() 🔗
We could use modSource.Directory(“”) but we’ll need to use the context directory in GeneratedCode later, so rather than trying to replace the source directory in the context directory, we’ll just use the context directory with subpath everywhere.
Return Type
Directory !
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
source
func (m *myModule) example() *Directory {
return dag.
PythonSdk().
Source()
}
@function
def example() -> dagger.Directory:
return (
dag.python_sdk()
.source()
)
@func()
example(): Directory {
return dag
.pythonSdk()
.source()
}
codegen() 🔗
Generated code for the Python module
Return Type
GeneratedCode !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
modSource | ModuleSource ! | - | No description provided |
introspectionJson | File ! | - | No description provided |
Example
echo 'Custom types are not supported in shell examples'
func (m *myModule) example(modSource *ModuleSource, introspectionJson *File) *GeneratedCode {
return dag.
PythonSdk().
Codegen(modSource, introspectionJson)
}
@function
def example(mod_source: dag.ModuleSource, introspection_json: dagger.File) -> dag.GeneratedCode:
return (
dag.python_sdk()
.codegen(mod_source, introspection_json)
)
@func()
example(modSource: ModuleSource, introspectionJson: File): GeneratedCode {
return dag
.pythonSdk()
.codegen(modSource, introspectionJson)
}
moduleRuntime() 🔗
Container for executing the Python module runtime
Return Type
Container !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
modSource | ModuleSource ! | - | No description provided |
introspectionJson | File ! | - | No description provided |
Example
echo 'Custom types are not supported in shell examples'
func (m *myModule) example(modSource *ModuleSource, introspectionJson *File) *Container {
return dag.
PythonSdk().
ModuleRuntime(modSource, introspectionJson)
}
@function
def example(mod_source: dag.ModuleSource, introspection_json: dagger.File) -> dagger.Container:
return (
dag.python_sdk()
.module_runtime(mod_source, introspection_json)
)
@func()
example(modSource: ModuleSource, introspectionJson: File): Container {
return dag
.pythonSdk()
.moduleRuntime(modSource, introspectionJson)
}
common() 🔗
Common steps for the ModuleRuntime and Codegen functions
Return Type
PythonSdk !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
modSource | ModuleSource ! | - | No description provided |
introspectionJson | File ! | - | No description provided |
Example
echo 'Custom types are not supported in shell examples'
func (m *myModule) example(modSource *ModuleSource, introspectionJson *File) *PythonSdk {
return dag.
PythonSdk().
Common(modSource, introspectionJson)
}
@function
def example(mod_source: dag.ModuleSource, introspection_json: dagger.File) -> dag.PythonSdk:
return (
dag.python_sdk()
.common(mod_source, introspection_json)
)
@func()
example(modSource: ModuleSource, introspectionJson: File): PythonSdk {
return dag
.pythonSdk()
.common(modSource, introspectionJson)
}
load() 🔗
Get all the needed information from the module’s metadata and source files
Return Type
PythonSdk !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
modSource | ModuleSource ! | - | No description provided |
Example
echo 'Custom types are not supported in shell examples'
func (m *myModule) example(modSource *ModuleSource) *PythonSdk {
return dag.
PythonSdk().
Load(modSource)
}
@function
def example(mod_source: dag.ModuleSource) -> dag.PythonSdk:
return (
dag.python_sdk()
.load(mod_source)
)
@func()
example(modSource: ModuleSource): PythonSdk {
return dag
.pythonSdk()
.load(modSource)
}
withBase() 🔗
Initialize the base Python container
Workdir is set to the module’s source directory.
Return Type
PythonSdk !
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
with-base
func (m *myModule) example() *PythonSdk {
return dag.
PythonSdk().
WithBase()
}
@function
def example() -> dag.PythonSdk:
return (
dag.python_sdk()
.with_base()
)
@func()
example(): PythonSdk {
return dag
.pythonSdk()
.withBase()
}
withTemplate() 🔗
Add the template files to skaffold a new module
The following files are added: - /runtime - /pyproject.toml - /src//init.py - /src//main.py
Return Type
PythonSdk !
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
with-template
func (m *myModule) example() *PythonSdk {
return dag.
PythonSdk().
WithTemplate()
}
@function
def example() -> dag.PythonSdk:
return (
dag.python_sdk()
.with_template()
)
@func()
example(): PythonSdk {
return dag
.pythonSdk()
.withTemplate()
}
withSdk() 🔗
Add the SDK package to the source directory
This includes regenerating the client bindings for the current API schema (codegen).
Return Type
PythonSdk !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
introspectionJson | File ! | - | No description provided |
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
with-sdk --introspection-json file:path
func (m *myModule) example(introspectionJson *File) *PythonSdk {
return dag.
PythonSdk().
WithSdk(introspectionJson)
}
@function
def example(introspection_json: dagger.File) -> dag.PythonSdk:
return (
dag.python_sdk()
.with_sdk(introspection_json)
)
@func()
example(introspectionJson: File): PythonSdk {
return dag
.pythonSdk()
.withSdk(introspectionJson)
}
withSource() 🔗
Add the module’s source code
Return Type
PythonSdk !
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
with-source
func (m *myModule) example() *PythonSdk {
return dag.
PythonSdk().
WithSource()
}
@function
def example() -> dag.PythonSdk:
return (
dag.python_sdk()
.with_source()
)
@func()
example(): PythonSdk {
return dag
.pythonSdk()
.withSource()
}
withUpdates() 🔗
Make any updates to current source
Return Type
PythonSdk !
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
with-updates
func (m *myModule) example() *PythonSdk {
return dag.
PythonSdk().
WithUpdates()
}
@function
def example() -> dag.PythonSdk:
return (
dag.python_sdk()
.with_updates()
)
@func()
example(): PythonSdk {
return dag
.pythonSdk()
.withUpdates()
}
withInstall() 🔗
Install the module’s package and dependencies
Return Type
PythonSdk !
Example
dagger -m github.com/franela/dagger/sdk/python/runtime@717788d820fed40deeb8f8476e21627352926bfc call \
with-install
func (m *myModule) example() *PythonSdk {
return dag.
PythonSdk().
WithInstall()
}
@function
def example() -> dag.PythonSdk:
return (
dag.python_sdk()
.with_install()
)
@func()
example(): PythonSdk {
return dag
.pythonSdk()
.withInstall()
}