Skip to content

fix(ci): Python 3.9 compat + implement ReplayDriver.query_binary_values - #182

Merged
abduznik merged 1 commit into
mainfrom
hermes/fix-py39-annotations
Aug 27, 2026
Merged

fix(ci): Python 3.9 compat + implement ReplayDriver.query_binary_values#182
abduznik merged 1 commit into
mainfrom
hermes/fix-py39-annotations

Conversation

@abduznik

Copy link
Copy Markdown
Owner

Summary

Fixes the two CI failures currently red on main.

  1. Python 3.9 test collection (TypeError)config.py:44 uses PEP 604 union syntax (-> Path | None), which is evaluated at runtime on 3.9 and raises TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'. CI matrix runs 3.9–3.13; the 3.9 job failed at collection and fail-fast cancelled the rest. Fix: from __future__ import annotations (lazy annotations — 3.9-safe, no behavior change).

  2. ReplayDriver un-instantiable (all versions) — commit e2bf7cd marked safe_send/query_ascii/query_binary_values abstract in base.py and claimed "all concrete drivers implement them… ReplayDriver" but replay.py never got query_binary_values. Any ReplayDriver(...) instantiation raises TypeError: Can't instantiate abstract class ReplayDriver with abstract method query_binary_values — affecting the golden-master tests on every Python version. Hidden only because the 3.9 collection error cancelled the rest of the matrix. Fix: implement it replay-style, mirroring query_ascii (replay response + check_errors) and parsing comma-separated floats.

Testbench (exact CI recipe, local)

  • Python 3.9.13 + Python 3.11: 492/492 passed on both
  • ruff check .: All checks passed
  • Baseline before fix (3.9): reproduced the exact CI TypeError + 3 abstract-class collection failures

Files

  • src/instrumation/config.py (+2)
  • src/instrumation/drivers/replay.py (+5)

- config.py: add 'from __future__ import annotations' so the PEP 604
  union annotation (Path | None) is not evaluated at runtime under
  Python 3.9, fixing the TypeError that broke CI test collection.
- replay.py: implement query_binary_values, the abstract method that
  commit e2bf7cd added to base.py but never implemented in
  ReplayDriver, making the class un-instantiable on every Python
  version. Mirrors query_ascii semantics: replays the response and
  parses comma-separated values to floats.
@abduznik
abduznik marked this pull request as ready for review August 27, 2026 19:43
@abduznik
abduznik merged commit 08da6fb into main Aug 27, 2026
6 checks passed
@abduznik
abduznik deleted the hermes/fix-py39-annotations branch August 27, 2026 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant