tmt.config.models package

Submodules

tmt.config.models.hardware module

class tmt.config.models.hardware.HardwareConfig(*, beaker: MrackHardware)

Bases: MetadataContainer

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

beaker: MrackHardware
model_config: ClassVar[ConfigDict] = {'alias_generator': <function key_to_option>, 'extra': 'forbid', 'validate_assignment': True, 'validate_default': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

class tmt.config.models.hardware.MrackHardware(*, translations: list[MrackTranslation])

Bases: MetadataContainer

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config: ClassVar[ConfigDict] = {'alias_generator': <function key_to_option>, 'extra': 'forbid', 'validate_assignment': True, 'validate_default': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

translations: list[MrackTranslation]
class tmt.config.models.hardware.MrackTranslation(*, requirement: str, template: str)

Bases: MetadataContainer

Here’s a full config example:

beaker:
  translations:
    - requirement: cpu.processors
      template: '{"cpu": {"processors": {"_op": "{{ OPERATOR }}", "_value": "{{ VALUE }}"}}}'

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config: ClassVar[ConfigDict] = {'alias_generator': <function key_to_option>, 'extra': 'forbid', 'validate_assignment': True, 'validate_default': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

requirement: str
template: str

tmt.config.models.themes module

class tmt.config.models.themes.Linter(*, outcome: LinterOutcome)

Bases: _Theme

Styles for linter output.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

model_config: ClassVar[ConfigDict] = {'alias_generator': <function key_to_option>, 'extra': 'forbid', 'validate_assignment': True, 'validate_default': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

outcome: LinterOutcome
class tmt.config.models.themes.LinterOutcome(*, skip: Style = Style(fg=None, bg=None, bold=None, dim=None, underline=None, italic=None, blink=None, strikethrough=None), pass_: Style = Style(fg=None, bg=None, bold=None, dim=None, underline=None, italic=None, blink=None, strikethrough=None), fail: Style = Style(fg=None, bg=None, bold=None, dim=None, underline=None, italic=None, blink=None, strikethrough=None), warn: Style = Style(fg=None, bg=None, bold=None, dim=None, underline=None, italic=None, blink=None, strikethrough=None), fixed: Style = Style(fg=None, bg=None, bold=None, dim=None, underline=None, italic=None, blink=None, strikethrough=None))

Bases: _Theme

Styles for outcomes of various linter rules.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

fail: Style
fixed: Style
get_style(field: str) Style

Return a style when the field name is dynamic.

A safer, type-annotated variant of getattr(theme, field).

model_config: ClassVar[ConfigDict] = {'alias_generator': <function key_to_option>, 'extra': 'forbid', 'validate_assignment': True, 'validate_default': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

pass_: Style
skip: Style
warn: Style
class tmt.config.models.themes.Style(*, fg: int | tuple[int, int, int] | str | None = None, bg: int | tuple[int, int, int] | str | None = None, bold: bool | None = None, dim: bool | None = None, underline: bool | None = None, italic: bool | None = None, blink: bool | None = None, strikethrough: bool | None = None)

Bases: MetadataContainer

A collection of parameters accepted by click.style().

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

apply(text: str) str

Apply this style to a given string.

bg: int | tuple[int, int, int] | str | None
bold: bool | None
dim: bool | None
fg: int | tuple[int, int, int] | str | None
italic: bool | None
model_config: ClassVar[ConfigDict] = {'alias_generator': <function key_to_option>, 'extra': 'forbid', 'validate_assignment': True, 'validate_default': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

strikethrough: bool | None
underline: bool | None
class tmt.config.models.themes.Theme(*, linter: Linter, restructuredtext_text: Style = Style(fg=None, bg=None, bold=None, dim=None, underline=None, italic=None, blink=None, strikethrough=None), restructuredtext_literal: Style = Style(fg=None, bg=None, bold=None, dim=None, underline=None, italic=None, blink=None, strikethrough=None), restructuredtext_emphasis: Style = Style(fg=None, bg=None, bold=None, dim=None, underline=None, italic=None, blink=None, strikethrough=None), restructuredtext_strong: Style = Style(fg=None, bg=None, bold=None, dim=None, underline=None, italic=None, blink=None, strikethrough=None), restructuredtext_literalblock: Style = Style(fg=None, bg=None, bold=None, dim=None, underline=None, italic=None, blink=None, strikethrough=None), restructuredtext_literalblock_yaml: Style = Style(fg=None, bg=None, bold=None, dim=None, underline=None, italic=None, blink=None, strikethrough=None), restructuredtext_literalblock_shell: Style = Style(fg=None, bg=None, bold=None, dim=None, underline=None, italic=None, blink=None, strikethrough=None), restructuredtext_admonition_note: Style = Style(fg=None, bg=None, bold=None, dim=None, underline=None, italic=None, blink=None, strikethrough=None), restructuredtext_admonition_warning: Style = Style(fg=None, bg=None, bold=None, dim=None, underline=None, italic=None, blink=None, strikethrough=None))

Bases: _Theme

A collection of items tmt uses to colorize various tokens of its CLI.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

classmethod from_file(path: Path) Theme
classmethod from_spec(data: Any) Theme
linter: Linter
model_config: ClassVar[ConfigDict] = {'alias_generator': <function key_to_option>, 'extra': 'forbid', 'validate_assignment': True, 'validate_default': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

restructuredtext_admonition_note: Style
restructuredtext_admonition_warning: Style
restructuredtext_emphasis: Style
restructuredtext_literal: Style
restructuredtext_literalblock: Style
restructuredtext_literalblock_shell: Style
restructuredtext_literalblock_yaml: Style
restructuredtext_strong: Style
restructuredtext_text: Style
class tmt.config.models.themes.ThemeConfig(*, active_theme: str = 'default')

Bases: MetadataContainer

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

active_theme: str
get_active_theme(logger: Logger) Theme
classmethod get_default_theme(logger: Logger) Theme
classmethod load_theme(theme_name: str, logger: Logger) Theme
model_config: ClassVar[ConfigDict] = {'alias_generator': <function key_to_option>, 'extra': 'forbid', 'validate_assignment': True, 'validate_default': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

Module contents