Dagger
Search

python-sdk-dev

The Python SDK's development module.

Installation

dagger install github.com/helderco/dagger/sdk/python/dev@170038cbfd041246a4c36ca67a405d77524d660f

Entrypoint

Return Type
PythonSdkDev !
Arguments
NameTypeDefault ValueDescription
sourceDirectory -Directory with sources
containerContainer nullBase container
Example
dagger -m github.com/helderco/dagger/sdk/python/dev@170038cbfd041246a4c36ca67a405d77524d660f call \
func (m *myModule) example() *PythonSdkDev  {
	return dag.
			PythonSdkDev()
}
@function
def example() -> dag.PythonSdkDev:
	return (
		dag.python_sdk_dev()
	)
@func()
example(): PythonSdkDev {
	return dag
		.pythonSdkDev()
}

Types

PythonSdkDevDocs 🔗

Manage the reference documentation (Sphinx).

build() 🔗

Build the documentation.

Return Type
Directory !
Example
dagger -m github.com/helderco/dagger/sdk/python/dev@170038cbfd041246a4c36ca67a405d77524d660f call \
 docs \
 build
func (m *myModule) example() *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/helderco/dagger/sdk/python/dev@170038cbfd041246a4c36ca67a405d77524d660f call \
 docs \
 preview --bind integer
func (m *myModule) example(bind int) *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)
}

PythonSdkDevTestSuite 🔗

Run the test suite.

default() 🔗

Run python tests.

Return Type
Container !
Example
dagger -m github.com/helderco/dagger/sdk/python/dev@170038cbfd041246a4c36ca67a405d77524d660f call \
 test \
 default
func (m *myModule) example() *Container  {
	return dag.
			PythonSdkDev().
			Test().
			Default()
}
@function
def example() -> dagger.Container:
	return (
		dag.python_sdk_dev()
		.test()
		.default()
	)
@func()
example(): Container {
	return dag
		.pythonSdkDev()
		.test()
		.default()
}

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 null_EXPERIMENTAL_DAGGER_RUNNER_HOST value
Example
dagger -m github.com/helderco/dagger/sdk/python/dev@170038cbfd041246a4c36ca67a405d77524d660f call \
 test \
 provision --cli-bin file:path
func (m *myModule) example(cliBin *File) *Container  {
	return dag.
			PythonSdkDev().
			Test().
			Provision(cliBin)
}
@function
def example(cli_bin: dagger.File) -> dagger.Container:
	return (
		dag.python_sdk_dev()
		.test()
		.provision(cli_bin)
	)
@func()
example(cliBin: File): Container {
	return dag
		.pythonSdkDev()
		.test()
		.provision(cliBin)
}

run() 🔗

Run the pytest command.

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
args[String ! ] !-Arguments to pass to pytest
Example
dagger -m github.com/helderco/dagger/sdk/python/dev@170038cbfd041246a4c36ca67a405d77524d660f call \
 test \
 run --args string1 --args string2
func (m *myModule) example(args []string) *Container  {
	return dag.
			PythonSdkDev().
			Test().
			Run(args)
}
@function
def example(args: List[str]) -> dagger.Container:
	return (
		dag.python_sdk_dev()
		.test()
		.run(args)
	)
@func()
example(args: string[]): Container {
	return dag
		.pythonSdkDev()
		.test()
		.run(args)
}

unit() 🔗

Run unit tests.

Return Type
Container !
Example
dagger -m github.com/helderco/dagger/sdk/python/dev@170038cbfd041246a4c36ca67a405d77524d660f call \
 test \
 unit
func (m *myModule) example() *Container  {
	return dag.
			PythonSdkDev().
			Test().
			Unit()
}
@function
def example() -> dagger.Container:
	return (
		dag.python_sdk_dev()
		.test()
		.unit()
	)
@func()
example(): Container {
	return dag
		.pythonSdkDev()
		.test()
		.unit()
}

PythonSdkDev 🔗

The Python SDK's development module.

container() 🔗

Container to run commands in

Return Type
Container !
Example
dagger -m github.com/helderco/dagger/sdk/python/dev@170038cbfd041246a4c36ca67a405d77524d660f call \
 container
func (m *myModule) example() *Container  {
	return dag.
			PythonSdkDev().
			Container()
}
@function
def example() -> dagger.Container:
	return (
		dag.python_sdk_dev()
		.container()
	)
@func()
example(): Container {
	return dag
		.pythonSdkDev()
		.container()
}

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/helderco/dagger/sdk/python/dev@170038cbfd041246a4c36ca67a405d77524d660f call \
 build --version string
func (m *myModule) example(version string) *Container  {
	return dag.
			PythonSdkDev().
			Build(version)
}
@function
def example(version: str) -> dagger.Container:
	return (
		dag.python_sdk_dev()
		.build(version)
	)
@func()
example(version: string): Container {
	return dag
		.pythonSdkDev()
		.build(version)
}

docs() 🔗

Preview the reference documentation.

Return Type
PythonSdkDevDocs !
Example
dagger -m github.com/helderco/dagger/sdk/python/dev@170038cbfd041246a4c36ca67a405d77524d660f call \
 docs
func (m *myModule) example() *PythonSdkDevDocs  {
	return dag.
			PythonSdkDev().
			Docs()
}
@function
def example() -> dag.PythonSdkDevDocs:
	return (
		dag.python_sdk_dev()
		.docs()
	)
@func()
example(): PythonSdkDevDocs {
	return dag
		.pythonSdkDev()
		.docs()
}

format() 🔗

Format source files.

Return Type
Directory !
Arguments
NameTypeDefault ValueDescription
paths[String ! ] ![]List of files or directories to check
Example
dagger -m github.com/helderco/dagger/sdk/python/dev@170038cbfd041246a4c36ca67a405d77524d660f call \
 format --paths string1 --paths string2
func (m *myModule) example(paths []string) *Directory  {
	return dag.
			PythonSdkDev().
			Format(paths)
}
@function
def example(paths: List[str]) -> dagger.Directory:
	return (
		dag.python_sdk_dev()
		.format(paths)
	)
@func()
example(paths: string[]): Directory {
	return dag
		.pythonSdkDev()
		.format(paths)
}

generate() 🔗

Generate the client bindings for the API.

Return Type
Directory !
Arguments
NameTypeDefault ValueDescription
introspectionJsonFile !-Result of the introspection query
Example
dagger -m github.com/helderco/dagger/sdk/python/dev@170038cbfd041246a4c36ca67a405d77524d660f call \
 generate --introspection-json file:path
func (m *myModule) example(introspectionJson *File) *Directory  {
	return dag.
			PythonSdkDev().
			Generate(introspectionJson)
}
@function
def example(introspection_json: dagger.File) -> dagger.Directory:
	return (
		dag.python_sdk_dev()
		.generate(introspection_json)
	)
@func()
example(introspectionJson: File): Directory {
	return dag
		.pythonSdkDev()
		.generate(introspectionJson)
}

lint() 🔗

Check for linting errors.

Return Type
String !
Arguments
NameTypeDefault ValueDescription
paths[String ! ] nullList of files or directories to check
Example
dagger -m github.com/helderco/dagger/sdk/python/dev@170038cbfd041246a4c36ca67a405d77524d660f call \
 lint
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			PythonSdkDev().
			Lint(ctx)
}
@function
async def example() -> str:
	return await (
		dag.python_sdk_dev()
		.lint()
	)
@func()
async example(): Promise<string> {
	return dag
		.pythonSdkDev()
		.lint()
}

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/helderco/dagger/sdk/python/dev@170038cbfd041246a4c36ca67a405d77524d660f call \
 publish --token env:MYSECRET --version string --url string
func (m *myModule) example(token *Secret, version string, url string) *Container  {
	return dag.
			PythonSdkDev().
			Publish(token, version, url)
}
@function
def example(token: dagger.Secret, version: str, url: str) -> dagger.Container:
	return (
		dag.python_sdk_dev()
		.publish(token, version, url)
	)
@func()
example(token: Secret, version: string, url: string): Container {
	return dag
		.pythonSdkDev()
		.publish(token, version, url)
}

supportedVersions() 🔗

Supported Python versions.

Return Type
[String ! ] !
Example
dagger -m github.com/helderco/dagger/sdk/python/dev@170038cbfd041246a4c36ca67a405d77524d660f call \
 supported-versions
func (m *myModule) example(ctx context.Context) []string  {
	return dag.
			PythonSdkDev().
			SupportedVersions(ctx)
}
@function
async def example() -> List[str]:
	return await (
		dag.python_sdk_dev()
		.supported_versions()
	)
@func()
async example(): Promise<string[]> {
	return dag
		.pythonSdkDev()
		.supportedVersions()
}

test() 🔗

Run the test suite.

Return Type
PythonSdkDevTestSuite !
Arguments
NameTypeDefault ValueDescription
versionString nullPython version to test against
Example
dagger -m github.com/helderco/dagger/sdk/python/dev@170038cbfd041246a4c36ca67a405d77524d660f call \
 test
func (m *myModule) example() *PythonSdkDevTestSuite  {
	return dag.
			PythonSdkDev().
			Test()
}
@function
def example() -> dag.PythonSdkDevTestSuite:
	return (
		dag.python_sdk_dev()
		.test()
	)
@func()
example(): PythonSdkDevTestSuite {
	return dag
		.pythonSdkDev()
		.test()
}

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/helderco/dagger/sdk/python/dev@170038cbfd041246a4c36ca67a405d77524d660f call \
 test-publish --token env:MYSECRET --version string
func (m *myModule) example(token *Secret, version string) *Container  {
	return dag.
			PythonSdkDev().
			TestPublish(token, version)
}
@function
def example(token: dagger.Secret, version: str) -> dagger.Container:
	return (
		dag.python_sdk_dev()
		.test_publish(token, version)
	)
@func()
example(token: Secret, version: string): Container {
	return dag
		.pythonSdkDev()
		.testPublish(token, version)
}

testVersions() 🔗

Run the test suite for all supported versions.

Return Type
[PythonSdkDevTestSuite ! ] !
Example
dagger -m github.com/helderco/dagger/sdk/python/dev@170038cbfd041246a4c36ca67a405d77524d660f call \
 test-versions
func (m *myModule) example() []*PythonSdkDevTestSuite  {
	return dag.
			PythonSdkDev().
			TestVersions()
}
@function
def example() -> List[dag.PythonSdkDevTestSuite]:
	return (
		dag.python_sdk_dev()
		.test_versions()
	)
@func()
example(): PythonSdkDevTestSuite[] {
	return dag
		.pythonSdkDev()
		.testVersions()
}

typecheck() 🔗

Run the type checker (mypy).

Return Type
String !
Example
dagger -m github.com/helderco/dagger/sdk/python/dev@170038cbfd041246a4c36ca67a405d77524d660f call \
 typecheck
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			PythonSdkDev().
			Typecheck(ctx)
}
@function
async def example() -> str:
	return await (
		dag.python_sdk_dev()
		.typecheck()
	)
@func()
async example(): Promise<string> {
	return dag
		.pythonSdkDev()
		.typecheck()
}

withContainer() 🔗

Replace container.

Return Type
PythonSdkDev !
Arguments
NameTypeDefault ValueDescription
ctrContainer !-An OCI-compatible container, also known as a Docker container.
Example
dagger -m github.com/helderco/dagger/sdk/python/dev@170038cbfd041246a4c36ca67a405d77524d660f call \
 with-container --ctr IMAGE:TAG
func (m *myModule) example(ctr *Container) *PythonSdkDev  {
	return dag.
			PythonSdkDev().
			WithContainer(ctr)
}
@function
def example(ctr: dagger.Container) -> dag.PythonSdkDev:
	return (
		dag.python_sdk_dev()
		.with_container(ctr)
	)
@func()
example(ctr: Container): PythonSdkDev {
	return dag
		.pythonSdkDev()
		.withContainer(ctr)
}

withDirectory() 🔗

Mount a directory on the base container.

Return Type
PythonSdkDev !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-The directory to add
Example
dagger -m github.com/helderco/dagger/sdk/python/dev@170038cbfd041246a4c36ca67a405d77524d660f call \
 with-directory --source DIR_PATH
func (m *myModule) example(source *Directory) *PythonSdkDev  {
	return dag.
			PythonSdkDev().
			WithDirectory(source)
}
@function
def example(source: dagger.Directory) -> dag.PythonSdkDev:
	return (
		dag.python_sdk_dev()
		.with_directory(source)
	)
@func()
example(source: Directory): PythonSdkDev {
	return dag
		.pythonSdkDev()
		.withDirectory(source)
}