Upgrade Python syntax with pyupgrade#10405
Conversation
…t-format argument)
|
PR introduces Flake8 errors 😲 See test results for Failed build of commit 637bf8c88f |
|
I was just thinking that in my experience automated changes can easily
introduce extra unwanted behaviour since the tool probably is pretty dumb
and just altering things to the expected syntax one part at a time without
tracing the routine concerned etc.
Brian
bglists@blueyonder.co.uk
Sent via blueyonder.
Please address personal E-mail to:-
briang1@blueyonder.co.uk, putting 'Brian Gaff'
in the display name field.
Newsgroup monitored: alt.comp.blind-users
|
|
While I like the changes this tool proposes, I agree with @josephsl that in the current stage of development, it might be better not to apply them now. I also think that we're still required to check them all by hand, just to make sure. Not to mention the huge amount of flake8 warnings. |
|
I understand your concerns. But, in my opinion, we must dare these changes.
Of course! It is necessary to review all changes. Although there are many flake8 warnings, this is easily corrected. It's just time consuming. I'm willing to do that. |
aa5d589 to
f456cd4
Compare
|
PR introduces Flake8 errors 😲 See test results for Failed build of commit fd84da6c58 |
|
I"m tempted to close this as per several reasons:
|
Totally right. However, it's not a problem. The PR is in Draft status. I can wait several weeks, rebase my branch onto master and reapply the process without difficulty.
It's also not a problem. My 2nd commit (f456cd4) fixes this. To solves this, xgettext should be called using Currently the Flake8 warnings are the only problem for me. But as already said, that's easily corrected. For info, the try build is here. No problem found until now with my tests. |
hi Andre |
|
@dingpengyu I've just run the By the way, the PyUpgrade documentation says:
Apparently it's the only difference with |
hi Andre |
|
My personal opinion is that performing these changes all at once makes no sense. This creates very big diff which someone has to review and it is not good use of anyone's time given the fact that there are no immediate benefits. |
|
@Andre9642 Could you please file a separate pr with the fix fro mhttps://github.com/nvaccess/nvda/commit/f456cd4afa5c65b909c3405daedae91817c3771b regarding encoding at the top of the file? I stil ltend to agree with @lukaszgo1 in #10405 (comment) . I'm closing this pull request for now. Please open a separate issue to discuss the best approach for syntax upgrades. |
Link to issue number:
None
Summary of the issue:
pyupgrade is a tool to automatically upgrade syntax for newer versions of the language. Various improvements are suggested on NVDA's source code.
Description of how this pull request fixes the issue:
Moved to 'source' folder then executed
pyupgrade --py36-plus --keep-percent-formaton*.pyfiles (recursively). Due to translatable strings,--keep-percent-formatargument is required. See #10384.Testing performed:
Tested that NVDA starts properly with these changes (from sources and a non-archived binary build).
Known issues with pull request:
None
Change log entry:
None