File: defs.py

package info (click to toggle)
python-regex 0.1.20250918-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,660 kB
  • sloc: ansic: 50,018; python: 8,762; makefile: 15; sh: 7
file content (46 lines) | stat: -rw-r--r-- 1,124 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# SPDX-FileCopyrightText: Peter Pentchev <roam@ringlet.net>
# SPDX-License-Identifier: BSD-2-Clause
"""Common definitions for the regex test runner tool."""

from __future__ import annotations

import dataclasses
import typing


if typing.TYPE_CHECKING:
    import logging
    import pathlib
    from typing import Final


VERSION: Final = "0.1.0"
"""The test tool version, semver-like."""


FEATURES: Final = {
    "temptest": VERSION,
    "pybuild": "0.1",
    "srcdir": "0.1",
}
"""The list of features supported by the test tool."""


@dataclasses.dataclass(frozen=True)
class Config:
    """Runtime configuration for the test tool."""

    log: logging.Logger
    """The logger to send diagnostic, informational, and error messages to."""

    pybuild: pathlib.Path | None
    """The .pybuild directory to look for the built Python module in."""

    pypath: pathlib.Path | None
    """The built Python module parent directory to add to PYTHONPATH."""

    srcdir: pathlib.Path
    """The directory to look for the regex module source code."""

    verbose: bool
    """Verbose operation; display diagnostic output."""