Skip to content

CI verification run for the Python 3.13 fix - #2

Open
MaxFreedomPollard wants to merge 1 commit into
mainfrom
fix/python-3.13-frame-locals
Open

CI verification run for the Python 3.13 fix#2
MaxFreedomPollard wants to merge 1 commit into
mainfrom
fix/python-3.13-frame-locals

Conversation

@MaxFreedomPollard

Copy link
Copy Markdown
Owner

Runs the matrixed Python unit tests workflow (3.9 + 3.13) against the branch proposed upstream. Not for merge — exists only to produce a public CI result before submitting.

Fixes microsoft#43.

bundle() captures the calling frame's locals so that a trainable operator
can be re-executed with them. Python 3.13 changed frame.f_locals to return
a live FrameLocalsProxy rather than a dict (PEP 667), so the captured value
is no longer a dict and FunModule's isinstance check rejects it:

    AssertionError: _ldict must be a dictionary. or None

Every bundle() call fails on 3.13 as a result, which is what microsoft#43 reports.

Taking dict(...) of the proxy at the capture site restores the pre-3.13
behaviour exactly -- a plain dict snapshot of the caller's locals -- on
every supported version, and needs no change to the isinstance check.

tests/unit_tests/test_bundle.py already exercises the failing path, since
it applies @Bundle inside a function; it simply never ran on 3.13. This
adds an explicit assertion that the captured locals are a dict holding the
caller's variables, and extends the CI matrix to 3.9 and 3.13 so the
regression is covered from now on.
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