-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
remove unused imports #2624
remove unused imports #2624
Conversation
Looks like it may have removed too much 😅
|
haha ah! That's what I get for not running the tests one more time before pushing. I just fixed that in f5b5b7a. Ran the tests locally and all but two passed. From the errors at first glance it seemed unrelated to these changes, and I'm hoping it's just one of those "my laptop looks different from the CI environment" things. Let's see if I'm right 🤞 |
I was not haha. Ok sorry, you can ignore this PR until I get CI working. Clearly there are some differences between the way I was running the tests locally and the way they're run in CI. |
We do run an unused import check circle job so I'll be surprised if you find anything new |
This is only run on the |
that makes sense! The only unused imports I picked up with |
Ok this is passing CI and ready for a review! Thanks for your time. |
Thanks @jameslamb! |
Thanks for contributing to Prefect!
changes/
directory (if appropriate)docs/outline.toml
for API reference docs (if appropriate)What does this PR change?
Thanks for this great project! I've been getting familiar with
prefect
and really liking it, so I wanted to contribute back. Similar to #2567 , this PR proposes fixing another class of problem I saw runningflake8
on this repo: unused imports.The "unused imports" detection in
flake8
can lead to a lot of false positives, for example in__init__.py
files, so I tried to limit the changes I made here to things I'm fairly confident can be removed. You can generate the list of things I changed with this command:Most of those ignored things are from these common false positive cases:
__init__.py
filesI also avoided
sqlalchemy
andalembic
just because I don't understand the full magic ofsqlalchemy
and didn't know if some of the thingsflake8
turned about were actually unused.Why is this PR important?
Imports add to the time it takes to load modules.
Unused imports can also make it seem like some dependencies are more widely used in the project than they really are, which can prevent maintainers from noticing limited-use dependencies and trying to factor them out.
To be clear...this PR removes imports, but it doesn't change the dependencies for
prefect
at all. All of the things I'm proposing removing come from libraries that are imported elsewhere in the project.Thanks for your time and consideration!