Skip to content

Commit 7610dba

Browse files
committed
Update documentation
1 parent 67f54fe commit 7610dba

File tree

4 files changed

+32
-16
lines changed

4 files changed

+32
-16
lines changed

doc/changes/unreleased.md

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,32 @@
11
# Unreleased
22

3-
Verification of the Python/Exasol version format of the config by adding a BaseConfig class. To Use:
4-
5-
#Use
6-
Project_Config = BaseConfig()
7-
#modify
8-
Project_Config = BaseConfig(python_versions=["3.12"])
9-
#expand
10-
class ProjectConfig(BaseConfig):
11-
extra_data: list[str] = ["data"]
12-
13-
Project_Config = ProjectConfig()
3+
## BaseConfig class for PTB attributes
4+
5+
The BaseConfig class was introduced in this version. This class is used to consolidate
6+
the attributes needed for the PTB's functionalities into an inherited object which can
7+
be expanded upon as needed. At this point, the BaseConfig class includes
8+
``python_versions``, ``exasol_versions``, and ``create_major_version_tags``. Users of
9+
the PTB should update their ``noxconfig.py`` to start using this feature.
10+
11+
```python
12+
# noxconfig.py
13+
from exasol.toolbox.config import BaseConfig
14+
15+
16+
# existing Config should inherit from BaseConfig
17+
class Config(BaseConfig):
18+
# if present, remove any attributes already in the BaseConfig from the added attributes
19+
...
20+
21+
22+
# if no overlapping attributes with `BaseConfig` were present in `Config`, then this is unmodified.
23+
PROJECT_CONFIG = Config()
24+
# if no overlapping attributes with `BaseConfig` were present in `Config`, then this should be modified.
25+
PROJECT_CONFIG = Config(python_versions=(...), exasol_versions=(...), create_major_version_tags=True)
26+
```
1427

1528
## Feature
1629

17-
#465: Create BaseConfig class
30+
* #465: Created BaseConfig class to better synchronize attributes needed for the PTB's
31+
growing functionalities
32+
* Started with ``python_versions`` and ``exasol_versions``

exasol/toolbox/config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ class BaseConfig(BaseModel):
5151
default=("7.1.9",),
5252
description="Exasol versions to use in running CI workflows for integration tests using the DB",
5353
)
54+
create_major_version_tags: bool = Field(
55+
default=False,
56+
description="If true, creates also the major version tags (v*) automatically",
57+
)
5458
model_config = ConfigDict(frozen=True, arbitrary_types_allowed=True)
5559

5660
@computed_field # type: ignore[misc]

noxconfig.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ class Config(BaseConfig):
6868
# format, and it is not resolved with from __future__ import annotations. pyupgrade
6969
# will keep switching Optional[str] to str | None leading to issues.
7070
pyupgrade_args: Iterable[str] = ("--py39-plus", "--keep-runtime-typing")
71-
create_major_version_tags = True
7271

7372

74-
PROJECT_CONFIG = Config()
73+
PROJECT_CONFIG = Config(create_major_version_tags=True)

project-template/{{cookiecutter.repo_name}}/noxconfig.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,5 @@ class Config(BaseConfig):
2020
pyupgrade_args: Iterable[str] = (
2121
"--py{{cookiecutter.python_version_min | replace('.', '')}}-plus",)
2222
plugins: Iterable[object] = ()
23-
create_major_version_tags = False
24-
2523

2624
PROJECT_CONFIG = Config()

0 commit comments

Comments
 (0)