On this page
Release file reader and validator: parses unreleased.toml for bump type and targets, batch release TOML for monorepos, and retry.toml via RetryConfig.
#rlsbl.release_file
#rlsbl.release_file
Release file reader and validator for file-based releases.
Instead of passing bump type on the CLI, the user creates .rlsbl/releases/unreleased.toml describing the release. This module reads and validates that file's internal consistency.
#ReleaseConfig
| Field | Type | Default |
|---|---|---|
bump | str | |
include | list[str] | |
exclude | list[str] | |
targets | dict[str, dict] | field(default_factory=dict) |
description | str | '' |
context | str | '' |
preid | str | '' |
blog | bool | False |
#get_release_file_path
def get_release_file_path(project_dir: str='.') -> strReturn the path to .rlsbl/releases/unreleased.toml relative to project_dir.
#_validate_release_config
def _validate_release_config(data: dict, prefix: str='') -> ReleaseConfigValidate release config fields from a parsed TOML dict.
Shared validation for both single-project and batch (per-package) release configs. The prefix is prepended to all error messages -- empty string for single-project, "[packages.
Raises ReleaseFileError for schema/validation failures. Returns a ReleaseConfig on success.
#read_release_file
def read_release_file(path: str) -> ReleaseConfigRead and validate a release TOML file.
Raises FileNotFoundError if the file doesn't exist. Raises ReleaseFileError for schema/validation failures.
#unfinalize_release_file
def unfinalize_release_file(releases_dir: str, version: str) -> list[str]Reverse a release-file finalization: restore vX.Y.Z.toml to unreleased.toml.
Inverse of the finalization step in release run, which renames unreleased.toml to vX.Y.Z.toml and chmods it read-only (0o444).
- No-op (returns []) if the versioned file doesn't exist.
- If unreleased.toml exists with content that differs from the versioned
file, warns on stderr and skips -- nothing is deleted.
- Otherwise removes any stale unreleased.toml, makes the versioned file
writable, and renames it back to unreleased.toml.
Returns the list of changed file paths (for committing).
#BatchReleaseConfig
Configuration from a batch release TOML file (monorepo).
packages maps either package names (implicit mode / backward compat) or releasable names (explicit mode) to their release configs. section_type indicates which top-level key was used: "packages" or "releasables".
#get_batch_release_file_path
def get_batch_release_file_path(workspace_root: str='.') -> strReturn the path to .rlsbl-monorepo/releases/unreleased.toml.
#read_batch_release_file
def read_batch_release_file(path: str) -> BatchReleaseConfigRead and validate a batch release TOML file.
Accepts either [packages. sections (implicit mode, backward compat) or [releasables. sections (explicit mode). Having both is a hard error.
Each section has the same fields as a single ReleaseConfig (bump, include, exclude, optional targets, description, context).
Raises FileNotFoundError if the file doesn't exist. Raises ReleaseFileError for schema/validation failures.
#RetryConfig
Configuration from a retry TOML file (.rlsbl/releases/retry.toml).
#get_retry_file_path
def get_retry_file_path(project_dir: str='.') -> strReturn the path to .rlsbl/releases/retry.toml relative to project_dir.
#read_retry_file
def read_retry_file(path: str) -> RetryConfigRead and validate a retry TOML file.
Raises FileNotFoundError if the file doesn't exist. Raises ReleaseFileError for schema/validation failures.