-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[PyROOT] Drop support for from ROOT import *
#14588
Conversation
Wild card imports like `from ROOT import *` stopped working with Python 3.11 given some changes in the CPython API. For that reason, upstream `cppyy` also dropped support for lazy lookups, which was the feature that enabled wildcard imports: wlav/CPyCppyy@64fd890#diff-6160c0eb004dabeedaeb58d804a7ecd3e563d9379e9e7af39623fd38d0bc6a37R352 This commit suggests to document `from ROOT import *` officially as unsupported and remove the corresponding code path in the ROOT facade. Closes root-project#7669.
Starting build on |
We should probably be extra explicit and provide an empty |
This is already done in in the ROOT facade constructor. Indeed, one can move it directly to
That would be nice! Do you know how to do this? Google didn't give an easy solution :(
I don't think we have it, or do we? I only see it in this test suite where it is deactivated for Python 3: |
Indeed, I remembered we had more, maybe we already got rid of some instances, there is also this file which points at this jira issue related to the argument, so we can also close that one once this is merged 👍
Explicit is better than implicit, having the attribute means we can also comment on it for readers |
Starting build on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice thanks! A couple of comments for consideration
a107e37
to
458a1eb
Compare
Starting build on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Test Results 10 files 10 suites 1d 19h 44m 29s ⏱️ Results for commit 458a1eb. |
With this commit, the user will get an `ImportError` when trying to do `from ROOT import *` or for example `from ROOT.RooFit import *`. Before this commit, such commands were succeeding but without actually importing anything, which might me confusing to the user because the expect that everything from ROOT gets imported.
458a1eb
to
f612fda
Compare
Starting build on |
Just rebased to fix a typo in the commit message |
Build failed on ROOT-ubuntu2204/nortcxxmod. Errors:
|
Build failed on ROOT-performance-centos8-multicore/soversion. Errors:
|
Build failed on ROOT-ubuntu2004/python3. Errors:
|
Build failed on mac12arm/cxx20. Errors:
|
Wild card imports like
from ROOT import *
stopped working with Python 3.11 given some changes in the CPython API.For that reason, upstream
cppyy
also dropped support for lazy lookups, which was the feature that enabled wildcard imports: wlav/CPyCppyy@64fd890#diff-6160c0eb004dabeedaeb58d804a7ecd3e563d9379e9e7af39623fd38d0bc6a37R352This commit suggests to document
from ROOT import *
officially as unsupported and remove the corresponding code path in the ROOT facade.Closes #7669.