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
func (m *myModule) 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
func (m *myModule) example(ctx context.Context, source *Directory, token *Secret)   {
	return dag.
			PythonPipeline().
			Cicd(ctx, 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
func (m *myModule) example(ctx context.Context, source *Directory, token *Secret)   {
	return dag.
			PythonPipeline().
			BuildAndPublish(ctx, 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
func (m *myModule) example(source *Directory) *Directory  {
	return dag.
			PythonPipeline().
			UpdateDependencies(source)
}