Operation Sets

Operation set parsing, validation, resolution, inspection, and writing.

class oduit.operation_sets.InstallSetSection(addons: 'tuple[str, ...]' = (), with_demo: 'bool' = False, without_demo: 'bool | str' = False, language: 'str | None' = None, max_cron_threads: 'int | None' = None, compact: 'bool' = False, log_level: 'str | None' = None, verify_state: 'bool' = True, retry_missing: 'int' = 0, one_by_one: 'bool' = False, stop_on_error: 'bool' = True, skip_installed: 'bool' = True)[source]

Bases: object

addons: tuple[str, ...] = ()
with_demo: bool = False
without_demo: bool | str = False
language: str | None = None
max_cron_threads: int | None = None
compact: bool = False
log_level: str | None = None
verify_state: bool = True
retry_missing: int = 0
one_by_one: bool = False
stop_on_error: bool = True
skip_installed: bool = True
__init__(addons: tuple[str, ...] = (), with_demo: bool = False, without_demo: bool | str = False, language: str | None = None, max_cron_threads: int | None = None, compact: bool = False, log_level: str | None = None, verify_state: bool = True, retry_missing: int = 0, one_by_one: bool = False, stop_on_error: bool = True, skip_installed: bool = True) None
class oduit.operation_sets.UpdateSetSection(addons: 'tuple[str, ...]' = (), without_demo: 'bool | str' = False, language: 'str | None' = None, i18n_overwrite: 'bool' = False, max_cron_threads: 'int | None' = None, compact: 'bool' = False, log_level: 'str | None' = None, verify_state: 'bool' = True, retry_missing: 'int' = 0, one_by_one: 'bool' = False, stop_on_error: 'bool' = True, require_installed: 'bool' = True)[source]

Bases: object

addons: tuple[str, ...] = ()
without_demo: bool | str = False
language: str | None = None
i18n_overwrite: bool = False
max_cron_threads: int | None = None
compact: bool = False
log_level: str | None = None
verify_state: bool = True
retry_missing: int = 0
one_by_one: bool = False
stop_on_error: bool = True
require_installed: bool = True
__init__(addons: tuple[str, ...] = (), without_demo: bool | str = False, language: str | None = None, i18n_overwrite: bool = False, max_cron_threads: int | None = None, compact: bool = False, log_level: str | None = None, verify_state: bool = True, retry_missing: int = 0, one_by_one: bool = False, stop_on_error: bool = True, require_installed: bool = True) None
class oduit.operation_sets.TestSetSection(install: 'tuple[str, ...]' = (), update: 'tuple[str, ...]' = (), test_tags: 'tuple[str, ...]' = (), test_files: 'tuple[Path, ...]' = (), test_file_inputs: 'tuple[str, ...]' = (), coverage: 'str | None' = None, compact: 'bool' = False, stop_on_error: 'bool' = False, log_level: 'str | None' = None, verify_state: 'bool' = True, retry_missing: 'int' = 0, one_by_one: 'bool' = False, retry_failed_tests: 'int' = 0)[source]

Bases: object

install: tuple[str, ...] = ()
update: tuple[str, ...] = ()
test_tags: tuple[str, ...] = ()
test_files: tuple[Path, ...] = ()
test_file_inputs: tuple[str, ...] = ()
coverage: str | None = None
compact: bool = False
stop_on_error: bool = False
log_level: str | None = None
verify_state: bool = True
retry_missing: int = 0
one_by_one: bool = False
retry_failed_tests: int = 0
__init__(install: tuple[str, ...] = (), update: tuple[str, ...] = (), test_tags: tuple[str, ...] = (), test_files: tuple[Path, ...] = (), test_file_inputs: tuple[str, ...] = (), coverage: str | None = None, compact: bool = False, stop_on_error: bool = False, log_level: str | None = None, verify_state: bool = True, retry_missing: int = 0, one_by_one: bool = False, retry_failed_tests: int = 0) None
class oduit.operation_sets.OperationSetLocationContext(cwd: 'Path', active_config_path: 'Path | None' = None, active_config_source: 'str | None' = None, global_config_dir: 'Path | None' = None)[source]

Bases: object

cwd: Path
active_config_path: Path | None = None
active_config_source: str | None = None
global_config_dir: Path | None = None
__init__(cwd: Path, active_config_path: Path | None = None, active_config_source: str | None = None, global_config_dir: Path | None = None) None
class oduit.operation_sets.OperationSetResolution(reference: 'str', path: 'Path', source: 'str', attempted: 'tuple[Path, ...]')[source]

Bases: object

reference: str
path: Path
source: str
attempted: tuple[Path, ...]
__init__(reference: str, path: Path, source: str, attempted: tuple[Path, ...]) None
class oduit.operation_sets.OperationSetWriteResult(path: 'Path', reference: 'str', kind: 'OperationSetKind', addon_count: 'int', overwritten: 'bool')[source]

Bases: object

path: Path
reference: str
kind: Literal['install', 'update', 'test']
addon_count: int
overwritten: bool
__init__(path: Path, reference: str, kind: Literal['install', 'update', 'test'], addon_count: int, overwritten: bool) None
class oduit.operation_sets.OperationSet(path: 'Path', requested_value: 'str', kind: 'OperationSetKind', schema_version: 'int' = 2, name: 'str | None' = None, description: 'str | None' = None, metadata: 'Mapping[str, Any]'=<factory>, source: 'Mapping[str, Any]'=<factory>, install: 'InstallSetSection | None' = None, update: 'UpdateSetSection | None' = None, test: 'TestSetSection | None' = None, resolution_source: 'str | None' = None)[source]

Bases: object

path: Path
requested_value: str
kind: Literal['install', 'update', 'test']
schema_version: int = 2
name: str | None = None
description: str | None = None
metadata: Mapping[str, Any]
source: Mapping[str, Any]
install: InstallSetSection | None = None
update: UpdateSetSection | None = None
test: TestSetSection | None = None
resolution_source: str | None = None
__init__(path: ~pathlib.Path, requested_value: str, kind: ~typing.Literal['install', 'update', 'test'], schema_version: int = 2, name: str | None = None, description: str | None = None, metadata: ~collections.abc.Mapping[str, ~typing.Any] = <factory>, source: ~collections.abc.Mapping[str, ~typing.Any] = <factory>, install: ~oduit.operation_sets.InstallSetSection | None = None, update: ~oduit.operation_sets.UpdateSetSection | None = None, test: ~oduit.operation_sets.TestSetSection | None = None, resolution_source: str | None = None) None
oduit.operation_sets.build_operation_set_location_context(*, cwd: Path, config_path: str | None, config_source: str | None, config_dir: str | None) OperationSetLocationContext[source]
oduit.operation_sets.resolve_operation_set_path(value: str, *, context: OperationSetLocationContext | None = None, base_dir: Path | None = None) OperationSetResolution[source]

Resolve a user-provided set reference to an absolute path.

oduit.operation_sets.resolve_operation_set_write_path(value: str, *, context: OperationSetLocationContext | None = None, base_dir: Path | None = None, overwrite: bool = False) OperationSetResolution[source]

Resolve the target path for writing an operation set.

oduit.operation_sets.load_operation_set(value: str, *, context: OperationSetLocationContext | None = None, base_dir: Path | None = None, allow_missing_test_files: bool = False) OperationSet[source]

Load and validate an operation set from a user-provided reference.

oduit.operation_sets.find_missing_operation_set_addons(operation_set: OperationSet, *, addons_path: str, module_manager_cls: type | None = None) list[str][source]
oduit.operation_sets.validate_operation_set_addons(operation_set: OperationSet, *, addons_path: str, module_manager_cls: type | None = None) None[source]

Validate that all addon names in the set exist in the addons path.

oduit.operation_sets.inspect_operation_set(operation_set: OperationSet, *, addons_path: str | None = None, module_manager_cls: type | None = None) dict[str, Any][source]
oduit.operation_sets.build_operation_set_document(*, kind: Literal['install', 'update', 'test'], addons: Sequence[str], name: str | None = None, description: str | None = None, metadata: Mapping[str, Any] | None = None, source: Mapping[str, Any] | None = None, options: Mapping[str, Any] | None = None) dict[str, Any][source]
oduit.operation_sets.write_operation_set(reference: str, *, kind: Literal['install', 'update', 'test'], addons: Sequence[str], context: OperationSetLocationContext | None = None, base_dir: Path | None = None, overwrite: bool = False, name: str | None = None, description: str | None = None, metadata: Mapping[str, Any] | None = None, source: Mapping[str, Any] | None = None, options: Mapping[str, Any] | None = None) OperationSetWriteResult[source]
oduit.operation_sets.list_operation_sets(*, context: OperationSetLocationContext) list[OperationSetResolution][source]
oduit.operation_sets.build_operation_set_result(operation_set: OperationSet, *, results: list[dict[str, Any]], failures: list[dict[str, Any]], started_at: float) dict[str, Any][source]

Build the aggregate result for an operation set execution.

oduit.operation_sets.sanitize_operation_result(result: dict[str, Any], *, include_command: bool, include_stdout: bool) dict[str, Any][source]

Remove sensitive or verbose fields from a per-operation result.

Overview

oduit.operation_sets parses, validates, resolves, inspects, writes, and aggregates reusable operation set files. It is used by the CLI set command group and by commands that save addon lists with --save-set.