-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Properly lazily import shutil #3023
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
base: stable
Are you sure you want to change the base?
Conversation
This reverts commit 8bc9127.
Okay, that's everything! |
Can you target this at stable instead? |
There's a test that checks what modules are imported, you can probably remove shutil from that list as well. |
I changed to stable and updated that test! If it's fine with you, I'm interested in the coming weeks/months making sure that everything (within reason) is lazily imported. |
Definitely, it's a bit annoying to code, but I think the speed is worth it for the CLI. We want to distinguish between what's going to be imported no matter what (general Python startup / used everywhere anyway) versus what only comes up in certain use cases. That's what that import test is for, so we know if something gets imported unintentionally, and can review imports from time to time. |
I agree with the intention to lazily import but it wasn't actually happening. Locally I get the following on Python 3.12: