Notice from the SMonitor side. Nothing here is broken in this repository — it is recorded so the next person writing a catalog diagnostic here does not have to rediscover it.
What changed in SMonitor 0.13.0
Two deliberate semantic changes, both in the CHANGELOG as migration notes:
warn() now raises the Python warning as well as emitting the event, so pytest.warns and users' filterwarnings see it. Anything running under simplefilter("error") that previously passed may now raise.
stacklevel counts from the caller, as it does everywhere else in Python.
The larger fix: catalog warning and exception classes must take message first, with their domain fields keyword-only. Python rebuilds an exception as type(e)(*e.args) — pickle, copy.deepcopy, warnings.warn(text, category) and pytest-xdist between a worker and the controller all do it — so a class naming a domain field first receives its own rendered sentence as that field and renders the template around it a second time.
The rule is §3.3.1 of standards/SMONITOR_GUIDE.md, synced into this repository.
What this repository needs
This repository defines no catalog warning or exception classes, so nothing changes today. Two small things:
smonitor>=0.13.0 is set in pyproject.toml. It is not set in devtools/conda-build/meta.yaml, which lists smonitor with no version constraint. Worth adding before the first conda publication, otherwise a user can resolve an older SMonitor and hit the doubled-message defect this release fixed.
- If a catalog diagnostic class is ever added here, follow §3.3.1 — and consider a round-trip test alongside it. A class written the wrong way does not raise, does not fail import and does not fail any test; it only stops surviving the rebuild, silently. See
uibcdf/molsysmt#161 for the shape such a guard should take.
Background, if useful
uibcdf/molsysmt#158 — the original report and the defect it turned out to be.
pytest-dev/pytest-xdist#1372 — the remaining upstream residue: a hint interpolating a field cannot be re-rendered from args alone. Serial runs, pickle, scripts and notebooks are unaffected.
Notice from the SMonitor side. Nothing here is broken in this repository — it is recorded so the next person writing a catalog diagnostic here does not have to rediscover it.
What changed in SMonitor 0.13.0
Two deliberate semantic changes, both in the CHANGELOG as migration notes:
warn()now raises the Python warning as well as emitting the event, sopytest.warnsand users'filterwarningssee it. Anything running undersimplefilter("error")that previously passed may now raise.stacklevelcounts from the caller, as it does everywhere else in Python.The larger fix: catalog warning and exception classes must take
messagefirst, with their domain fields keyword-only. Python rebuilds an exception astype(e)(*e.args)—pickle,copy.deepcopy,warnings.warn(text, category)and pytest-xdist between a worker and the controller all do it — so a class naming a domain field first receives its own rendered sentence as that field and renders the template around it a second time.The rule is §3.3.1 of
standards/SMONITOR_GUIDE.md, synced into this repository.What this repository needs
This repository defines no catalog warning or exception classes, so nothing changes today. Two small things:
smonitor>=0.13.0is set inpyproject.toml. It is not set indevtools/conda-build/meta.yaml, which listssmonitorwith no version constraint. Worth adding before the first conda publication, otherwise a user can resolve an older SMonitor and hit the doubled-message defect this release fixed.uibcdf/molsysmt#161for the shape such a guard should take.Background, if useful
uibcdf/molsysmt#158— the original report and the defect it turned out to be.pytest-dev/pytest-xdist#1372— the remaining upstream residue: a hint interpolating a field cannot be re-rendered fromargsalone. Serial runs,pickle, scripts and notebooks are unaffected.