Dagger
Search

python-sdk-dev

Toolchain to develop the Dagger Python SDK

Installation

dagger install github.com/shykes/dagger/toolchains/python-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe

Entrypoint

Return Type
PythonSdkDev !
Arguments
NameTypeDefault ValueDescription
workspaceDirectory -A workspace containing the SDK source code and other relevant files
sourcePathString !"sdk/python"No description provided
Example
dagger -m github.com/shykes/dagger/toolchains/python-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string
func (m *MyModule) Example(sourcePath string) *dagger.PythonSdkDev  {
	return dag.
			PythonSdkDev(sourcePath)
}
@function
def example(source_path: str) -> dagger.PythonSdkDev:
	return (
		dag.python_sdk_dev(source_path)
	)
@func()
example(sourcePath: string): PythonSdkDev {
	return dag
		.pythonSdkDev(sourcePath)
}

Types

PythonSdkDev 🔗

A toolchain to develop the Dagger Python SDK

devContainer() 🔗

Python container to develop Python SDK

Return Type
Container !
Example
dagger -m github.com/shykes/dagger/toolchains/python-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string dev-container
func (m *MyModule) Example(sourcePath string) *dagger.Container  {
	return dag.
			PythonSdkDev(sourcePath).
			DevContainer()
}
@function
def example(source_path: str) -> dagger.Container:
	return (
		dag.python_sdk_dev(source_path)
		.dev_container()
	)
@func()
example(sourcePath: string): Container {
	return dag
		.pythonSdkDev(sourcePath)
		.devContainer()
}

workspace() 🔗

Return Type
Directory !
Example
dagger -m github.com/shykes/dagger/toolchains/python-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string workspace
func (m *MyModule) Example(sourcePath string) *dagger.Directory  {
	return dag.
			PythonSdkDev(sourcePath).
			Workspace()
}
@function
def example(source_path: str) -> dagger.Directory:
	return (
		dag.python_sdk_dev(source_path)
		.workspace()
	)
@func()
example(sourcePath: string): Directory {
	return dag
		.pythonSdkDev(sourcePath)
		.workspace()
}

sourcePath() 🔗

Return Type
String !
Example
dagger -m github.com/shykes/dagger/toolchains/python-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string source-path
func (m *MyModule) Example(ctx context.Context, sourcePath string) string  {
	return dag.
			PythonSdkDev(sourcePath).
			SourcePath(ctx)
}
@function
async def example(source_path: str) -> str:
	return await (
		dag.python_sdk_dev(source_path)
		.source_path()
	)
@func()
async example(sourcePath: string): Promise<string> {
	return dag
		.pythonSdkDev(sourcePath)
		.sourcePath()
}

supportedVersions() 🔗

Supported Python versions

Return Type
[String ! ] !
Example
dagger -m github.com/shykes/dagger/toolchains/python-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string supported-versions
func (m *MyModule) Example(ctx context.Context, sourcePath string) []string  {
	return dag.
			PythonSdkDev(sourcePath).
			SupportedVersions(ctx)
}
@function
async def example(source_path: str) -> List[str]:
	return await (
		dag.python_sdk_dev(source_path)
		.supported_versions()
	)
@func()
async example(sourcePath: string): Promise<string[]> {
	return dag
		.pythonSdkDev(sourcePath)
		.supportedVersions()
}

lintDocsSnippets() 🔗

Lint the Python snippets in the documentation

Return Type
Void !
Arguments
NameTypeDefault ValueDescription
workspaceDirectory -No description provided
Example
dagger -m github.com/shykes/dagger/toolchains/python-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string lint-docs-snippets
func (m *MyModule) Example(ctx context.Context, sourcePath string)   {
	return dag.
			PythonSdkDev(sourcePath).
			LintDocsSnippets(ctx)
}
@function
async def example(source_path: str) -> None:
	return await (
		dag.python_sdk_dev(source_path)
		.lint_docs_snippets()
	)
@func()
async example(sourcePath: string): Promise<void> {
	return dag
		.pythonSdkDev(sourcePath)
		.lintDocsSnippets()
}

lint() 🔗

Check for linting errors

Return Type
Void !
Arguments
NameTypeDefault ValueDescription
paths[String ! ] ![]List of files or directories to check
Example
dagger -m github.com/shykes/dagger/toolchains/python-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string lint --paths string1 --paths string2
func (m *MyModule) Example(ctx context.Context, sourcePath string, paths []string)   {
	return dag.
			PythonSdkDev(sourcePath).
			Lint(ctx, paths)
}
@function
async def example(source_path: str, paths: List[str]) -> None:
	return await (
		dag.python_sdk_dev(source_path)
		.lint(paths)
	)
@func()
async example(sourcePath: string, paths: string[]): Promise<void> {
	return dag
		.pythonSdkDev(sourcePath)
		.lint(paths)
}

format() 🔗

Format source files

Return Type
Changeset !
Arguments
NameTypeDefault ValueDescription
paths[String ! ] ![]List of files or directories to check
Example
dagger -m github.com/shykes/dagger/toolchains/python-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string format --paths string1 --paths string2
func (m *MyModule) Example(sourcePath string, paths []string) *dagger.Changeset  {
	return dag.
			PythonSdkDev(sourcePath).
			Format(paths)
}
@function
def example(source_path: str, paths: List[str]) -> dagger.Changeset:
	return (
		dag.python_sdk_dev(source_path)
		.format(paths)
	)
@func()
example(sourcePath: string, paths: string[]): Changeset {
	return dag
		.pythonSdkDev(sourcePath)
		.format(paths)
}

typecheck() 🔗

Run the type checker (mypy) FIXME: this is not included as an automated check. Should it?

Return Type
Void !
Example
dagger -m github.com/shykes/dagger/toolchains/python-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string typecheck
func (m *MyModule) Example(ctx context.Context, sourcePath string)   {
	return dag.
			PythonSdkDev(sourcePath).
			Typecheck(ctx)
}
@function
async def example(source_path: str) -> None:
	return await (
		dag.python_sdk_dev(source_path)
		.typecheck()
	)
@func()
async example(sourcePath: string): Promise<void> {
	return dag
		.pythonSdkDev(sourcePath)
		.typecheck()
}

withDirectory() 🔗

Mount a directory on the base container

Return Type
PythonSdkDev !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-The directory to add
Example
dagger -m github.com/shykes/dagger/toolchains/python-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string with-directory --source DIR_PATH
func (m *MyModule) Example(sourcePath string, source *dagger.Directory) *dagger.PythonSdkDev  {
	return dag.
			PythonSdkDev(sourcePath).
			WithDirectory(source)
}
@function
def example(source_path: str, source: dagger.Directory) -> dagger.PythonSdkDev:
	return (
		dag.python_sdk_dev(source_path)
		.with_directory(source)
	)
@func()
example(sourcePath: string, source: Directory): PythonSdkDev {
	return dag
		.pythonSdkDev(sourcePath)
		.withDirectory(source)
}

test() 🔗

Test the Python SDK

Return Type
Void !
Example
dagger -m github.com/shykes/dagger/toolchains/python-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string test
func (m *MyModule) Example(ctx context.Context, sourcePath string)   {
	return dag.
			PythonSdkDev(sourcePath).
			Test(ctx)
}
@function
async def example(source_path: str) -> None:
	return await (
		dag.python_sdk_dev(source_path)
		.test()
	)
@func()
async example(sourcePath: string): Promise<void> {
	return dag
		.pythonSdkDev(sourcePath)
		.test()
}

testSuite() 🔗

TestSuite to run unit and other tests

Return Type
PythonSdkDevTestSuite !
Arguments
NameTypeDefault ValueDescription
versionString -Python version
disableNestedExecBoolean !-Disable nested execution for the test runs
Example
dagger -m github.com/shykes/dagger/toolchains/python-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string test-suite --disable-nested-exec boolean
func (m *MyModule) Example(sourcePath string, disableNestedExec bool) *dagger.PythonSdkDevTestSuite  {
	return dag.
			PythonSdkDev(sourcePath).
			TestSuite(disableNestedExec)
}
@function
def example(source_path: str, disable_nested_exec: bool) -> dagger.PythonSdkDevTestSuite:
	return (
		dag.python_sdk_dev(source_path)
		.test_suite(disable_nested_exec)
	)
@func()
example(sourcePath: string, disableNestedExec: boolean): PythonSdkDevTestSuite {
	return dag
		.pythonSdkDev(sourcePath)
		.testSuite(disableNestedExec)
}

generate() 🔗

Regenerate the core Python client library

Return Type
Changeset !
Example
dagger -m github.com/shykes/dagger/toolchains/python-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string generate
func (m *MyModule) Example(sourcePath string) *dagger.Changeset  {
	return dag.
			PythonSdkDev(sourcePath).
			Generate()
}
@function
def example(source_path: str) -> dagger.Changeset:
	return (
		dag.python_sdk_dev(source_path)
		.generate()
	)
@func()
example(sourcePath: string): Changeset {
	return dag
		.pythonSdkDev(sourcePath)
		.generate()
}

releaseDryRun() 🔗

Test the publishing process

Return Type
Void !
Example
dagger -m github.com/shykes/dagger/toolchains/python-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string release-dry-run
func (m *MyModule) Example(ctx context.Context, sourcePath string)   {
	return dag.
			PythonSdkDev(sourcePath).
			ReleaseDryRun(ctx)
}
@function
async def example(source_path: str) -> None:
	return await (
		dag.python_sdk_dev(source_path)
		.release_dry_run()
	)
@func()
async example(sourcePath: string): Promise<void> {
	return dag
		.pythonSdkDev(sourcePath)
		.releaseDryRun()
}

release() 🔗

Release the Python SDK

Return Type
Void !
Arguments
NameTypeDefault ValueDescription
sourceTagString !-Git tag to release from
dryRunBoolean -No description provided
pypiRepoString -No description provided
pypiTokenSecret -No description provided
Example
dagger -m github.com/shykes/dagger/toolchains/python-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string release --source-tag string
func (m *MyModule) Example(ctx context.Context, sourcePath string, sourceTag string)   {
	return dag.
			PythonSdkDev(sourcePath).
			Release(ctx, sourceTag)
}
@function
async def example(source_path: str, source_tag: str) -> None:
	return await (
		dag.python_sdk_dev(source_path)
		.release(source_tag)
	)
@func()
async example(sourcePath: string, sourceTag: string): Promise<void> {
	return dag
		.pythonSdkDev(sourcePath)
		.release(sourceTag)
}

bump() 🔗

Bump the Python SDK’s Engine dependency

Return Type
Changeset !
Arguments
NameTypeDefault ValueDescription
versionString !-No description provided
Example
dagger -m github.com/shykes/dagger/toolchains/python-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string bump --version string
func (m *MyModule) Example(sourcePath string, version string) *dagger.Changeset  {
	return dag.
			PythonSdkDev(sourcePath).
			Bump(version)
}
@function
def example(source_path: str, version: str) -> dagger.Changeset:
	return (
		dag.python_sdk_dev(source_path)
		.bump(version)
	)
@func()
example(sourcePath: string, version: string): Changeset {
	return dag
		.pythonSdkDev(sourcePath)
		.bump(version)
}

build() 🔗

Build the Python SDK client library package for distribution

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
versionString !"0.0.0"The version for the distribution package
Example
dagger -m github.com/shykes/dagger/toolchains/python-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string build --version string
func (m *MyModule) Example(sourcePath string, version string) *dagger.Container  {
	return dag.
			PythonSdkDev(sourcePath).
			Build(version)
}
@function
def example(source_path: str, version: str) -> dagger.Container:
	return (
		dag.python_sdk_dev(source_path)
		.build(version)
	)
@func()
example(sourcePath: string, version: string): Container {
	return dag
		.pythonSdkDev(sourcePath)
		.build(version)
}

publish() 🔗

Publish Python SDK client library to PyPI

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
tokenSecret !-The token for the upload
versionString !"0.0.0"The version for the distribution package to publish
urlString -The URL of the upload endpoint (empty means PyPI)
Example
dagger -m github.com/shykes/dagger/toolchains/python-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string publish --token env:MYSECRET --version string
func (m *MyModule) Example(sourcePath string, token *dagger.Secret, version string) *dagger.Container  {
	return dag.
			PythonSdkDev(sourcePath).
			Publish(token, version)
}
@function
def example(source_path: str, token: dagger.Secret, version: str) -> dagger.Container:
	return (
		dag.python_sdk_dev(source_path)
		.publish(token, version)
	)
@func()
example(sourcePath: string, token: Secret, version: string): Container {
	return dag
		.pythonSdkDev(sourcePath)
		.publish(token, version)
}

testPublish() 🔗

Test the publishing of the Python SDK client library to TestPyPI

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
tokenSecret !-TestPyPI token
versionString !"0.0.0"The version for the distribution package to publish
Example
dagger -m github.com/shykes/dagger/toolchains/python-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string test-publish --token env:MYSECRET --version string
func (m *MyModule) Example(sourcePath string, token *dagger.Secret, version string) *dagger.Container  {
	return dag.
			PythonSdkDev(sourcePath).
			TestPublish(token, version)
}
@function
def example(source_path: str, token: dagger.Secret, version: str) -> dagger.Container:
	return (
		dag.python_sdk_dev(source_path)
		.test_publish(token, version)
	)
@func()
example(sourcePath: string, token: Secret, version: string): Container {
	return dag
		.pythonSdkDev(sourcePath)
		.testPublish(token, version)
}

docs() 🔗

Preview the reference documentation

Return Type
PythonSdkDevDocs !
Example
dagger -m github.com/shykes/dagger/toolchains/python-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 --source-path string docs
func (m *MyModule) Example(sourcePath string) *dagger.PythonSdkDevDocs  {
	return dag.
			PythonSdkDev(sourcePath).
			Docs()
}
@function
def example(source_path: str) -> dagger.PythonSdkDevDocs:
	return (
		dag.python_sdk_dev(source_path)
		.docs()
	)
@func()
example(sourcePath: string): PythonSdkDevDocs {
	return dag
		.pythonSdkDev(sourcePath)
		.docs()
}

PythonSdkDevTestSuite 🔗

Run the test suite.

run() 🔗

Run the pytest command.

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
args[String ! ] !-Arguments to pass to pytest
Example
dagger -m github.com/shykes/dagger/toolchains/python-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 test-suite --disable-nested-exec boolean \
 run --args string1 --args string2
func (m *MyModule) Example(disableNestedExec bool, args []string) *dagger.Container  {
	return dag.
			PythonSdkDev().
			TestSuite(disableNestedExec).
			Run(args)
}
@function
def example(disable_nested_exec: bool, args: List[str]) -> dagger.Container:
	return (
		dag.python_sdk_dev()
		.test_suite(disable_nested_exec)
		.run(args)
	)
@func()
example(disableNestedExec: boolean, args: string[]): Container {
	return dag
		.pythonSdkDev()
		.testSuite(disableNestedExec)
		.run(args)
}

default() 🔗

Run python tests.

Return Type
Container !
Example
dagger -m github.com/shykes/dagger/toolchains/python-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 test-suite --disable-nested-exec boolean \
 default
func (m *MyModule) Example(disableNestedExec bool) *dagger.Container  {
	return dag.
			PythonSdkDev().
			TestSuite(disableNestedExec).
			Default()
}
@function
def example(disable_nested_exec: bool) -> dagger.Container:
	return (
		dag.python_sdk_dev()
		.test_suite(disable_nested_exec)
		.default()
	)
@func()
example(disableNestedExec: boolean): Container {
	return dag
		.pythonSdkDev()
		.testSuite(disableNestedExec)
		.default()
}

unit() 🔗

Run unit tests.

Return Type
Container !
Example
dagger -m github.com/shykes/dagger/toolchains/python-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 test-suite --disable-nested-exec boolean \
 unit
func (m *MyModule) Example(disableNestedExec bool) *dagger.Container  {
	return dag.
			PythonSdkDev().
			TestSuite(disableNestedExec).
			Unit()
}
@function
def example(disable_nested_exec: bool) -> dagger.Container:
	return (
		dag.python_sdk_dev()
		.test_suite(disable_nested_exec)
		.unit()
	)
@func()
example(disableNestedExec: boolean): Container {
	return dag
		.pythonSdkDev()
		.testSuite(disableNestedExec)
		.unit()
}

provision() 🔗

Test provisioning.

This publishes a cli binary in an ephemeral http server and checks if the SDK can download, extract and run it.

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
cliBinFile !-Dagger binary to use for test
runnerHostString -_EXPERIMENTAL_DAGGER_RUNNER_HOST value
Example
dagger -m github.com/shykes/dagger/toolchains/python-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 test-suite --disable-nested-exec boolean \
 provision --cli-bin file:path
func (m *MyModule) Example(disableNestedExec bool, cliBin *dagger.File) *dagger.Container  {
	return dag.
			PythonSdkDev().
			TestSuite(disableNestedExec).
			Provision(cliBin)
}
@function
def example(disable_nested_exec: bool, cli_bin: dagger.File) -> dagger.Container:
	return (
		dag.python_sdk_dev()
		.test_suite(disable_nested_exec)
		.provision(cli_bin)
	)
@func()
example(disableNestedExec: boolean, cliBin: File): Container {
	return dag
		.pythonSdkDev()
		.testSuite(disableNestedExec)
		.provision(cliBin)
}

PythonSdkDevDocs 🔗

build() 🔗

Build the documentation

Return Type
Directory !
Example
dagger -m github.com/shykes/dagger/toolchains/python-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 docs \
 build
func (m *MyModule) Example() *dagger.Directory  {
	return dag.
			PythonSdkDev().
			Docs().
			Build()
}
@function
def example() -> dagger.Directory:
	return (
		dag.python_sdk_dev()
		.docs()
		.build()
	)
@func()
example(): Directory {
	return dag
		.pythonSdkDev()
		.docs()
		.build()
}

preview() 🔗

Build and preview the documentation in the browser

Return Type
Service !
Arguments
NameTypeDefault ValueDescription
bindInteger !8000The port to bind the web preview for the built docs
Example
dagger -m github.com/shykes/dagger/toolchains/python-sdk-dev@7ec44c64b509793d2a722ebdfef94a77dbcdcefe call \
 docs \
 preview --bind integer
func (m *MyModule) Example(bind int) *dagger.Service  {
	return dag.
			PythonSdkDev().
			Docs().
			Preview(bind)
}
@function
def example(bind: int) -> dagger.Service:
	return (
		dag.python_sdk_dev()
		.docs()
		.preview(bind)
	)
@func()
example(bind: number): Service {
	return dag
		.pythonSdkDev()
		.docs()
		.preview(bind)
}