python-sdk-dev
The Python SDK's development module.
Installation
dagger install github.com/dagger/dagger/sdk/python/dev@v0.13.3
Entrypoint
Return Type
PythonSdkDev !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
source | Directory | - | Directory with sources |
container | Container | null | Base container |
Example
dagger -m github.com/dagger/dagger/sdk/python/dev@d3a02170c96d4d81343dbbcd5c555ba6b8d38b45 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/dagger/dagger/sdk/python/dev@d3a02170c96d4d81343dbbcd5c555ba6b8d38b45 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@d3a02170c96d4d81343dbbcd5c555ba6b8d38b45 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@d3a02170c96d4d81343dbbcd5c555ba6b8d38b45 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@d3a02170c96d4d81343dbbcd5c555ba6b8d38b45 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@d3a02170c96d4d81343dbbcd5c555ba6b8d38b45 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@d3a02170c96d4d81343dbbcd5c555ba6b8d38b45 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@d3a02170c96d4d81343dbbcd5c555ba6b8d38b45 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()
}
supportedVersions() 🔗
Supported Python versions.
Return Type
[String ! ] !
Example
dagger -m github.com/dagger/dagger/sdk/python/dev@d3a02170c96d4d81343dbbcd5c555ba6b8d38b45 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()
}
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@d3a02170c96d4d81343dbbcd5c555ba6b8d38b45 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)
}
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@d3a02170c96d4d81343dbbcd5c555ba6b8d38b45 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)
}
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@d3a02170c96d4d81343dbbcd5c555ba6b8d38b45 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)
}
typecheck() 🔗
Run the type checker (mypy).
Return Type
String !
Example
dagger -m github.com/dagger/dagger/sdk/python/dev@d3a02170c96d4d81343dbbcd5c555ba6b8d38b45 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()
}
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@d3a02170c96d4d81343dbbcd5c555ba6b8d38b45 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()
}
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@d3a02170c96d4d81343dbbcd5c555ba6b8d38b45 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)
}
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@d3a02170c96d4d81343dbbcd5c555ba6b8d38b45 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()
}
testVersions() 🔗
Run the test suite for all supported versions.
Return Type
[PythonSdkDevTestSuite ! ] !
Example
dagger -m github.com/dagger/dagger/sdk/python/dev@d3a02170c96d4d81343dbbcd5c555ba6b8d38b45 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()
}
build() 🔗
Build Python SDK package for distribution.
Return Type
Directory !
Example
dagger -m github.com/dagger/dagger/sdk/python/dev@d3a02170c96d4d81343dbbcd5c555ba6b8d38b45 call \
build
func (m *myModule) example() *Directory {
return dag.
PythonSdkDev().
Build()
}
@function
def example() -> dagger.Directory:
return (
dag.python_sdk_dev()
.build()
)
@func()
example(): Directory {
return dag
.pythonSdkDev()
.build()
}
docs() 🔗
Preview the reference documentation.
Return Type
PythonSdkDevDocs !
Example
dagger -m github.com/dagger/dagger/sdk/python/dev@d3a02170c96d4d81343dbbcd5c555ba6b8d38b45 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()
}