Dagger
Search

python

A toolchain for testing Python applications with automatic OpenTelemetry tracing

Installation

dagger install github.com/dagger/dagger/toolchains/python@b7679681f9418e5950c2c54fa68fa8ed5ee8c645

Entrypoint

Return Type
Python !
Example
dagger -m github.com/dagger/dagger/toolchains/python@b7679681f9418e5950c2c54fa68fa8ed5ee8c645 call \
func (m *MyModule) Example() *dagger.Python  {
	return dag.
			Python()
}
@function
def example() -> dagger.Python:
	return (
		dag.python()
	)
@func()
example(): Python {
	return dag
		.python()
}

Types

Python 🔗

test() 🔗

Test a Python project with pytest and OpenTelemetry tracing.

This function automatically injects pytest_otel for test tracing visibility in Dagger TUI and Dagger Cloud. No configuration required.

The function will: - Use the provided container or default to Wolfi Linux with uv - Install your project dependencies using uv sync - Inject pytest_otel for automatic test tracing - Run pytest with the specified Python version

Return Type
Void !
Arguments
NameTypeDefault ValueDescription
sourceDirectory -No description provided
containerContainer -No description provided
args[String ! ] -No description provided
versionString -No description provided
Example
dagger -m github.com/dagger/dagger/toolchains/python@b7679681f9418e5950c2c54fa68fa8ed5ee8c645 call \
 test
func (m *MyModule) Example(ctx context.Context)   {
	return dag.
			Python().
			Test(ctx)
}
@function
async def example() -> None:
	return await (
		dag.python()
		.test()
	)
@func()
async example(): Promise<void> {
	return dag
		.python()
		.test()
}