Skip to content

Commit 97cd99a

Browse files
committed
Modify config to work with PTB 6.1.0
1 parent 29bbb09 commit 97cd99a

File tree

2 files changed

+36
-12
lines changed

2 files changed

+36
-12
lines changed

noxconfig.py

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,42 @@
1-
from collections.abc import Iterable
2-
from dataclasses import dataclass
31
from pathlib import Path
42

3+
from exasol.toolbox.config import BaseConfig
4+
55
ROOT_DIR = Path(__file__).parent
66

7+
from pydantic import computed_field
8+
9+
10+
class Config(BaseConfig):
11+
@computed_field # type: ignore[misc]
12+
@property
13+
def source_code_path(self) -> Path:
14+
"""
15+
Path to the source code of the project.
16+
17+
In transformers-extension, this needs to be overridden due to a custom directory
18+
setup. This will be addressed in:
19+
https://github.com/exasol/udf-mock-python/issues/80
20+
"""
21+
return self.root_path / self.project_name
22+
23+
@computed_field # type: ignore[misc]
24+
@property
25+
def version_filepath(self) -> Path:
26+
"""
27+
Path to the ``version.py`` file included in the project. This is an
28+
autogenerated file which contains the version of the code. It is maintained by
29+
the nox sessions ``version:check`` and ``release:prepare``.
730
8-
@dataclass(frozen=True)
9-
class Config:
10-
root: Path = ROOT_DIR
11-
doc: Path = ROOT_DIR / "doc"
12-
version_file: Path = ROOT_DIR / "version.py"
13-
path_filters: Iterable[str] = ("dist", ".eggs", "venv", ".workspace")
14-
python_versions = ["3.10", "3.11", "3.12", "3.13"]
15-
source: Path = Path("exasol_udf_mock_python")
31+
In transformers-extension, this needs to be overridden due to a custom directory
32+
setup & custom `version.py` location. This will be addressed in:
33+
https://github.com/exasol/udf-mock-python/issues/79
34+
"""
35+
return self.root_path / "version.py"
1636

1737

18-
PROJECT_CONFIG = Config()
38+
PROJECT_CONFIG = Config(
39+
project_name="exasol-udf-mock-python",
40+
root_path=ROOT_DIR,
41+
python_versions=("3.10", "3.11", "3.12", "3.13"),
42+
)

noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
from exasol.toolbox.nox.tasks import *
55

66
# default actions to be run if nothing is explicitly specified with the -s option
7-
nox.options.sessions = ["project:fix"]
7+
nox.options.sessions = ["format:fix"]

0 commit comments

Comments
 (0)