Dagger
Search

python

No long description provided.

Installation

dagger install github.com/felipepimentel/daggerverse/python@v1.2.2

Entrypoint

Return Type
Python
Example
dagger -m github.com/felipepimentel/daggerverse/python@c2dcc434b58fc5ab0967b1cdfa7238eb1a5665a6 call \
func (m *myModule) example() *Python  {
	return dag.
			Python()
}
@function
def example() -> dag.Python:
	return (
		dag.python()
	)
@func()
example(): Python {
	return dag
		.python()
}

Types

Python 🔗

Python represents a Python module with Poetry support

pythonVersion() 🔗

PythonVersion specifies the Python version to use (default: “3.12”)

Return Type
String !
Example
dagger -m github.com/felipepimentel/daggerverse/python@c2dcc434b58fc5ab0967b1cdfa7238eb1a5665a6 call \
 python-version
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			Python().
			PythonVersion(ctx)
}
@function
async def example() -> str:
	return await (
		dag.python()
		.python_version()
	)
@func()
async example(): Promise<string> {
	return dag
		.python()
		.pythonVersion()
}

packagePath() 🔗

PackagePath specifies the path to the package within the source (default: “.”)

Return Type
String !
Example
dagger -m github.com/felipepimentel/daggerverse/python@c2dcc434b58fc5ab0967b1cdfa7238eb1a5665a6 call \
 package-path
func (m *myModule) example(ctx context.Context) string  {
	return dag.
			Python().
			PackagePath(ctx)
}
@function
async def example() -> str:
	return await (
		dag.python()
		.package_path()
	)
@func()
async example(): Promise<string> {
	return dag
		.python()
		.packagePath()
}

pyPiconfig() 🔗

PyPIConfig holds the PyPI deployment configuration

Return Type
PyPiconfig !
Example
dagger -m github.com/felipepimentel/daggerverse/python@c2dcc434b58fc5ab0967b1cdfa7238eb1a5665a6 call \
 py-piconfig
func (m *myModule) example() *PythonPyPiconfig  {
	return dag.
			Python().
			PyPiconfig()
}
@function
def example() -> dag.PythonPyPiconfig:
	return (
		dag.python()
		.py_piconfig()
	)
@func()
example(): PythonPyPiconfig {
	return dag
		.python()
		.pyPiconfig()
}

testConfig() 🔗

TestConfig holds the test configuration

Return Type
TestConfig !
Example
dagger -m github.com/felipepimentel/daggerverse/python@c2dcc434b58fc5ab0967b1cdfa7238eb1a5665a6 call \
 test-config
func (m *myModule) example() *PythonTestConfig  {
	return dag.
			Python().
			TestConfig()
}
@function
def example() -> dag.PythonTestConfig:
	return (
		dag.python()
		.test_config()
	)
@func()
example(): PythonTestConfig {
	return dag
		.python()
		.testConfig()
}

buildConfig() 🔗

BuildConfig holds the build configuration

Return Type
BuildConfig !
Example
dagger -m github.com/felipepimentel/daggerverse/python@c2dcc434b58fc5ab0967b1cdfa7238eb1a5665a6 call \
 build-config
func (m *myModule) example() *PythonBuildConfig  {
	return dag.
			Python().
			BuildConfig()
}
@function
def example() -> dag.PythonBuildConfig:
	return (
		dag.python()
		.build_config()
	)
@func()
example(): PythonBuildConfig {
	return dag
		.python()
		.buildConfig()
}

withPythonVersion() 🔗

WithPythonVersion sets the Python version to use

Return Type
Python !
Arguments
NameTypeDefault ValueDescription
versionString !-No description provided
Example
dagger -m github.com/felipepimentel/daggerverse/python@c2dcc434b58fc5ab0967b1cdfa7238eb1a5665a6 call \
 with-python-version --version string
func (m *myModule) example(version string) *Python  {
	return dag.
			Python().
			WithPythonVersion(version)
}
@function
def example(version: str) -> dag.Python:
	return (
		dag.python()
		.with_python_version(version)
	)
@func()
example(version: string): Python {
	return dag
		.python()
		.withPythonVersion(version)
}

withPackagePath() 🔗

WithPackagePath sets the package path within the source

Return Type
Python !
Arguments
NameTypeDefault ValueDescription
pathString !-No description provided
Example
dagger -m github.com/felipepimentel/daggerverse/python@c2dcc434b58fc5ab0967b1cdfa7238eb1a5665a6 call \
 with-package-path --path string
func (m *myModule) example(path string) *Python  {
	return dag.
			Python().
			WithPackagePath(path)
}
@function
def example(path: str) -> dag.Python:
	return (
		dag.python()
		.with_package_path(path)
	)
@func()
example(path: string): Python {
	return dag
		.python()
		.withPackagePath(path)
}

withPyPiconfig() 🔗

WithPyPIConfig sets the PyPI deployment configuration

Return Type
Python !
Arguments
NameTypeDefault ValueDescription
configPyPiconfig !-No description provided
Example
echo 'Custom types are not supported in shell examples'
func (m *myModule) example(config *PythonPyPiconfig) *Python  {
	return dag.
			Python().
			WithPyPiconfig(config)
}
@function
def example(config: dag.PythonPyPiconfig) -> dag.Python:
	return (
		dag.python()
		.with_py_piconfig(config)
	)
@func()
example(config: PythonPyPiconfig): Python {
	return dag
		.python()
		.withPyPiconfig(config)
}

withTestConfig() 🔗

WithTestConfig sets the test configuration

Return Type
Python !
Arguments
NameTypeDefault ValueDescription
configTestConfig !-No description provided
Example
echo 'Custom types are not supported in shell examples'
func (m *myModule) example(config *PythonTestConfig) *Python  {
	return dag.
			Python().
			WithTestConfig(config)
}
@function
def example(config: dag.PythonTestConfig) -> dag.Python:
	return (
		dag.python()
		.with_test_config(config)
	)
@func()
example(config: PythonTestConfig): Python {
	return dag
		.python()
		.withTestConfig(config)
}

withBuildConfig() 🔗

WithBuildConfig sets the build configuration

Return Type
Python !
Arguments
NameTypeDefault ValueDescription
configBuildConfig !-No description provided
Example
echo 'Custom types are not supported in shell examples'
func (m *myModule) example(config *PythonBuildConfig) *Python  {
	return dag.
			Python().
			WithBuildConfig(config)
}
@function
def example(config: dag.PythonBuildConfig) -> dag.Python:
	return (
		dag.python()
		.with_build_config(config)
	)
@func()
example(config: PythonBuildConfig): Python {
	return dag
		.python()
		.withBuildConfig(config)
}

publish() 🔗

Publish builds, tests and publishes the Python package to a registry

Return Type
String !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-No description provided
tokenSecret !-No description provided
Example
dagger -m github.com/felipepimentel/daggerverse/python@c2dcc434b58fc5ab0967b1cdfa7238eb1a5665a6 call \
 publish --source DIR_PATH --token env:MYSECRET
func (m *myModule) example(ctx context.Context, source *Directory, token *Secret) string  {
	return dag.
			Python().
			Publish(ctx, source, token)
}
@function
async def example(source: dagger.Directory, token: dagger.Secret) -> str:
	return await (
		dag.python()
		.publish(source, token)
	)
@func()
async example(source: Directory, token: Secret): Promise<string> {
	return dag
		.python()
		.publish(source, token)
}

build() 🔗

Build creates a Python package using Poetry

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-No description provided
Example
dagger -m github.com/felipepimentel/daggerverse/python@c2dcc434b58fc5ab0967b1cdfa7238eb1a5665a6 call \
 build --source DIR_PATH
func (m *myModule) example(source *Directory) *Container  {
	return dag.
			Python().
			Build(source)
}
@function
def example(source: dagger.Directory) -> dagger.Container:
	return (
		dag.python()
		.build(source)
	)
@func()
example(source: Directory): Container {
	return dag
		.python()
		.build(source)
}

test() 🔗

Test runs the test suite using pytest with coverage reporting

Return Type
String !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-No description provided
Example
dagger -m github.com/felipepimentel/daggerverse/python@c2dcc434b58fc5ab0967b1cdfa7238eb1a5665a6 call \
 test --source DIR_PATH
func (m *myModule) example(ctx context.Context, source *Directory) string  {
	return dag.
			Python().
			Test(ctx, source)
}
@function
async def example(source: dagger.Directory) -> str:
	return await (
		dag.python()
		.test(source)
	)
@func()
async example(source: Directory): Promise<string> {
	return dag
		.python()
		.test(source)
}

buildEnv() 🔗

BuildEnv prepares a Python development environment with Poetry

Return Type
Container !
Arguments
NameTypeDefault ValueDescription
sourceDirectory !-No description provided
Example
dagger -m github.com/felipepimentel/daggerverse/python@c2dcc434b58fc5ab0967b1cdfa7238eb1a5665a6 call \
 build-env --source DIR_PATH
func (m *myModule) example(source *Directory) *Container  {
	return dag.
			Python().
			BuildEnv(source)
}
@function
def example(source: dagger.Directory) -> dagger.Container:
	return (
		dag.python()
		.build_env(source)
	)
@func()
example(source: Directory): Container {
	return dag
		.python()
		.buildEnv(source)
}

PyPiconfig 🔗

PyPIConfig holds PyPI deployment configuration

registry() 🔗

Registry URL (default: https://upload.pypi.org/legacy/)

Return Type
String !
Example
Function PythonPyPiconfig.registry is not accessible from the python module
Function PythonPyPiconfig.registry is not accessible from the python module
Function PythonPyPiconfig.registry is not accessible from the python module
Function PythonPyPiconfig.registry is not accessible from the python module

token() 🔗

Token for authentication

Return Type
Secret !
Example
Function PythonPyPiconfig.token is not accessible from the python module
Function PythonPyPiconfig.token is not accessible from the python module
Function PythonPyPiconfig.token is not accessible from the python module
Function PythonPyPiconfig.token is not accessible from the python module

skipExisting() 🔗

Skip existing versions (default: false)

Return Type
Boolean !
Example
Function PythonPyPiconfig.skipExisting is not accessible from the python module
Function PythonPyPiconfig.skipExisting is not accessible from the python module
Function PythonPyPiconfig.skipExisting is not accessible from the python module
Function PythonPyPiconfig.skipExisting is not accessible from the python module

allowDirty() 🔗

Allow dirty versions (default: false)

Return Type
Boolean !
Example
Function PythonPyPiconfig.allowDirty is not accessible from the python module
Function PythonPyPiconfig.allowDirty is not accessible from the python module
Function PythonPyPiconfig.allowDirty is not accessible from the python module
Function PythonPyPiconfig.allowDirty is not accessible from the python module

extraArgs() 🔗

Additional publish arguments

Return Type
[String ! ] !
Example
Function PythonPyPiconfig.extraArgs is not accessible from the python module
Function PythonPyPiconfig.extraArgs is not accessible from the python module
Function PythonPyPiconfig.extraArgs is not accessible from the python module
Function PythonPyPiconfig.extraArgs is not accessible from the python module

env() 🔗

Environment variables for publishing

Return Type
[KeyValue ! ] !
Example
Function PythonPyPiconfig.env is not accessible from the python module
Function PythonPyPiconfig.env is not accessible from the python module
Function PythonPyPiconfig.env is not accessible from the python module
Function PythonPyPiconfig.env is not accessible from the python module

repositoryName() 🔗

Repository name in Poetry config (default: “pypi”)

Return Type
String !
Example
Function PythonPyPiconfig.repositoryName is not accessible from the python module
Function PythonPyPiconfig.repositoryName is not accessible from the python module
Function PythonPyPiconfig.repositoryName is not accessible from the python module
Function PythonPyPiconfig.repositoryName is not accessible from the python module

skipBuild() 🔗

Skip build before publishing (default: false)

Return Type
Boolean !
Example
Function PythonPyPiconfig.skipBuild is not accessible from the python module
Function PythonPyPiconfig.skipBuild is not accessible from the python module
Function PythonPyPiconfig.skipBuild is not accessible from the python module
Function PythonPyPiconfig.skipBuild is not accessible from the python module

skipVerify() 🔗

Skip verification before publishing (default: false)

Return Type
Boolean !
Example
Function PythonPyPiconfig.skipVerify is not accessible from the python module
Function PythonPyPiconfig.skipVerify is not accessible from the python module
Function PythonPyPiconfig.skipVerify is not accessible from the python module
Function PythonPyPiconfig.skipVerify is not accessible from the python module

TestConfig 🔗

TestConfig holds pytest configuration options

verbose() 🔗

Verbose output (default: true)

Return Type
Boolean !
Example
Function PythonTestConfig.verbose is not accessible from the python module
Function PythonTestConfig.verbose is not accessible from the python module
Function PythonTestConfig.verbose is not accessible from the python module
Function PythonTestConfig.verbose is not accessible from the python module

workers() 🔗

Number of parallel workers (default: auto)

Return Type
Integer !
Example
Function PythonTestConfig.workers is not accessible from the python module
Function PythonTestConfig.workers is not accessible from the python module
Function PythonTestConfig.workers is not accessible from the python module
Function PythonTestConfig.workers is not accessible from the python module

coverage() 🔗

Coverage configuration

Return Type
CoverageConfig !
Example
Function PythonTestConfig.coverage is not accessible from the python module
Function PythonTestConfig.coverage is not accessible from the python module
Function PythonTestConfig.coverage is not accessible from the python module
Function PythonTestConfig.coverage is not accessible from the python module

extraArgs() 🔗

Additional pytest arguments

Return Type
[String ! ] !
Example
Function PythonTestConfig.extraArgs is not accessible from the python module
Function PythonTestConfig.extraArgs is not accessible from the python module
Function PythonTestConfig.extraArgs is not accessible from the python module
Function PythonTestConfig.extraArgs is not accessible from the python module

env() 🔗

Environment variables for tests

Return Type
[KeyValue ! ] !
Example
Function PythonTestConfig.env is not accessible from the python module
Function PythonTestConfig.env is not accessible from the python module
Function PythonTestConfig.env is not accessible from the python module
Function PythonTestConfig.env is not accessible from the python module

BuildConfig 🔗

BuildConfig holds Poetry build configuration

buildArgs() 🔗

Additional build arguments

Return Type
[String ! ] !
Example
Function PythonBuildConfig.buildArgs is not accessible from the python module
Function PythonBuildConfig.buildArgs is not accessible from the python module
Function PythonBuildConfig.buildArgs is not accessible from the python module
Function PythonBuildConfig.buildArgs is not accessible from the python module

extraDependencies() 🔗

Additional dependencies to install

Return Type
[String ! ] !
Example
Function PythonBuildConfig.extraDependencies is not accessible from the python module
Function PythonBuildConfig.extraDependencies is not accessible from the python module
Function PythonBuildConfig.extraDependencies is not accessible from the python module
Function PythonBuildConfig.extraDependencies is not accessible from the python module

poetryConfig() 🔗

Poetry configuration options

Return Type
[KeyValue ! ] !
Example
Function PythonBuildConfig.poetryConfig is not accessible from the python module
Function PythonBuildConfig.poetryConfig is not accessible from the python module
Function PythonBuildConfig.poetryConfig is not accessible from the python module
Function PythonBuildConfig.poetryConfig is not accessible from the python module

env() 🔗

Environment variables for build

Return Type
[KeyValue ! ] !
Example
Function PythonBuildConfig.env is not accessible from the python module
Function PythonBuildConfig.env is not accessible from the python module
Function PythonBuildConfig.env is not accessible from the python module
Function PythonBuildConfig.env is not accessible from the python module

cache() 🔗

Cache configuration

Return Type
CacheConfig !
Example
Function PythonBuildConfig.cache is not accessible from the python module
Function PythonBuildConfig.cache is not accessible from the python module
Function PythonBuildConfig.cache is not accessible from the python module
Function PythonBuildConfig.cache is not accessible from the python module

KeyValue 🔗

KeyValue represents a key-value pair

key() 🔗

Return Type
String !
Example
Function PythonKeyValue.key is not accessible from the python module
Function PythonKeyValue.key is not accessible from the python module
Function PythonKeyValue.key is not accessible from the python module
Function PythonKeyValue.key is not accessible from the python module

value() 🔗

Return Type
String !
Example
Function PythonKeyValue.value is not accessible from the python module
Function PythonKeyValue.value is not accessible from the python module
Function PythonKeyValue.value is not accessible from the python module
Function PythonKeyValue.value is not accessible from the python module

CoverageConfig 🔗

CoverageConfig holds coverage reporting configuration

enabled() 🔗

Enable coverage reporting (default: true)

Return Type
Boolean !
Example
Function PythonCoverageConfig.enabled is not accessible from the python module
Function PythonCoverageConfig.enabled is not accessible from the python module
Function PythonCoverageConfig.enabled is not accessible from the python module
Function PythonCoverageConfig.enabled is not accessible from the python module

formats() 🔗

Coverage report formats (default: [“term”, “xml”])

Return Type
[String ! ] !
Example
Function PythonCoverageConfig.formats is not accessible from the python module
Function PythonCoverageConfig.formats is not accessible from the python module
Function PythonCoverageConfig.formats is not accessible from the python module
Function PythonCoverageConfig.formats is not accessible from the python module

minCoverage() 🔗

Minimum coverage percentage (default: 0)

Return Type
Integer !
Example
Function PythonCoverageConfig.minCoverage is not accessible from the python module
Function PythonCoverageConfig.minCoverage is not accessible from the python module
Function PythonCoverageConfig.minCoverage is not accessible from the python module
Function PythonCoverageConfig.minCoverage is not accessible from the python module

outputDir() 🔗

Coverage output directory (default: “coverage”)

Return Type
String !
Example
Function PythonCoverageConfig.outputDir is not accessible from the python module
Function PythonCoverageConfig.outputDir is not accessible from the python module
Function PythonCoverageConfig.outputDir is not accessible from the python module
Function PythonCoverageConfig.outputDir is not accessible from the python module

CacheConfig 🔗

CacheConfig holds cache configuration

pipCache() 🔗

Enable pip cache (default: true)

Return Type
Boolean !
Example
Function PythonCacheConfig.pipCache is not accessible from the python module
Function PythonCacheConfig.pipCache is not accessible from the python module
Function PythonCacheConfig.pipCache is not accessible from the python module
Function PythonCacheConfig.pipCache is not accessible from the python module

poetryCache() 🔗

Enable poetry cache (default: true)

Return Type
Boolean !
Example
Function PythonCacheConfig.poetryCache is not accessible from the python module
Function PythonCacheConfig.poetryCache is not accessible from the python module
Function PythonCacheConfig.poetryCache is not accessible from the python module
Function PythonCacheConfig.poetryCache is not accessible from the python module

pipCacheVolume() 🔗

Custom cache volume names

Return Type
String !
Example
Function PythonCacheConfig.pipCacheVolume is not accessible from the python module
Function PythonCacheConfig.pipCacheVolume is not accessible from the python module
Function PythonCacheConfig.pipCacheVolume is not accessible from the python module
Function PythonCacheConfig.pipCacheVolume is not accessible from the python module

poetryCacheVolume() 🔗

Return Type
String !
Example
Function PythonCacheConfig.poetryCacheVolume is not accessible from the python module
Function PythonCacheConfig.poetryCacheVolume is not accessible from the python module
Function PythonCacheConfig.poetryCacheVolume is not accessible from the python module
Function PythonCacheConfig.poetryCacheVolume is not accessible from the python module