Dagger
Search

python-uv-ruff

A blueprint module for python projects that use uv and ruff

Installation

dagger install github.com/kpenfound/blueprints/python-uv-ruff@2bb1d301e87cbe218b65c99f4e74618cda252638

Entrypoint

Return Type
PythonUvRuff !
Arguments
NameTypeDefault ValueDescription
sourceDirectory -The source code of the project
baseImageString !"python:3"The base image to use for all environments
Example
dagger -m github.com/kpenfound/blueprints/python-uv-ruff@2bb1d301e87cbe218b65c99f4e74618cda252638 call \
 --base-image string
func (m *MyModule) Example(baseImage string) *dagger.PythonUvRuff  {
	return dag.
			PythonUvRuff(baseImage)
}
@function
def example(base_image: str) -> dagger.PythonUvRuff:
	return (
		dag.python_uv_ruff(base_image)
	)
@func()
example(baseImage: string): PythonUvRuff {
	return dag
		.pythonUvRuff(baseImage)
}

Types

PythonUvRuff 🔗

Dagger module for Python projects.

base() 🔗

Returns the Python base image with the project setup.

Return Type
Container !
Example
dagger -m github.com/kpenfound/blueprints/python-uv-ruff@2bb1d301e87cbe218b65c99f4e74618cda252638 call \
 --base-image string base
func (m *MyModule) Example(baseImage string) *dagger.Container  {
	return dag.
			PythonUvRuff(baseImage).
			Base()
}
@function
def example(base_image: str) -> dagger.Container:
	return (
		dag.python_uv_ruff(base_image)
		.base()
	)
@func()
example(baseImage: string): Container {
	return dag
		.pythonUvRuff(baseImage)
		.base()
}

lint() 🔗

Runs the linter using ruff.

Return Type
String !
Example
dagger -m github.com/kpenfound/blueprints/python-uv-ruff@2bb1d301e87cbe218b65c99f4e74618cda252638 call \
 --base-image string lint
func (m *MyModule) Example(ctx context.Context, baseImage string) string  {
	return dag.
			PythonUvRuff(baseImage).
			Lint(ctx)
}
@function
async def example(base_image: str) -> str:
	return await (
		dag.python_uv_ruff(base_image)
		.lint()
	)
@func()
async example(baseImage: string): Promise<string> {
	return dag
		.pythonUvRuff(baseImage)
		.lint()
}

test() 🔗

Runs tests using pytest.

Return Type
String !
Example
dagger -m github.com/kpenfound/blueprints/python-uv-ruff@2bb1d301e87cbe218b65c99f4e74618cda252638 call \
 --base-image string test
func (m *MyModule) Example(ctx context.Context, baseImage string) string  {
	return dag.
			PythonUvRuff(baseImage).
			Test(ctx)
}
@function
async def example(base_image: str) -> str:
	return await (
		dag.python_uv_ruff(base_image)
		.test()
	)
@func()
async example(baseImage: string): Promise<string> {
	return dag
		.pythonUvRuff(baseImage)
		.test()
}