yambs.config package#

Submodules#

yambs.config.board module#

A data structure describing a board target.

class yambs.config.board.Architecture(name: str, toolchain: str, extra_cflags: List[str])[source]#

Bases: NamedTuple

An instruction-set architecture.

extra_cflags: List[str]#

Alias for field number 2

static from_dict(name: str, data: Dict[str, Any]) Architecture[source]#

Get an architecture from dictionary data.

name: str#

Alias for field number 0

toolchain: str#

Alias for field number 1

class yambs.config.board.Board(name: str, chip: Chip, extra_cflags: List[str], targets: List[str], extra_dirs: List[str], apps: Dict[str, Path])[source]#

Bases: NamedTuple

A class representing a board’s attributes.

apps: Dict[str, Path]#

Alias for field number 5

property build: Path#

Get a buld directory based on this board.

chip: Chip#

Alias for field number 1

extra_cflags: List[str]#

Alias for field number 2

extra_dirs: List[str]#

Alias for field number 4

static from_dict(data: Dict[str, Any], architectures: Dict[str, Any], chips: Dict[str, Any]) Board[source]#

Get a board from dictionary data.

name: str#

Alias for field number 0

targets: List[str]#

Alias for field number 3

class yambs.config.board.Chip(name: str, architecture: Architecture, cpu: str, extra_cflags: List[str], jlink: List[str])[source]#

Bases: NamedTuple

A microcontroller integrated circuit.

architecture: Architecture#

Alias for field number 1

cpu: str#

Alias for field number 2

extra_cflags: List[str]#

Alias for field number 3

static from_dict(name: str, data: Dict[str, Any], architectures: Dict[str, Any]) Chip[source]#

Get a chip from dictionary data.

Alias for field number 4

name: str#

Alias for field number 0

yambs.config.common module#

A module for common configuration interfaces.

class yambs.config.common.CommonConfig(data: dict[str, str | int | float | bool | None | dict[str, str | int | float | bool | None] | list[str | int | float | bool | None]] = None, schemas: SchemaMap = None, dest_attr: str = 'data', verify: bool = True)[source]#

Bases: YambsDictCodec, BasicDictCodec

A common, base configuration.

build_root: Path#
data: Dict[str, Any]#
dependencies: Set[Dependency]#
directory(name: str, mkdir: bool = True, root: Path = None) Path[source]#

Get a configurable directory.

dist_root: Path#
file: Path | None#
init(data: dict[str, str | int | float | bool | None | dict[str, str | int | float | bool | None] | list[str | int | float | bool | None]]) None[source]#

Initialize this instance.

classmethod load(path: Path | str | None = 'yambs.yaml', package_config: str = 'yambs.yaml', root: Path | str | None = None) T[source]#

Load a configuration.

ninja_root: Path#
root: Path#
src_root: Path#
third_party_root: Path#
property third_party_script: Path#

Get the path to the third-party build script.

class yambs.config.common.Project(name: str, major: int, minor: int, patch: int, repo: str, owner: str | None)[source]#

Bases: NamedTuple

An object for managing project metadata.

static create(data: dict[str, str | int | float | bool | None | dict[str, str | int | float | bool | None] | list[str | int | float | bool | None]]) Project[source]#

Create a project instance from JSON data.

major: int#

Alias for field number 1

minor: int#

Alias for field number 2

name: str#

Alias for field number 0

owner: str | None#

Alias for field number 5

patch: int#

Alias for field number 3

repo: str#

Alias for field number 4

property version: str#

Get this project’s version string.

yambs.config.native module#

A module implementing a configuration interface for native builds.

class yambs.config.native.Native(data: dict[str, str | int | float | bool | None | dict[str, str | int | float | bool | None] | list[str | int | float | bool | None]] = None, schemas: SchemaMap = None, dest_attr: str = 'data', verify: bool = True)[source]#

Bases: CommonConfig

The top-level configuration object for the package.

has_variant(name: str) bool[source]#

Determine whether or not

yambs.config.native.load_native(path: Path | str | None = 'yambs.yaml', root: Path | str | None = None) Native[source]#

Load a native configuration object.

Module contents#

A module implementing a configuration interface for the package.

class yambs.config.Config(data: dict[str, str | int | float | bool | None | dict[str, str | int | float | bool | None] | list[str | int | float | bool | None]] = None, schemas: SchemaMap = None, dest_attr: str = 'data', verify: bool = True)[source]#

Bases: CommonConfig

The top-level configuration object for the package.

board_data: List[Board]#
boards() Iterator[Tuple[Board, Dict[str, Any]]][source]#

Iterate over boards.

boards_by_name: Dict[str, Board]#
init(data: dict[str, str | int | float | bool | None | dict[str, str | int | float | bool | None] | list[str | int | float | bool | None]]) None[source]#

Initialize this instance.