CI verification run for the Python 3.13 fix - #2
Open
MaxFreedomPollard wants to merge 1 commit into
Open
Conversation
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.
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.
Runs the matrixed
Python unit testsworkflow (3.9 + 3.13) against the branch proposed upstream. Not for merge — exists only to produce a public CI result before submitting.