Skip to content

Defer annotations that subscript non-generic VM classes (Python 3.12/3.13 compatibility)#515

Merged
proboscis merged 1 commit into
mainfrom
fix-pre314-annotations
Jul 12, 2026
Merged

Defer annotations that subscript non-generic VM classes (Python 3.12/3.13 compatibility)#515
proboscis merged 1 commit into
mainfrom
fix-pre314-annotations

Conversation

@proboscis

Copy link
Copy Markdown
Owner

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_vm pyclasses (DoExpr/Program, Ok) are not runtime-generic. Before Python 3.14's lazy annotations (PEP 649), Program[int] / Ok[...] raise TypeError: type '...' is not subscriptable wherever the annotation is actually evaluated:

  • module-level dataclass fields (doeff_gemini/types.py → any import of doeff_gemini, which tests/test_llm_multi_provider_handlers.py does → collection Interrupted),
  • module-level function signatures (packages/doeff-vm/tests/test_traceback_pure_python_frames.pycollection Interrupted),
  • test-local 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 annotations in each file.

Measured (integration state = main + #491 + #508#511)

  • Before: 3.12/3.13 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.
  • Python 3.10/3.11 remain untestable at the workspace level: uv sync refuses because the workspace's effective requires-python is >=3.12 (doeff-docker/doeff-ml-nexus) — a workspace-level decision, out of scope here.
  • The Python Compatibility workflow (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

…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>
@proboscis

Copy link
Copy Markdown
Owner Author

Full-suite numbers after this PR's fixes (integration state = main + #491 + #508#511 + the #510 time_queue fix), local run:

  • Python 3.12.13: pytest -q1082 passed, 86 skipped, 1 xpassed, 0 failed (56s)
  • Python 3.13.12: pytest -q1082 passed, 86 skipped, 1 xpassed, 0 failed (62s)

(The 1 xpass is the known stale xfail marker that #493's fix makes pass — see #508/#510 follow-up.)

Baseline before the fixes on the same state: collection Interrupted on both versions (2 errors), and 5 runtime TypeError failures in tests/effects/test_pure_effect.py once collection was repaired.

@proboscis
proboscis merged commit f521882 into main Jul 12, 2026
1 check passed
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