Skip to content

SMonitor 0.13.0: catalog class shape, and the conda recipe has no version floor #68

Description

@dprada

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:

  1. 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.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions