userfs.config package

Contents

userfs.config package#

Submodules#

userfs.config.project module#

A module implementing a data structure describing projects.

class userfs.config.project.ProjectInteraction(*values)[source]#

Bases: Enum

Kinds of project interactions.

BUILD = 'build'#
CUSTOM = 'custom'#
DEPLOY = 'deploy'#
FETCH = 'fetch'#
UPDATE = 'update'#
class userfs.config.project.ProjectSpecification(source: SourceSpecification, logger: Logger | LoggerAdapter[Any], path: str, repository: str, attributes: Dict[str, Any], options: Dict[ProjectInteraction, Dict[str, Any]])[source]#

Bases: object

Information describing a software project and how to obtain it.

attributes: Dict[str, Any]#
static from_json(data: dict[str, str | int | float | bool | None | dict[str, str | int | float | bool | None] | list[str | int | float | bool | None]], source: SourceSpecification, key: str) ProjectSpecification[source]#

Create a project specification from JSON data.

location(root: Path | str | None = None) Path[source]#

Get a disk location for this project.

logger: Logger | LoggerAdapter[Any]#
options: Dict[ProjectInteraction, Dict[str, Any]]#
path: str#
repository: str#
source: SourceSpecification#
property url: str#

Get a URL to this project’s source.

userfs.config.source module#

A module implementing a data structure for project sources.

class userfs.config.source.SourceKind(*values)[source]#

Bases: Enum

An enumeration describing kinds of sources.

GIT = 'git'#
SRC = 'src'#
class userfs.config.source.SourceSpecification(kind: SourceKind, suffix: str, protocol: str, user: str, port: int | None, host: str, attributes: Dict[str, Any])[source]#

Bases: object

Informaiton describing a source specification.

attributes: Dict[str, Any]#
static from_json(data: dict[str, str | int | float | bool | None | dict[str, str | int | float | bool | None] | list[str | int | float | bool | None]]) SourceSpecification[source]#

Create a source specification from JSON data.

host: str#
kind: SourceKind#
port: int | None#
protocol: str#
suffix: str#
user: str#

Module contents#

A module implementing a configuration interface for the package.

class userfs.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: UserfsDictCodec, BasicDictCodec

The top-level configuration object for the package.

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.

class userfs.config.ProjectInteraction(*values)[source]#

Bases: Enum

Kinds of project interactions.

BUILD = 'build'#
CUSTOM = 'custom'#
DEPLOY = 'deploy'#
FETCH = 'fetch'#
UPDATE = 'update'#
class userfs.config.ProjectSpecification(source: SourceSpecification, logger: Logger | LoggerAdapter[Any], path: str, repository: str, attributes: Dict[str, Any], options: Dict[ProjectInteraction, Dict[str, Any]])[source]#

Bases: object

Information describing a software project and how to obtain it.

attributes: Dict[str, Any]#
static from_json(data: dict[str, str | int | float | bool | None | dict[str, str | int | float | bool | None] | list[str | int | float | bool | None]], source: SourceSpecification, key: str) ProjectSpecification[source]#

Create a project specification from JSON data.

location(root: Path | str | None = None) Path[source]#

Get a disk location for this project.

logger: Logger | LoggerAdapter[Any]#
options: Dict[ProjectInteraction, Dict[str, Any]]#
path: str#
repository: str#
source: SourceSpecification#
property url: str#

Get a URL to this project’s source.

class userfs.config.SourceKind(*values)[source]#

Bases: Enum

An enumeration describing kinds of sources.

GIT = 'git'#
SRC = 'src'#
class userfs.config.SourceSpecification(kind: SourceKind, suffix: str, protocol: str, user: str, port: int | None, host: str, attributes: Dict[str, Any])[source]#

Bases: object

Informaiton describing a source specification.

attributes: Dict[str, Any]#
static from_json(data: dict[str, str | int | float | bool | None | dict[str, str | int | float | bool | None] | list[str | int | float | bool | None]]) SourceSpecification[source]#

Create a source specification from JSON data.

host: str#
kind: SourceKind#
port: int | None#
protocol: str#
suffix: str#
user: str#
userfs.config.load_config(root: Path | str | None = None, name: str = 'config.yaml') Config[source]#

Load this package’s configuration as a managed context. If changed at runtime, changes will be written back to disk.