oso.framework.config package¶
Subpackages¶
Module contents¶
Configuration Management.
- class oso.framework.config.AutoLoadConfig[source]¶
Bases:
BaseModel
,ABC
Config that is registered on import.
A configuration model that will be automatically registered with .ConfigManager when imported.
- oso.framework.config.ImportListMixin(fields: Mapping[str, type[ImportableConfig]]) type[_ImportList] [source]¶
Define a mixin that adds
fields
into the config model.- Parameters:
fields (collections.abc.Mapping[str, type[ImportableConfig]]) – A mapping of field names to subclass of ImportableConfig to be included in the concrete class.
- Returns:
A concrete type.
- Return type:
type[‘_ImportList’]
Examples
The following:
class A(ImportableConfig): pass class B(ImportListMixin({"a": A})): pass
Equates to:
class A: type: ImportString class B: __importable_fields_map__ = { "a": A } a: A
- class oso.framework.config.ImportableConfig(*, type: ImportString)[source]¶
Bases:
BaseModel
,ABC
Config object that defines an type import.
Defines an configuration model that is importable with additional configuration fields. This is resolved to a fully discriminated type when configuration is rendered.
- type¶
The module that is required.
- Type:
pydantic.ImportString