python
Package main provides a complete pipeline for Python projects using Poetry and PyPI.
Installation
dagger install github.com/felipepimentel/daggerverse/pipelines/python@c9cbbd3178d1d6cf7b6dec00148028ea9e4e5c24
Entrypoint
Return Type
Python !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
pythonVersion | String | "3.12-alpine" | Python version to use |
gitEmail | String | "github-actions[bot]@users.noreply.github.com" | Git email for commits |
gitName | String | "github-actions[bot]" | Git username for commits |
dockerUsername | String | - | Docker Hub username |
dockerPassword | Secret | - | Docker Hub password |
Example
func (m *myModule) example() *Python {
return dag.
Python()
}
Types
Python 🔗
Python orchestrates Python project workflows using Poetry and PyPI. It provides a complete CI/CD pipeline for Python projects, including testing, building, and publishing to PyPI.
publish() 🔗
Publish builds, tests, and publishes the Python package to PyPI. It returns the version of the published package or an error if any step fails.
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
source | Directory ! | - | No description provided |
token | Secret ! | - | No description provided |
Example
func (m *myModule) example(ctx context.Context, source *Directory, token *Secret) string {
return dag.
Python().
Publish(ctx, source, token)
}
build() 🔗
Build creates a container with all dependencies installed and configured. It returns the configured container or nil if the build fails.
Return Type
Container !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
source | Directory ! | - | No description provided |
Example
func (m *myModule) example(source *Directory) *Container {
return dag.
Python().
Build(source)
}
test() 🔗
Test runs all quality checks and returns the combined test output. It returns an error if any check fails.
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
source | Directory ! | - | No description provided |
Example
func (m *myModule) example(ctx context.Context, source *Directory) string {
return dag.
Python().
Test(ctx, source)
}
lint() 🔗
Lint runs code quality checks using Ruff. It returns an error if any check fails.
Return Type
Void !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
source | Directory ! | - | No description provided |
Example
func (m *myModule) example(ctx context.Context, source *Directory) {
return dag.
Python().
Lint(ctx, source)
}
buildEnv() 🔗
BuildEnv creates a development environment with all dependencies installed. It returns the configured container.
Return Type
Container !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
source | Directory ! | - | No description provided |
Example
func (m *myModule) example(source *Directory) *Container {
return dag.
Python().
BuildEnv(source)
}