python
This module has been generated via dagger init and serves as a reference to basic module structure as you get started with Dagger.Two functions have been pre-created. You can modify, delete, or add to them, as needed. They demonstrate usage of arguments and return types using simple echo and grep commands. The functions can be called from the dagger CLI or from one of the SDKs.
The first line in this comment block is a short description line and the rest is a long description with more detail on the module's purpose or usage, if appropriate. All modules should have a short description.
Installation
dagger install github.com/francoissharpe/daggerverse/python@38c6e115ca67ecd1c051f80866d4d660227a794a
Entrypoint
Return Type
Python
Example
dagger -m github.com/francoissharpe/daggerverse/python@38c6e115ca67ecd1c051f80866d4d660227a794a 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 🔗
container() 🔗
Return Type
Container !
Example
dagger -m github.com/francoissharpe/daggerverse/python@38c6e115ca67ecd1c051f80866d4d660227a794a call \
container
func (m *myModule) example() *Container {
return dag.
Python().
Container()
}
@function
def example() -> dagger.Container:
return (
dag.python()
.container()
)
@func()
example(): Container {
return dag
.python()
.container()
}
directory() 🔗
Directory Return the current working directory
Return Type
Directory !
Example
dagger -m github.com/francoissharpe/daggerverse/python@38c6e115ca67ecd1c051f80866d4d660227a794a call \
directory
func (m *myModule) example() *Directory {
return dag.
Python().
Directory()
}
@function
def example() -> dagger.Directory:
return (
dag.python()
.directory()
)
@func()
example(): Directory {
return dag
.python()
.directory()
}
withPypaBuild() 🔗
Return Type
Directory !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
buildVersion | String | "1.2.1" | The version of the build package |
src | Directory ! | - | Directory containing the source code |
Example
dagger -m github.com/francoissharpe/daggerverse/python@38c6e115ca67ecd1c051f80866d4d660227a794a call \
with-pypa-build --src DIR_PATH
func (m *myModule) example(src *Directory) *Directory {
return dag.
Python().
WithPypaBuild(src)
}
@function
def example(src: dagger.Directory) -> dagger.Directory:
return (
dag.python()
.with_pypa_build(src)
)
@func()
example(src: Directory): Directory {
return dag
.python()
.withPypaBuild(src)
}
do() 🔗
Return Type
String !
Example
dagger -m github.com/francoissharpe/daggerverse/python@38c6e115ca67ecd1c051f80866d4d660227a794a call \
do
func (m *myModule) example(ctx context.Context) string {
return dag.
Python().
Do(ctx)
}
@function
async def example() -> str:
return await (
dag.python()
.do()
)
@func()
async example(): Promise<string> {
return dag
.python()
.do()
}
withTwineUpload() 🔗
Return Type
Python !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
twineVersion | String | "5.0.0" | The version of the build package |
dist | Directory ! | - | Directory containing the distribution files to upload to the repository |
repositoryUrl | String | "https://test.pypi.org/legacy/" | The repository (package index) URL to upload the package to |
username | Secret ! | - | The username to authenticate with the repository |
password | Secret ! | - | The password to authenticate with the repository |
bustCache | Boolean | false | Force execution of the step even if the cache is present |
Example
dagger -m github.com/francoissharpe/daggerverse/python@38c6e115ca67ecd1c051f80866d4d660227a794a call \
with-twine-upload --dist DIR_PATH --username env:MYSECRET --password env:MYSECRET
func (m *myModule) example(dist *Directory, username *Secret, password *Secret) *Python {
return dag.
Python().
WithTwineUpload(dist, username, password)
}
@function
def example(dist: dagger.Directory, username: dagger.Secret, password: dagger.Secret) -> dag.Python:
return (
dag.python()
.with_twine_upload(dist, username, password)
)
@func()
example(dist: Directory, username: Secret, password: Secret): Python {
return dag
.python()
.withTwineUpload(dist, username, password)
}
withVersion() 🔗
Return Type
Python !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
image | String | "python" | The image to use |
version | String ! | - | The version of Python to use |
packages | [String ! ] | [] | Additional APT packages to install |
cacheEnabled | Boolean | true | Enable caching for the container |
commands | [String ! ] | [] | Commands to run in the container |
caFile | File | null | CA File to use for SSL |
pipIndexUrl | String | "https://pypi.org/simple" | Pip index URL |
httpProxy | String | "" | http_proxy environment variable |
httpsProxy | String | "" | https_proxy environment variable |
noProxy | String | "" | no_proxy environment variable |
Example
dagger -m github.com/francoissharpe/daggerverse/python@38c6e115ca67ecd1c051f80866d4d660227a794a call \
with-version --version string
func (m *myModule) example(version string) *Python {
return dag.
Python().
WithVersion(version)
}
@function
def example(version: str) -> dag.Python:
return (
dag.python()
.with_version(version)
)
@func()
example(version: string): Python {
return dag
.python()
.withVersion(version)
}
withPackageManager() 🔗
Return Type
Python !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
packageManager | String | "pip" | The package manager to use |
Example
dagger -m github.com/francoissharpe/daggerverse/python@38c6e115ca67ecd1c051f80866d4d660227a794a call \
with-package-manager
func (m *myModule) example() *Python {
return dag.
Python().
WithPackageManager()
}
@function
def example() -> dag.Python:
return (
dag.python()
.with_package_manager()
)
@func()
example(): Python {
return dag
.python()
.withPackageManager()
}
withPip() 🔗
Return Type
Python !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
version | String | "" | The version of pip to use |
Example
dagger -m github.com/francoissharpe/daggerverse/python@38c6e115ca67ecd1c051f80866d4d660227a794a call \
with-pip
func (m *myModule) example() *Python {
return dag.
Python().
WithPip()
}
@function
def example() -> dag.Python:
return (
dag.python()
.with_pip()
)
@func()
example(): Python {
return dag
.python()
.withPip()
}
withPoetry() 🔗
Return Type
Python !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
version | String | "1.6.1" | The version of poetry to use |
plugins | [String ! ] | [] | Additional poetry plugins to install |
Example
dagger -m github.com/francoissharpe/daggerverse/python@38c6e115ca67ecd1c051f80866d4d660227a794a call \
with-poetry
func (m *myModule) example() *Python {
return dag.
Python().
WithPoetry()
}
@function
def example() -> dag.Python:
return (
dag.python()
.with_poetry()
)
@func()
example(): Python {
return dag
.python()
.withPoetry()
}