API Reference
The top-level package for the project.
rig
Package initialization.
configs
Package initialization.
container_file
Containerfile configuration management.
ContainerfileConfigFile
Bases: StringConfigFile
Generates a production-ready Containerfile for the project.
Produces a Containerfile with a Python slim base image, uv as the package manager, a non-root runtime user (appuser, UID 1000), and layer ordering optimized for cache reuse. Compatible with Docker, Podman, and buildah.
Source code in src/pyrig_containers/rig/configs/container_file.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | |
extension()
Return an empty string (Containerfile has no file extension).
Source code in src/pyrig_containers/rig/configs/container_file.py
29 30 31 | |
extension_separator()
Return an empty string, overriding the base class default separator '.'.
Prevents the base class from appending a dot to the filename, since Containerfile uses neither an extension nor a separator.
Source code in src/pyrig_containers/rig/configs/container_file.py
33 34 35 36 37 38 39 | |
layers()
Generate the complete sequence of Containerfile build instructions.
Produces an optimized layer order so that infrequently changing files (project metadata and lock file) are copied before the source tree is added. This maximizes Docker/Podman build cache reuse when only source code changes.
Returns:
| Type | Description |
|---|---|
list[str]
|
List of Containerfile instruction strings followed by a trailing |
list[str]
|
empty string. |
Note
Reads requires-python from pyproject.toml and falls back to
the bundled LATEST_PYTHON_VERSION resource file when no upper
bound is specified.
Source code in src/pyrig_containers/rig/configs/container_file.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | |
lines()
Return the Containerfile build instructions.
Returns:
| Type | Description |
|---|---|
list[str]
|
List of instruction lines produced by |
Source code in src/pyrig_containers/rig/configs/container_file.py
41 42 43 44 45 46 47 | |
parent_path()
Return the project root directory.
Source code in src/pyrig_containers/rig/configs/container_file.py
25 26 27 | |
stem()
Return the filename stem 'Containerfile'.
Source code in src/pyrig_containers/rig/configs/container_file.py
21 22 23 | |
tools
Package initialization.
container_engine
Container engine wrapper.
Wraps container engine commands and information.
ContainerEngine
Bases: Tool
Container engine wrapper.
Constructs podman command arguments for building and saving container images.
Typical usage: call build_args to build the image, then save_args
to export it as a tar archive.
Source code in src/pyrig_containers/rig/tools/container_engine.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | |
dev_dependencies()
Get tool dependencies.
Podman is a system package (not a Python dependency), so this returns an empty tuple.
Returns:
| Type | Description |
|---|---|
tuple[str, ...]
|
Empty tuple — podman must be installed at the OS level. |
Source code in src/pyrig_containers/rig/tools/container_engine.py
45 46 47 48 49 50 51 52 53 54 | |
group()
Returns the group the tool belongs to.
Source code in src/pyrig_containers/rig/tools/container_engine.py
25 26 27 | |
image_url()
Return the badge image URL for this tool.
Returns:
| Type | Description |
|---|---|
str
|
The URL of the badge image as a string. |
Source code in src/pyrig_containers/rig/tools/container_engine.py
29 30 31 32 33 34 35 | |
link_url()
Return the URL that the badge should link to for this tool.
Returns:
| Type | Description |
|---|---|
str
|
The URL of the project page as a string. |
Source code in src/pyrig_containers/rig/tools/container_engine.py
37 38 39 40 41 42 43 | |
name()
Get tool name.
Returns:
| Type | Description |
|---|---|
str
|
'podman' |
Source code in src/pyrig_containers/rig/tools/container_engine.py
17 18 19 20 21 22 23 | |
package_manager
Package manager wrapper.
Wraps PackageManager commands and information.
PackageManager
Bases: PackageManager
You can override methods from the base class to customize behavior.
Source code in src/pyrig_containers/rig/tools/package_manager.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 | |
container_image()
Return the container image coordinates for copying uv.
Used when generating a Containerfile to add a
COPY --from=<image> <src> <dst> directive that installs uv
into the container image.
Returns:
| Type | Description |
|---|---|
tuple[str, str, str]
|
Tuple of (image_name, path_in_source_image, path_in_target_image). |
Source code in src/pyrig_containers/rig/tools/package_manager.py
12 13 14 15 16 17 18 19 20 21 22 | |