Dagger
Search

python-pipeline

Package main provides a complete pipeline for Python projects using Poetry and PyPI.

Installation

dagger install github.com/felipepimentel/daggerverse/python-pipeline@v1.10.0

Entrypoint

Return Type
PythonPipeline !
Example
dagger -m github.com/felipepimentel/daggerverse/python-pipeline@f42c56f237ada75e07d197e095a787f4d71c0a8f call \
func (m *myModule) example() *PythonPipeline  {
	return dag.
			PythonPipeline()
}
@function
def example() -> dag.PythonPipeline:
	return (
		dag.python_pipeline()
	)
@func()
example(): PythonPipeline {
	return dag
		.pythonPipeline()
}

Types

PythonPipeline 🔗

PythonPipeline orchestrates Python project workflows using Poetry and PyPI.

cicd() 🔗

CICD runs the complete CI/CD pipeline for a Python project. This includes: 1. Installing dependencies 2. Running tests 3. Running linting (if configured) 4. Building the package 5. Publishing to PyPI (if token is provided)

Parameters: - ctx: The context for the operation - source: The source directory containing the Python project - token: Optional PyPI token for publishing. If provided, the package will be published

Returns: - error: Any error that occurred during the process

Return Type
Void !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-No description provided
tokenSecret !-No description provided
Example
dagger -m github.com/felipepimentel/daggerverse/python-pipeline@f42c56f237ada75e07d197e095a787f4d71c0a8f call \
 cicd --source DIR_PATH --token env:MYSECRET
func (m *myModule) example(ctx context.Context, source *Directory, token *Secret)   {
	return dag.
			PythonPipeline().
			Cicd(ctx, source, token)
}
@function
async def example(source: dagger.Directory, token: dagger.Secret) -> None:
	return await (
		dag.python_pipeline()
		.cicd(source, token)
	)
@func()
async example(source: Directory, token: Secret): Promise<void> {
	return dag
		.pythonPipeline()
		.cicd(source, token)
}

buildAndPublish() 🔗

BuildAndPublish builds a Python package and publishes it to PyPI. The process includes: 1. Installing dependencies with Poetry 2. Running tests 3. Building the package 4. Publishing to PyPI

Parameters: - ctx: The context for the operation - source: The source directory containing the Python project - token: The PyPI authentication token

Returns: - error: Any error that occurred during the process

Return Type
Void !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-No description provided
tokenSecret !-No description provided
Example
dagger -m github.com/felipepimentel/daggerverse/python-pipeline@f42c56f237ada75e07d197e095a787f4d71c0a8f call \
 build-and-publish --source DIR_PATH --token env:MYSECRET
func (m *myModule) example(ctx context.Context, source *Directory, token *Secret)   {
	return dag.
			PythonPipeline().
			BuildAndPublish(ctx, source, token)
}
@function
async def example(source: dagger.Directory, token: dagger.Secret) -> None:
	return await (
		dag.python_pipeline()
		.build_and_publish(source, token)
	)
@func()
async example(source: Directory, token: Secret): Promise<void> {
	return dag
		.pythonPipeline()
		.buildAndPublish(source, token)
}

updateDependencies() 🔗

UpdateDependencies updates project dependencies and lock file. Parameters: - ctx: The context for the operation - source: The source directory containing the Python project

Returns: - *dagger.Directory: The directory with updated dependencies - error: Any error that occurred during the update

Return Type
Directory !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-No description provided
Example
dagger -m github.com/felipepimentel/daggerverse/python-pipeline@f42c56f237ada75e07d197e095a787f4d71c0a8f call \
 update-dependencies --source DIR_PATH
func (m *myModule) example(source *Directory) *Directory  {
	return dag.
			PythonPipeline().
			UpdateDependencies(source)
}
@function
def example(source: dagger.Directory) -> dagger.Directory:
	return (
		dag.python_pipeline()
		.update_dependencies(source)
	)
@func()
example(source: Directory): Directory {
	return dag
		.pythonPipeline()
		.updateDependencies(source)
}