Skip to content

fix: evaluate task annotations consistently across Python versions - #1025

Merged
tobiasraabe merged 3 commits into
mainfrom
codex/annotation-namespaces
Oct 17, 2026
Merged

tobiasraabe merged 3 commits into
mainfrom
codex/annotation-namespaces

Conversation

@tobiasraabe

@tobiasraabe tobiasraabe commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Annotation evaluation used different namespaces before Python 3.14, and ordinary signature inspection could evaluate lazy annotations before their saved locals were available. A task whose annotation references a deleted definition-local name could collect successfully and then fail during execution.

Use one namespace-building path across Python versions and read signatures without evaluating annotations throughout collection, parametrization, and execution. Default arguments supply missing names without overriding module globals or builtins. Regression tests cover deleted local bindings, default recovery, global/default collisions, explicit namespaces, and current module globals.

Validation:

  • 114 annotation, collection, generator, and decorator tests passed on Python 3.13 and 3.14.
  • just lint and just typing passed.

This is the first PR in a stack. Follow-up #1026 enables definition-local snapshots for future annotations and releases generated-task snapshots after collection hooks finish. Merge this PR first, then retarget #1026 to main.

@tobiasraabe tobiasraabe changed the title Unify annotation namespaces and avoid eager signature evaluation fix: evaluate task annotations consistently across Python versions Oct 17, 2026
@tobiasraabe
tobiasraabe marked this pull request as ready for review October 17, 2026 09:18
@tobiasraabe
tobiasraabe added this pull request to the merge queue Oct 17, 2026
Merged via the queue into main with commit 4b96291 Oct 17, 2026
20 checks passed
@tobiasraabe
tobiasraabe deleted the codex/annotation-namespaces branch October 17, 2026 09:30
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