python-sdk-dev
The Python SDK's development module.
Installation
dagger install github.com/dagger/dagger/sdk/python/dev@c3ab515efcb3409035fa01486ede16c059abad61
Entrypoint
Return Type
PythonSdkDev !
Arguments
Name | Type | Description |
---|---|---|
source | Directory ! | Directory with sources |
container | Container | Base container |
Example
dagger -m github.com/dagger/dagger/sdk/python/dev@c3ab515efcb3409035fa01486ede16c059abad61 call \
--source DIR_PATH
func (m *myModule) example(source *Directory) *PythonSdkDev {
return dag.
PythonSdkDev(source)
}
@function
def example(source: dagger.Directory, ) -> dag.PythonSdkDev:
return (
dag.python_sdk_dev(source)
)
@func()
example(source: Directory, ): PythonSdkDev {
return dag
.pythonSdkDev(source)
}
Types
PythonSdkDevDocs 🔗
Manage the reference documentation (Sphinx).
build() 🔗
Build the documentation.
Return Type
Directory !
Example
dagger -m github.com/dagger/dagger/sdk/python/dev@c3ab515efcb3409035fa01486ede16c059abad61 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
Name | Type | Default Value | Description |
---|---|---|---|
bind | Integer ! | 8000 | The port to bind the web preview for the built docs |
Example
dagger -m github.com/dagger/dagger/sdk/python/dev@c3ab515efcb3409035fa01486ede16c059abad61 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.
run() 🔗
Run the pytest command.
Return Type
Container !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
args | [String ! ] ! | - | Arguments to pass to pytest |
Example
dagger -m github.com/dagger/dagger/sdk/python/dev@c3ab515efcb3409035fa01486ede16c059abad61 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)
}
default() 🔗
Run python tests.
Return Type
Container !
Example
dagger -m github.com/dagger/dagger/sdk/python/dev@c3ab515efcb3409035fa01486ede16c059abad61 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()
}
unit() 🔗
Run unit tests.
Return Type
Container !
Example
dagger -m github.com/dagger/dagger/sdk/python/dev@c3ab515efcb3409035fa01486ede16c059abad61 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()
}
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
Name | Type | Default Value | Description |
---|---|---|---|
cliBin | File ! | - | Dagger binary to use for test |
runnerHost | String | null | _EXPERIMENTAL_DAGGER_RUNNER_HOST value |
Example
dagger -m github.com/dagger/dagger/sdk/python/dev@c3ab515efcb3409035fa01486ede16c059abad61 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)
}
PythonSdkDev 🔗
The Python SDK's development module.
container() 🔗
Container to run commands in
Return Type
Container !
Example
dagger -m github.com/dagger/dagger/sdk/python/dev@c3ab515efcb3409035fa01486ede16c059abad61 call \
--source DIR_PATH container
func (m *myModule) example(source *Directory) *Container {
return dag.
PythonSdkDev(source).
Container()
}
@function
def example(source: dagger.Directory, ) -> dagger.Container:
return (
dag.python_sdk_dev(source)
.container()
)
@func()
example(source: Directory, ): Container {
return dag
.pythonSdkDev(source)
.container()
}
supportedVersions() 🔗
Supported Python versions.
Return Type
[String ! ] !
Example
dagger -m github.com/dagger/dagger/sdk/python/dev@c3ab515efcb3409035fa01486ede16c059abad61 call \
--source DIR_PATH supported-versions
func (m *myModule) example(ctx context.Context, source *Directory) []string {
return dag.
PythonSdkDev(source).
SupportedVersions(ctx)
}
@function
async def example(source: dagger.Directory, ) -> List[str]:
return await (
dag.python_sdk_dev(source)
.supported_versions()
)
@func()
async example(source: Directory, ): Promise<string[]> {
return dag
.pythonSdkDev(source)
.supportedVersions()
}
withDirectory() 🔗
Mount a directory on the base container.
Return Type
PythonSdkDev !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
source | Directory ! | - | The directory to add |
Example
dagger -m github.com/dagger/dagger/sdk/python/dev@c3ab515efcb3409035fa01486ede16c059abad61 call \
--source DIR_PATH with-directory --source DIR_PATH
func (m *myModule) example(source *Directory, source1 *Directory) *PythonSdkDev {
return dag.
PythonSdkDev(source).
WithDirectory(source1)
}
@function
def example(source: dagger.Directory, source1: dagger.Directory) -> dag.PythonSdkDev:
return (
dag.python_sdk_dev(source)
.with_directory(source1)
)
@func()
example(source: Directory, source1: Directory): PythonSdkDev {
return dag
.pythonSdkDev(source)
.withDirectory(source1)
}
withContainer() 🔗
Replace container.
Return Type
PythonSdkDev !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
ctr | Container ! | - | An OCI-compatible container, also known as a Docker container. |
Example
dagger -m github.com/dagger/dagger/sdk/python/dev@c3ab515efcb3409035fa01486ede16c059abad61 call \
--source DIR_PATH with-container --ctr IMAGE:TAG
func (m *myModule) example(source *Directory, ctr *Container) *PythonSdkDev {
return dag.
PythonSdkDev(source).
WithContainer(ctr)
}
@function
def example(source: dagger.Directory, ctr: dagger.Container) -> dag.PythonSdkDev:
return (
dag.python_sdk_dev(source)
.with_container(ctr)
)
@func()
example(source: Directory, ctr: Container): PythonSdkDev {
return dag
.pythonSdkDev(source)
.withContainer(ctr)
}
generate() 🔗
Generate the client bindings for the API.
Return Type
Directory !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
introspectionJson | File ! | - | Result of the introspection query |
Example
dagger -m github.com/dagger/dagger/sdk/python/dev@c3ab515efcb3409035fa01486ede16c059abad61 call \
--source DIR_PATH generate --introspection-json file:path
func (m *myModule) example(source *Directory, introspectionJson *File) *Directory {
return dag.
PythonSdkDev(source).
Generate(introspectionJson)
}
@function
def example(source: dagger.Directory, introspection_json: dagger.File) -> dagger.Directory:
return (
dag.python_sdk_dev(source)
.generate(introspection_json)
)
@func()
example(source: Directory, introspectionJson: File): Directory {
return dag
.pythonSdkDev(source)
.generate(introspectionJson)
}
typecheck() 🔗
Run the type checker (mypy).
Return Type
String !
Example
dagger -m github.com/dagger/dagger/sdk/python/dev@c3ab515efcb3409035fa01486ede16c059abad61 call \
--source DIR_PATH typecheck
func (m *myModule) example(ctx context.Context, source *Directory) string {
return dag.
PythonSdkDev(source).
Typecheck(ctx)
}
@function
async def example(source: dagger.Directory, ) -> str:
return await (
dag.python_sdk_dev(source)
.typecheck()
)
@func()
async example(source: Directory, ): Promise<string> {
return dag
.pythonSdkDev(source)
.typecheck()
}
lint() 🔗
Check for linting errors.
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
paths | [String ! ] | null | List of files or directories to check |
Example
dagger -m github.com/dagger/dagger/sdk/python/dev@c3ab515efcb3409035fa01486ede16c059abad61 call \
--source DIR_PATH lint
func (m *myModule) example(ctx context.Context, source *Directory) string {
return dag.
PythonSdkDev(source).
Lint(ctx)
}
@function
async def example(source: dagger.Directory, ) -> str:
return await (
dag.python_sdk_dev(source)
.lint()
)
@func()
async example(source: Directory, ): Promise<string> {
return dag
.pythonSdkDev(source)
.lint()
}
format() 🔗
Format source files.
Return Type
Directory !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
paths | [String ! ] ! | [] | List of files or directories to check |
Example
dagger -m github.com/dagger/dagger/sdk/python/dev@c3ab515efcb3409035fa01486ede16c059abad61 call \
--source DIR_PATH format --paths string1 --paths string2
func (m *myModule) example(source *Directory, paths []string) *Directory {
return dag.
PythonSdkDev(source).
Format(paths)
}
@function
def example(source: dagger.Directory, paths: List[str]) -> dagger.Directory:
return (
dag.python_sdk_dev(source)
.format(paths)
)
@func()
example(source: Directory, paths: string[]): Directory {
return dag
.pythonSdkDev(source)
.format(paths)
}
test() 🔗
Run the test suite.
Return Type
PythonSdkDevTestSuite !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
version | String | null | Python version to test against |
Example
dagger -m github.com/dagger/dagger/sdk/python/dev@c3ab515efcb3409035fa01486ede16c059abad61 call \
--source DIR_PATH test
func (m *myModule) example(source *Directory) *PythonSdkDevTestSuite {
return dag.
PythonSdkDev(source).
Test()
}
@function
def example(source: dagger.Directory, ) -> dag.PythonSdkDevTestSuite:
return (
dag.python_sdk_dev(source)
.test()
)
@func()
example(source: Directory, ): PythonSdkDevTestSuite {
return dag
.pythonSdkDev(source)
.test()
}
testVersions() 🔗
Run the test suite for all supported versions.
Return Type
[PythonSdkDevTestSuite ! ] !
Example
dagger -m github.com/dagger/dagger/sdk/python/dev@c3ab515efcb3409035fa01486ede16c059abad61 call \
--source DIR_PATH test-versions
func (m *myModule) example(source *Directory) []*PythonSdkDevTestSuite {
return dag.
PythonSdkDev(source).
TestVersions()
}
@function
def example(source: dagger.Directory, ) -> List[dag.PythonSdkDevTestSuite]:
return (
dag.python_sdk_dev(source)
.test_versions()
)
@func()
example(source: Directory, ): PythonSdkDevTestSuite[] {
return dag
.pythonSdkDev(source)
.testVersions()
}
build() 🔗
Build Python SDK package for distribution.
Return Type
Directory !
Example
dagger -m github.com/dagger/dagger/sdk/python/dev@c3ab515efcb3409035fa01486ede16c059abad61 call \
--source DIR_PATH build
func (m *myModule) example(source *Directory) *Directory {
return dag.
PythonSdkDev(source).
Build()
}
@function
def example(source: dagger.Directory, ) -> dagger.Directory:
return (
dag.python_sdk_dev(source)
.build()
)
@func()
example(source: Directory, ): Directory {
return dag
.pythonSdkDev(source)
.build()
}
docs() 🔗
Preview the reference documentation.
Return Type
PythonSdkDevDocs !
Example
dagger -m github.com/dagger/dagger/sdk/python/dev@c3ab515efcb3409035fa01486ede16c059abad61 call \
--source DIR_PATH docs
func (m *myModule) example(source *Directory) *PythonSdkDevDocs {
return dag.
PythonSdkDev(source).
Docs()
}
@function
def example(source: dagger.Directory, ) -> dag.PythonSdkDevDocs:
return (
dag.python_sdk_dev(source)
.docs()
)
@func()
example(source: Directory, ): PythonSdkDevDocs {
return dag
.pythonSdkDev(source)
.docs()
}