-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Revert lazy loading (importing) packages #13124
base: main
Are you sure you want to change the base?
Conversation
This reverts commit 81b7ddf.
This reverts commit dea8f87.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
@drammock I'm not sure how to remove a core dependency, since the hook generates the list from the latest stable release. Other than that, I tried to minimize the changes to main. We could think about not nesting the SciPy imports, since this only takes around 50ms or so, and it would make the code a bit easier to read. I don't know how to handle |
For the hook I think it's easiest probably just to add an exception to the hook code for now. We've hit that problem before and I think that's how we worked around it. For
I guess I'd vote for (1). It's a bit weird if we do it just for one submodule, but I guess it's justified because it's the only one that requires an optional dependency for its class hierarchy. Beyond that I'm not sure how we'd get classes in |
Thanks, I'll try that. Regarding |
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.
While I appreciate your initiative in taking this on @cbrnr, I would have preferred a bit longer discussion period before embarking on a change as large as this one. Notably, nobody has yet offered the arguments in favor of keeping lazy_loader
, so although there are 3 other maintainers (so far) concurring with your preference to remove it, I don't really think the discussion has had a chance to reach consensus.
In addition, according to our governance, it is the reponsibility of both the maintainer team and the steering council to work in partnership on any "large-scale changes to the software", which includes changes that affect multiple submodules. So to give the steering council time to discuss this, I'm marking this with "request changes" to block merging until that discussion has occurred. Next steering council meeting is 07 March.
That's why this PR is a draft, I thought it would be a good idea to give people an idea of the required changes. (And just as a side note, I don't remember any longer discussion when lazy loading was introduced. Don't get me wrong, I'm not opposed to a longer discussion at all, just noting that such decisions seem to be a bit arbitrary, at least in my perception.) |
@larsoner I'm not sure what to do here. I looked at the history of that hook (and the pre-commit config file), but I didn't find anything related to ignoring a change in dependencies. |
BTW, |
If anyone wants to try the current state of this PR, |
for more information, see https://pre-commit.ci
I think I nested all |
@larsoner I would just put it into a I know that there is no consensus on this change at all, but I don't understand the
But removing those imports breaks stuff. |
The test probably needs to be adjusted for this case. It's meant to catch importing classes and functions (which we always want to make explicit like |
Fixes #13121.