-
-
Notifications
You must be signed in to change notification settings - Fork 419
PICARD-2356: Removed deprecated code #2080
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
Conversation
Thanks. Looks good to me. This will be for Picard 3. We should open a branch for this. I'd like to do this after we have released Picard 2.8 |
@skelly37 CI complains about a now unused import of |
@phw Thanks for feedback, the import is already removed. |
The reason that |
Thanks for the advice and decent code. I think that we could benefit from packing What do you think? |
Well, the |
I would like to keep running the tests and linting separate. But I guess I would be ok if we would have something like Apart from that I would recommend setting up a git pre-commit hook in your local git checkout. There is an example pre-commit hook that runs flake8 and isort on the changed files, see https://github.com/metabrainz/picard/blob/master/CONTRIBUTING.md#coding-style Currently there is still at least one unused import left, see https://github.com/metabrainz/picard/runs/5549909993?check_suite_focus=true |
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.
Please fix the remaining unused imports.Apart from that I think it would also be good if you could squash all commits into one for this small change, but we can also do this when merging.
I went through all the modified files and searched with pycharm in all the files. Only Moving |
I've fixed my isort version, no problems this time. The previous commit was deleted, if this time it won't work: I'm clueless. Okay, the tests finally went smoothly. This string_ in setup.cfg was the problematic one, I see. |
Okay, all the most important changes work. One final question then. In picard/util/thread.py there's a function called My question is: Should I left it intact? Or the backward compatibility there won't be needed? Solving that case would be the final of this PR imo. |
Good catch. Yes, that could be removed as well. We just keep it for compatibility with older plugins, but since plugins will need an update anyway we can actually change that for Picard 3. That simplifies the code another bit. |
Okay, deprecated parameter got removed. Also, nobody disagreed with my opinion on picard.metadata.delete(), so I deleted the comment. It's still used in code (and useful imo), not just left with declaration and tests. As long as there won't be more findings before 3.0, we're free from deprecated code! (time will come for the two modules as well) |
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.
From my side this is good to merge now, thanks a lot.
@zas Are you ok with keeping the Metadata.delete
method and remove the deprecation notice there?
Yes. |
Merged now. We had the 2.8.2 release yesterday and finally should get started as planned to move forward next larger release. |
Summary
I've removed code marked in comment as deprecated. 1 commit — 1 function, so everything is clear IMO
Problem
Deprecated code is unnecessarily tested and makes the source code files bloated
Solution
Find all the usages of deprecated code, replace it with the new one and safely delete it.
Action
picard.metadata.delete()
is also marked as deprecated but are you sure that executingdel self[self.normalize_tag(name)]
can be enforced safely without such convenient wrapper method? I'm not sure if this is a change for good so I left without replacingdelete
withdel