Skip to content

Commit 7aa3e5c

Browse files
committed
chore: entity exports, pyproject config
1 parent 82f736b commit 7aa3e5c

5 files changed

Lines changed: 357 additions & 1 deletion

File tree

protest/entities/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
format_fixture_scope,
1111
)
1212
from protest.entities.events import (
13+
EvalPayload,
14+
EvalScoreEntry,
1315
FixtureInfo,
1416
HandlerInfo,
1517
RunResult,
@@ -31,6 +33,8 @@
3133
from protest.entities.xfail import Xfail, normalize_xfail
3234

3335
__all__ = [
36+
"EvalPayload",
37+
"EvalScoreEntry",
3438
"Fixture",
3539
"FixtureCallable",
3640
"FixtureInfo",

protest/entities/core.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class TestRegistration:
4949
xfail: Xfail | None = None
5050
timeout: float | None = None
5151
retry: Retry | None = None
52+
is_eval: bool = False
5253

5354

5455
@dataclass(frozen=True, slots=True)
@@ -111,6 +112,7 @@ class TestItem:
111112
xfail: Xfail | None = None
112113
timeout: float | None = None
113114
retry: Retry | None = None
115+
is_eval: bool = False
114116

115117
@property
116118
def test_name(self) -> str:

protest/entities/suite_path.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ def lower(self) -> str:
5858
"""Return lowercase string representation for case-insensitive comparison."""
5959
return self._path.lower()
6060

61+
@property
62+
def root_name(self) -> str:
63+
"""Return the top-level suite name: 'A::B::C' -> 'A'."""
64+
return self.parts[0] if self.parts else ""
65+
6166
def __str__(self) -> str:
6267
return self._path
6368

pyproject.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ rich = [
4949
web = [
5050
"websockets>=12.0",
5151
]
52+
evals = [
53+
"pydantic-evals>=0.1",
54+
]
5255

5356

5457
[tool.ruff]
@@ -100,6 +103,23 @@ ignore = [
100103
"PLC0415", # lazy import for optional rich dependency
101104
"PLR0913", # many args is deliberate API design
102105
]
106+
"protest/core/execution/test_executor.py" = [
107+
"PLR0915", # _run_test is inherently complex (retry loop + eval capture)
108+
]
109+
"protest/history/**" = [
110+
"PLC0415", # lazy imports
111+
"S603", # subprocess git calls are safe
112+
"PLR0913", # load_history has many filter params by design
113+
]
114+
"protest/cli/history.py" = [
115+
"T201", # print for CLI output
116+
"PLC0415", # lazy imports
117+
]
118+
"protest/evals/**" = [
119+
"T201", # print for eval reporting
120+
"PLC0415", # lazy imports for optional pydantic-evals dependency
121+
"PLR0913", # adapter functions have many params by design
122+
]
103123
"protest/reporting/ascii.py" = [
104124
"T201", # print is the purpose of this module
105125
]

0 commit comments

Comments
 (0)