Defer annotations that subscript non-generic VM classes (Python 3.12/3.13 compatibility)#515
Merged
Merged
Conversation
…2/3.13 can collect and run the suite doeff_vm pyclasses (DoExpr/Program, Ok) are not runtime-generic; before Python 3.14's lazy annotations, Program[int] / Ok[...] in module-level dataclass fields, module-level function signatures, and test-local def signatures raise TypeError at import or at test execution. These three files were the only runtime-reachable instances: with them fixed (plus doeff-time's time_queue.py on the fix-time-contract branch) the full root testpaths run passes on 3.12 and 3.13 locally. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Owner
Author
|
Full-suite numbers after this PR's fixes (integration state = main + #491 + #508–#511 + the #510 time_queue fix), local run:
(The 1 xpass is the known stale Baseline before the fixes on the same state: collection Interrupted on both versions (2 errors), and 5 runtime |
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.
Companion to #510 (which carries the same fix for
doeff-time/time_queue.py); surfaced while locally verifying the audit-fix PRs (#508–#511) on Python 3.12/3.13.Mechanism
doeff_vmpyclasses (DoExpr/Program,Ok) are not runtime-generic. Before Python 3.14's lazy annotations (PEP 649),Program[int]/Ok[...]raiseTypeError: type '...' is not subscriptablewherever the annotation is actually evaluated:doeff_gemini/types.py→ any import ofdoeff_gemini, whichtests/test_llm_multi_provider_handlers.pydoes → collection Interrupted),packages/doeff-vm/tests/test_traceback_pure_python_frames.py→ collection Interrupted),def ... -> Program[int]signatures (tests/effects/test_pure_effect.py→ 5 test-time failures).All are masked on 3.14, so the 3.14-only local/CI habit never saw them. Fix:
from __future__ import annotationsin each file.Measured (integration state = main + #491 + #508–#511)
pytest -q→ collection Interrupted (2 errors); after collection fixes: 5 failed / 1077 passed; after this PR's full set: targeted file 6 passed on 3.12 and 3.13, full-suite rerun in progress at time of writing — final numbers in the PR comment below.uv syncrefuses because the workspace's effectiverequires-pythonis>=3.12(doeff-docker/doeff-ml-nexus) — a workspace-level decision, out of scope here.Python Compatibilityworkflow (the only pytest CI) is manually disabled; re-enabling it is the durable guard once this and Return a program-wrapped handler from sim_time_handler and the spawned Task from ScheduleAt (#499, #503) #510 land.🤖 Generated with Claude Code