python
No long description provided.
Installation
dagger install github.com/felipepimentel/daggerverse/python@v1.2.2Entrypoint
Return Type
Python Example
dagger -m github.com/felipepimentel/daggerverse/python@c2dcc434b58fc5ab0967b1cdfa7238eb1a5665a6 call \
func (m *MyModule) Example() *dagger.Python {
return dag.
Python()
}@function
def example() -> dagger.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-versionfunc (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-pathfunc (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-piconfigfunc (m *MyModule) Example() *dagger.PythonPyPiconfig {
return dag.
Python().
PyPiconfig()
}@function
def example() -> dagger.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-configfunc (m *MyModule) Example() *dagger.PythonTestConfig {
return dag.
Python().
TestConfig()
}@function
def example() -> dagger.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-configfunc (m *MyModule) Example() *dagger.PythonBuildConfig {
return dag.
Python().
BuildConfig()
}@function
def example() -> dagger.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
| Name | Type | Default Value | Description |
|---|---|---|---|
| version | String ! | - | No description provided |
Example
dagger -m github.com/felipepimentel/daggerverse/python@c2dcc434b58fc5ab0967b1cdfa7238eb1a5665a6 call \
with-python-version --version stringfunc (m *MyModule) Example(version string) *dagger.Python {
return dag.
Python().
WithPythonVersion(version)
}@function
def example(version: str) -> dagger.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
| Name | Type | Default Value | Description |
|---|---|---|---|
| path | String ! | - | No description provided |
Example
dagger -m github.com/felipepimentel/daggerverse/python@c2dcc434b58fc5ab0967b1cdfa7238eb1a5665a6 call \
with-package-path --path stringfunc (m *MyModule) Example(path string) *dagger.Python {
return dag.
Python().
WithPackagePath(path)
}@function
def example(path: str) -> dagger.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
| Name | Type | Default Value | Description |
|---|---|---|---|
| config | PyPiconfig ! | - | No description provided |
Example
echo 'Custom types are not supported in shell examples'func (m *MyModule) Example(config *dagger.PythonPyPiconfig) *dagger.Python {
return dag.
Python().
WithPyPiconfig(config)
}@function
def example(config: dagger.PythonPyPiconfig) -> dagger.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
| Name | Type | Default Value | Description |
|---|---|---|---|
| config | TestConfig ! | - | No description provided |
Example
echo 'Custom types are not supported in shell examples'func (m *MyModule) Example(config *dagger.PythonTestConfig) *dagger.Python {
return dag.
Python().
WithTestConfig(config)
}@function
def example(config: dagger.PythonTestConfig) -> dagger.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
| Name | Type | Default Value | Description |
|---|---|---|---|
| config | BuildConfig ! | - | No description provided |
Example
echo 'Custom types are not supported in shell examples'func (m *MyModule) Example(config *dagger.PythonBuildConfig) *dagger.Python {
return dag.
Python().
WithBuildConfig(config)
}@function
def example(config: dagger.PythonBuildConfig) -> dagger.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
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
| token | Secret ! | - | No description provided |
Example
dagger -m github.com/felipepimentel/daggerverse/python@c2dcc434b58fc5ab0967b1cdfa7238eb1a5665a6 call \
publish --source DIR_PATH --token env:MYSECRETfunc (m *MyModule) Example(ctx context.Context, source *dagger.Directory, token *dagger.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
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
Example
dagger -m github.com/felipepimentel/daggerverse/python@c2dcc434b58fc5ab0967b1cdfa7238eb1a5665a6 call \
build --source DIR_PATHfunc (m *MyModule) Example(source *dagger.Directory) *dagger.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
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
Example
dagger -m github.com/felipepimentel/daggerverse/python@c2dcc434b58fc5ab0967b1cdfa7238eb1a5665a6 call \
test --source DIR_PATHfunc (m *MyModule) Example(ctx context.Context, source *dagger.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
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | No description provided |
Example
dagger -m github.com/felipepimentel/daggerverse/python@c2dcc434b58fc5ab0967b1cdfa7238eb1a5665a6 call \
build-env --source DIR_PATHfunc (m *MyModule) Example(source *dagger.Directory) *dagger.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 moduleFunction PythonPyPiconfig.registry is not accessible from the python moduleFunction PythonPyPiconfig.registry is not accessible from the python moduleFunction PythonPyPiconfig.registry is not accessible from the python moduletoken() 🔗
Token for authentication
Return Type
Secret ! Example
Function PythonPyPiconfig.token is not accessible from the python moduleFunction PythonPyPiconfig.token is not accessible from the python moduleFunction PythonPyPiconfig.token is not accessible from the python moduleFunction PythonPyPiconfig.token is not accessible from the python moduleskipExisting() 🔗
Skip existing versions (default: false)
Return Type
Boolean ! Example
Function PythonPyPiconfig.skipExisting is not accessible from the python moduleFunction PythonPyPiconfig.skipExisting is not accessible from the python moduleFunction PythonPyPiconfig.skipExisting is not accessible from the python moduleFunction PythonPyPiconfig.skipExisting is not accessible from the python moduleallowDirty() 🔗
Allow dirty versions (default: false)
Return Type
Boolean ! Example
Function PythonPyPiconfig.allowDirty is not accessible from the python moduleFunction PythonPyPiconfig.allowDirty is not accessible from the python moduleFunction PythonPyPiconfig.allowDirty is not accessible from the python moduleFunction PythonPyPiconfig.allowDirty is not accessible from the python moduleextraArgs() 🔗
Additional publish arguments
Return Type
[String ! ] ! Example
Function PythonPyPiconfig.extraArgs is not accessible from the python moduleFunction PythonPyPiconfig.extraArgs is not accessible from the python moduleFunction PythonPyPiconfig.extraArgs is not accessible from the python moduleFunction PythonPyPiconfig.extraArgs is not accessible from the python moduleenv() 🔗
Environment variables for publishing
Return Type
[KeyValue ! ] ! Example
Function PythonPyPiconfig.env is not accessible from the python moduleFunction PythonPyPiconfig.env is not accessible from the python moduleFunction PythonPyPiconfig.env is not accessible from the python moduleFunction PythonPyPiconfig.env is not accessible from the python modulerepositoryName() 🔗
Repository name in Poetry config (default: “pypi”)
Return Type
String ! Example
Function PythonPyPiconfig.repositoryName is not accessible from the python moduleFunction PythonPyPiconfig.repositoryName is not accessible from the python moduleFunction PythonPyPiconfig.repositoryName is not accessible from the python moduleFunction PythonPyPiconfig.repositoryName is not accessible from the python moduleskipBuild() 🔗
Skip build before publishing (default: false)
Return Type
Boolean ! Example
Function PythonPyPiconfig.skipBuild is not accessible from the python moduleFunction PythonPyPiconfig.skipBuild is not accessible from the python moduleFunction PythonPyPiconfig.skipBuild is not accessible from the python moduleFunction PythonPyPiconfig.skipBuild is not accessible from the python moduleskipVerify() 🔗
Skip verification before publishing (default: false)
Return Type
Boolean ! Example
Function PythonPyPiconfig.skipVerify is not accessible from the python moduleFunction PythonPyPiconfig.skipVerify is not accessible from the python moduleFunction PythonPyPiconfig.skipVerify is not accessible from the python moduleFunction PythonPyPiconfig.skipVerify is not accessible from the python moduleTestConfig 🔗
TestConfig holds pytest configuration options
verbose() 🔗
Verbose output (default: true)
Return Type
Boolean ! Example
Function PythonTestConfig.verbose is not accessible from the python moduleFunction PythonTestConfig.verbose is not accessible from the python moduleFunction PythonTestConfig.verbose is not accessible from the python moduleFunction PythonTestConfig.verbose is not accessible from the python moduleworkers() 🔗
Number of parallel workers (default: auto)
Return Type
Integer ! Example
Function PythonTestConfig.workers is not accessible from the python moduleFunction PythonTestConfig.workers is not accessible from the python moduleFunction PythonTestConfig.workers is not accessible from the python moduleFunction PythonTestConfig.workers is not accessible from the python modulecoverage() 🔗
Coverage configuration
Return Type
CoverageConfig ! Example
Function PythonTestConfig.coverage is not accessible from the python moduleFunction PythonTestConfig.coverage is not accessible from the python moduleFunction PythonTestConfig.coverage is not accessible from the python moduleFunction PythonTestConfig.coverage is not accessible from the python moduleextraArgs() 🔗
Additional pytest arguments
Return Type
[String ! ] ! Example
Function PythonTestConfig.extraArgs is not accessible from the python moduleFunction PythonTestConfig.extraArgs is not accessible from the python moduleFunction PythonTestConfig.extraArgs is not accessible from the python moduleFunction PythonTestConfig.extraArgs is not accessible from the python moduleenv() 🔗
Environment variables for tests
Return Type
[KeyValue ! ] ! Example
Function PythonTestConfig.env is not accessible from the python moduleFunction PythonTestConfig.env is not accessible from the python moduleFunction PythonTestConfig.env is not accessible from the python moduleFunction PythonTestConfig.env is not accessible from the python moduleBuildConfig 🔗
BuildConfig holds Poetry build configuration
buildArgs() 🔗
Additional build arguments
Return Type
[String ! ] ! Example
Function PythonBuildConfig.buildArgs is not accessible from the python moduleFunction PythonBuildConfig.buildArgs is not accessible from the python moduleFunction PythonBuildConfig.buildArgs is not accessible from the python moduleFunction PythonBuildConfig.buildArgs is not accessible from the python moduleextraDependencies() 🔗
Additional dependencies to install
Return Type
[String ! ] ! Example
Function PythonBuildConfig.extraDependencies is not accessible from the python moduleFunction PythonBuildConfig.extraDependencies is not accessible from the python moduleFunction PythonBuildConfig.extraDependencies is not accessible from the python moduleFunction PythonBuildConfig.extraDependencies is not accessible from the python modulepoetryConfig() 🔗
Poetry configuration options
Return Type
[KeyValue ! ] ! Example
Function PythonBuildConfig.poetryConfig is not accessible from the python moduleFunction PythonBuildConfig.poetryConfig is not accessible from the python moduleFunction PythonBuildConfig.poetryConfig is not accessible from the python moduleFunction PythonBuildConfig.poetryConfig is not accessible from the python moduleenv() 🔗
Environment variables for build
Return Type
[KeyValue ! ] ! Example
Function PythonBuildConfig.env is not accessible from the python moduleFunction PythonBuildConfig.env is not accessible from the python moduleFunction PythonBuildConfig.env is not accessible from the python moduleFunction PythonBuildConfig.env is not accessible from the python modulecache() 🔗
Cache configuration
Return Type
CacheConfig ! Example
Function PythonBuildConfig.cache is not accessible from the python moduleFunction PythonBuildConfig.cache is not accessible from the python moduleFunction PythonBuildConfig.cache is not accessible from the python moduleFunction PythonBuildConfig.cache is not accessible from the python moduleKeyValue 🔗
KeyValue represents a key-value pair
key() 🔗
Return Type
String ! Example
Function PythonKeyValue.key is not accessible from the python moduleFunction PythonKeyValue.key is not accessible from the python moduleFunction PythonKeyValue.key is not accessible from the python moduleFunction PythonKeyValue.key is not accessible from the python modulevalue() 🔗
Return Type
String ! Example
Function PythonKeyValue.value is not accessible from the python moduleFunction PythonKeyValue.value is not accessible from the python moduleFunction PythonKeyValue.value is not accessible from the python moduleFunction PythonKeyValue.value is not accessible from the python moduleCoverageConfig 🔗
CoverageConfig holds coverage reporting configuration
enabled() 🔗
Enable coverage reporting (default: true)
Return Type
Boolean ! Example
Function PythonCoverageConfig.enabled is not accessible from the python moduleFunction PythonCoverageConfig.enabled is not accessible from the python moduleFunction PythonCoverageConfig.enabled is not accessible from the python moduleFunction PythonCoverageConfig.enabled is not accessible from the python moduleformats() 🔗
Coverage report formats (default: [“term”, “xml”])
Return Type
[String ! ] ! Example
Function PythonCoverageConfig.formats is not accessible from the python moduleFunction PythonCoverageConfig.formats is not accessible from the python moduleFunction PythonCoverageConfig.formats is not accessible from the python moduleFunction PythonCoverageConfig.formats is not accessible from the python moduleminCoverage() 🔗
Minimum coverage percentage (default: 0)
Return Type
Integer ! Example
Function PythonCoverageConfig.minCoverage is not accessible from the python moduleFunction PythonCoverageConfig.minCoverage is not accessible from the python moduleFunction PythonCoverageConfig.minCoverage is not accessible from the python moduleFunction PythonCoverageConfig.minCoverage is not accessible from the python moduleoutputDir() 🔗
Coverage output directory (default: “coverage”)
Return Type
String ! Example
Function PythonCoverageConfig.outputDir is not accessible from the python moduleFunction PythonCoverageConfig.outputDir is not accessible from the python moduleFunction PythonCoverageConfig.outputDir is not accessible from the python moduleFunction PythonCoverageConfig.outputDir is not accessible from the python moduleCacheConfig 🔗
CacheConfig holds cache configuration
pipCache() 🔗
Enable pip cache (default: true)
Return Type
Boolean ! Example
Function PythonCacheConfig.pipCache is not accessible from the python moduleFunction PythonCacheConfig.pipCache is not accessible from the python moduleFunction PythonCacheConfig.pipCache is not accessible from the python moduleFunction PythonCacheConfig.pipCache is not accessible from the python modulepoetryCache() 🔗
Enable poetry cache (default: true)
Return Type
Boolean ! Example
Function PythonCacheConfig.poetryCache is not accessible from the python moduleFunction PythonCacheConfig.poetryCache is not accessible from the python moduleFunction PythonCacheConfig.poetryCache is not accessible from the python moduleFunction PythonCacheConfig.poetryCache is not accessible from the python modulepipCacheVolume() 🔗
Custom cache volume names
Return Type
String ! Example
Function PythonCacheConfig.pipCacheVolume is not accessible from the python moduleFunction PythonCacheConfig.pipCacheVolume is not accessible from the python moduleFunction PythonCacheConfig.pipCacheVolume is not accessible from the python moduleFunction PythonCacheConfig.pipCacheVolume is not accessible from the python modulepoetryCacheVolume() 🔗
Return Type
String ! Example
Function PythonCacheConfig.poetryCacheVolume is not accessible from the python moduleFunction PythonCacheConfig.poetryCacheVolume is not accessible from the python moduleFunction PythonCacheConfig.poetryCacheVolume is not accessible from the python moduleFunction PythonCacheConfig.poetryCacheVolume is not accessible from the python module