-
-
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
Investigate Python Unused Imports #3483
Comments
@teymour-aldridge could you help us with this one? |
Work is in Progress refer #3447 As soon as this will get merged, I will land another PR. |
I'd be happy to help. I'm a bit busy at the moment, but should have some time on the weekend. |
Detection is not the problem. The problem is that no one is reviewing PRs so they sit open for months at a time. Let's not add CodeClimate as it is full of uncontrollable false positives. |
Oh right. I may have jumped the gun a bit here. I'd be happy to work to try and help resolve some of these issues. |
Happy to help; need some guidance. These are the steps I would take?
|
|
Can I too work on this issue, sir? |
Please refer to #3447... That must be reviewed and landed first. |
@mekarpeles I started working on this issue, so I just want to know that is there a way to automatically remove unused imports or do I need to remove them manually. |
CAUTION: Some imports are done for side effects so linters like flake8 may say they are not needed but things will break without them. Please do just a file or two per PR. |
@cclauss I have removed unused imports till .\openlibrary\plugins\openlibrary\utils.py so should I create a PR and commit them 2 at a time? or create separate PR for each of them? |
@cclauss I would like to remove unused imports from other files as well. So should I first create a PR for unused Python standard library imports? |
I thought that #3909 was that PR. |
OK. Please creating more PRs that only remove Python standard library imports. Once those are all landed, we can look at PRs for other imports. |
@cclauss Should I go ahead and remove other unused imports (Non-standard ones) |
Sorry but not right now. These changes create issues that are quite difficult to find. Right now we are trying to upgrade to Python 3 and need to maximize stability to deal with bytes vs. str issues. |
Hey, is this issue still open?? I can take it up. |
It is still open but as mentioned above, we have a fair number of imports that have side-effects. This means that flake8 F401 might say that an import is not needed but removing it will create a crash/bug/etc. We are super-close to removing Python 2 and once that is done, we can go full force on this issue. If you want to dig in now, just modify a single file per pull request. If PRs land cleanly, that is great. If they do not land cleanly, we can add comments that describe the side effects. Thanks for your interest! |
if this issue is still open I would like to take it up |
The issue is open but we have not removed the Python 2 code so let's hold off on attacking this one a little bit longer. |
I want to be a participant in solving this issue, i am a beginner can anyone tell me from where to start and till now what is the progress for this issue? |
let's hold off on attacking this one a little bit longer. |
Hey @cclauss Is this issue still open I would like to contribute |
@cclauss, I would like to be next in line to take up this issue. |
The comments above still apply:
|
There are a lot of unused imports which clutter things.
Describe the problem that you'd like solved
Refactoring to remove all unused imports.
Proposal & Constraints
Remove all ununsed imports. This will reduce technical debt, decluttering things to make them clearer.
Additional context
UPDATE:
As per @cclauss's comments below, for detecting unused imports, we should really be running
Stakeholders
@cclauss @imskr
The text was updated successfully, but these errors were encountered: