| 1 |
|
| 2 |
|
| 3 |
"""Common definitions for the regex test runner tool.""" |
| 4 |
|
| 5 |
from __future__ import annotations |
| 6 |
|
| 7 |
import dataclasses |
| 8 |
import typing |
| 9 |
|
| 10 |
|
| 11 |
if typing.TYPE_CHECKING: |
| 12 |
import logging |
| 13 |
import pathlib |
| 14 |
from typing import Final |
| 15 |
|
| 16 |
|
| 17 |
VERSION: Final = "0.1.0" |
| 18 |
"""The test tool version, semver-like.""" |
| 19 |
|
| 20 |
|
| 21 |
FEATURES: Final = { |
| 22 |
"temptest": VERSION, |
| 23 |
"pybuild": "0.1", |
| 24 |
"srcdir": "0.1", |
| 25 |
} |
| 26 |
"""The list of features supported by the test tool.""" |
| 27 |
|
| 28 |
|
| 29 |
@dataclasses.dataclass(frozen=True) |
| 30 |
class Config: |
| 31 |
"""Runtime configuration for the test tool.""" |
| 32 |
|
| 33 |
log: logging.Logger |
| 34 |
"""The logger to send diagnostic, informational, and error messages to.""" |
| 35 |
|
| 36 |
pybuild: pathlib.Path | None |
| 37 |
"""The .pybuild directory to look for the built Python module in.""" |
| 38 |
|
| 39 |
pypath: pathlib.Path | None |
| 40 |
"""The built Python module parent directory to add to PYTHONPATH.""" |
| 41 |
|
| 42 |
srcdir: pathlib.Path |
| 43 |
"""The directory to look for the regex module source code.""" |
| 44 |
|
| 45 |
verbose: bool |
| 46 |
"""Verbose operation; display diagnostic output.""" |