Universal Configuration
Universal Configuration refers to configuration keys given by pytoolconfig. You can overwrite your own configuration keys with the ones provided by pytoolconfig.
In your configuration model, set the universal_config
value in the Field
constructor. (This only works for items in the base model). You still need to set a default value.
For example:
from pytoolconfig import dataclass, field, UniversalKey
@dataclass
class NestedModel:
foo_other: str = field(
description="w", default="no", universal_config=UniversalKey.min_py_version
)
The value of this field will be overwritten by pytoolconfig’s equivalent universal configuration field.
Available configuration keys:
name |
description |
type |
default |
---|---|---|---|
formatter |
Formatter used to format this File |
str | None |
|
max_line_length |
Maximum line length |
int | None |
|
min_py_version |
Minimum target python version. Requires PEP 621. Taken from project.requires-python |
tuple[int, int] | None |
|
max_py_version |
Maximum target python version. Requires PEP 621. Taken from project.requires-python |
tuple[int, int] | None |
|
dependencies |
Dependencies of project. Requires PEP 621. Taken from project.dependencies. |
list[Requirement] | None |
|
optional_dependencies |
Optional dependencies of project. Requires PEP 621. Taken from project.optional_dependencies. |
dict[str, list[Requirement]] | None |
|
version |
Version of the project. Requires PEP 621. Taken from project.version. |
str | None |