fix(ci): Python 3.9 compat + implement ReplayDriver.query_binary_values - #182
Merged
Conversation
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the two CI failures currently red on
main.Python 3.9 test collection (TypeError) —
config.py:44uses PEP 604 union syntax (-> Path | None), which is evaluated at runtime on 3.9 and raisesTypeError: 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).ReplayDriver un-instantiable (all versions) — commit e2bf7cd marked
safe_send/query_ascii/query_binary_valuesabstract inbase.pyand claimed "all concrete drivers implement them… ReplayDriver" butreplay.pynever gotquery_binary_values. AnyReplayDriver(...)instantiation raisesTypeError: 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, mirroringquery_ascii(replay response + check_errors) and parsing comma-separated floats.Testbench (exact CI recipe, local)
ruff check .: All checks passedFiles
src/instrumation/config.py(+2)src/instrumation/drivers/replay.py(+5)