Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix numba tests with Python 3.13+ #17972

Merged
merged 2 commits into from
Mar 12, 2025

Conversation

vepadulano
Copy link
Member

See commits descriptions

Nowadays the ROOTTEST_IGNORE* cmake variables are not necessary anymore.
Instead, a proper use of the PYTHON_DEPS argument to the various ADD_TEST
functions will ensure that the Python dependency is present in the system at
configuration time, and disable the test if it is not found.
Python 3.13 changes the semantics of the builtin `locals()` function, see
https://docs.python.org/3/library/functions.html#locals.

For our case, it means that the call to `locals()` that happens at
function-scope in the Numba decorator will not modify the `locals()` dictionary,
thus the JITted pywrapper function will not appear in the dictionary. Ensure
this happens by binding `locals()` to a local variable, which is actually
modified by `exec()`.
Copy link
Contributor

@guitargeek guitargeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for the quick fix! Great work

@vepadulano vepadulano merged commit 65cca12 into root-project:master Mar 12, 2025
14 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants