pspf_builder
flavor.psp.format_2025.pspf_builder
¶
TODO: Add module docstring.
Classes¶
PSPFBuilder
¶
Immutable fluent builder interface for PSPF packages.
Provides a chainable API for constructing build specifications.
Initialize with optional starting specification.
Source code in flavor/psp/format_2025/pspf_builder.py
Functions¶
add_slot
¶
add_slot(
id: str,
data: bytes | str | Path,
purpose: str = "data",
lifecycle: str = "runtime",
operations: str = "gzip",
target: str | None = None,
permissions: str | None = None,
) -> PSPFBuilder
Add a slot to the package.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
id
|
str
|
Slot identifier |
required |
data
|
bytes | str | Path
|
Slot data (bytes, string, or path to file/directory) |
required |
purpose
|
str
|
Slot purpose (data, code, config, media) |
'data'
|
lifecycle
|
str
|
Slot lifecycle (runtime, cached, temporary) |
'runtime'
|
operations
|
str
|
Operation chain (e.g., "tar.gz", "TAR|GZIP") |
'gzip'
|
target
|
str | None
|
Target location relative to workenv (default: None) |
None
|
permissions
|
str | None
|
Unix permissions as octal string (e.g., "0755") |
None
|
Source code in flavor/psp/format_2025/pspf_builder.py
build
¶
Build the package.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output_path
|
str | Path
|
Path where package should be written |
required |
Returns:
| Type | Description |
|---|---|
BuildResult
|
BuildResult with success status and any errors |
Source code in flavor/psp/format_2025/pspf_builder.py
create
classmethod
¶
metadata
¶
Set metadata fields.
Merges provided kwargs with existing metadata.
with_keys
¶
with_keys(
seed: str | None = None,
private: bytes | None = None,
public: bytes | None = None,
path: Path | None = None,
) -> PSPFBuilder
Configure signing keys.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
seed
|
str | None
|
Seed for deterministic key generation |
None
|
private
|
bytes | None
|
Explicit private key bytes |
None
|
public
|
bytes | None
|
Explicit public key bytes |
None
|
path
|
Path | None
|
Path to load keys from |
None
|
Source code in flavor/psp/format_2025/pspf_builder.py
with_options
¶
Set build options.
Supported options: - enable_mmap: Enable memory-mapped access - page_aligned: Align slots to page boundaries - strip_binaries: Strip debug symbols from binaries - compression: Compression type (none, gzip) - compression_level: Compression level (0-9) - launcher_bin: Path to launcher binary - reproducible: Enable reproducible builds