Dagger
Search

python-sdk-dev

The Python SDK's development module.

Installation

dagger install github.com/shykes/dagger/sdk/python/dev@d26316bc7b9feed83a341d7a3c17ce2080948832

Entrypoint

Return Type
PythonSdkDev !
Arguments
NameTypeDefault ValueDescription
sourceDirectory -Directory with sources
containerContainer nullBase container
Example
func (m *myModule) example() *PythonSdkDev  {
	return dag.
			PythonSdkDev()
}

Types

PythonSdkDevDocs πŸ”—

Manage the reference documentation (Sphinx).

build() πŸ”—

Build the documentation.

Return Type
Directory !
Example
func (m *myModule) 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
func (m *myModule) example(bind int) *Service  {
	return dag.
			PythonSdkDev().
			Docs().
			Preview(bind)
}

PythonSdkDevTestSuite πŸ”—

Run the test suite.

default() πŸ”—

Run python tests.

Return Type
Container !
Example
func (m *myModule) 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
func (m *myModule) 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
func (m *myModule) example(args []string) *Container  {
	return dag.
			PythonSdkDev().
			Test().
			Run(args)
}

unit() πŸ”—

Run unit tests.

Return Type
Container !
Example
func (m *myModule) example() *Container  {
	return dag.
			PythonSdkDev().
			Test().
			Unit()
}

PythonSdkDev πŸ”—

The Python SDK's development module.

container() πŸ”—

Container to run commands in

Return Type
Container !
Example
func (m *myModule) 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
func (m *myModule) example(version string) *Container  {
	return dag.
			PythonSdkDev().
			Build(version)
}

docs() πŸ”—

Preview the reference documentation.

Return Type
PythonSdkDevDocs !
Example
func (m *myModule) 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
func (m *myModule) 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
func (m *myModule) 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
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			PythonSdkDev().
			Lint(ctx)
}

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
func (m *myModule) example(token *Secret, version string, url string) *Container  {
	return dag.
			PythonSdkDev().
			Publish(token, version, url)
}

supportedVersions() πŸ”—

Supported Python versions.

Return Type
[String ! ] !
Example
func (m *myModule) example(ctx context.Context) []string  {
	return dag.
			PythonSdkDev().
			SupportedVersions(ctx)
}

test() πŸ”—

Run the test suite.

Return Type
PythonSdkDevTestSuite !
Arguments
NameTypeDefault ValueDescription
versionString nullPython version to test against
Example
func (m *myModule) 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
func (m *myModule) 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
func (m *myModule) example() []*PythonSdkDevTestSuite  {
	return dag.
			PythonSdkDev().
			TestVersions()
}

typecheck() πŸ”—

Run the type checker (mypy).

Return Type
String !
Example
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			PythonSdkDev().
			Typecheck(ctx)
}

withContainer() πŸ”—

Replace container.

Return Type
PythonSdkDev !
Arguments
NameTypeDefault ValueDescription
ctrContainer !-An OCI-compatible container, also known as a Docker container.
Example
func (m *myModule) 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
func (m *myModule) example(source *Directory) *PythonSdkDev  {
	return dag.
			PythonSdkDev().
			WithDirectory(source)
}