File size: 1,644 Bytes
a755486 | 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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | """greencheck — discriminability testing for self-reported metrics."""
from .core import (
ALL_VERDICTS,
BARE_ZERO,
CONSTANT,
DEAD_GATE,
IDENTITY,
LIVENESS_BIT,
NO_DATA,
PASS,
AuditResult,
Finding,
ProbePair,
audit_gate,
audit_gate_counts,
audit_ledger,
discriminate,
get_path,
load_jsonl,
)
def _resolve_version() -> str:
"""Single source of truth for the version: pyproject.toml.
A second copy hardcoded here would drift from it sooner or later, and a
package that reports a version different from the one it was built as is
exactly the failure this whole tool is about. So there is one copy.
"""
try: # installed: read back the metadata the installer wrote
from importlib.metadata import version as _dist_version
return _dist_version("greencheck")
except Exception:
pass
try: # running from a source checkout
import pathlib
import re
pyproject = pathlib.Path(__file__).resolve().parent.parent / "pyproject.toml"
m = re.search(r'^version\s*=\s*"([^"]+)"', pyproject.read_text(encoding="utf-8"), re.M)
if m:
return m.group(1)
except Exception:
pass
return "0.0.0+unknown"
__version__ = _resolve_version()
__all__ = [
"ALL_VERDICTS",
"BARE_ZERO",
"CONSTANT",
"DEAD_GATE",
"IDENTITY",
"LIVENESS_BIT",
"NO_DATA",
"PASS",
"AuditResult",
"Finding",
"ProbePair",
"audit_gate",
"audit_gate_counts",
"audit_ledger",
"discriminate",
"get_path",
"load_jsonl",
"__version__",
]
|