[jira] [Commented] (PROTON-2322) Fix and remove ignores in flake8 configuration

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (PROTON-2322) Fix and remove ignores in flake8 configuration

ASF subversion and git services (Jira)

    [ https://issues.apache.org/jira/browse/PROTON-2322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17266146#comment-17266146 ]

ASF GitHub Bot commented on PROTON-2322:
----------------------------------------

jiridanek commented on a change in pull request #289:
URL: https://github.com/apache/qpid-proton/pull/289#discussion_r558399078



##########
File path: python/proton/_delivery.py
##########
@@ -34,7 +34,7 @@
 
 
 class NamedInt(int):
-    values = {}  # type: Dict[int, str]

Review comment:
       Whether flake8 runs under pyhotn2 or python3 probably plays a role here. In Python 3 code, you are supposed to have that `from typing import Dict`; if you forget, it's an error that flake8 can help you with.
   
   The flake8 error this produced is
   
   ```
   30: ./proton/_delivery.py:37:18: F821 undefined name 'Dict'
   ```
   
   so exactly same result as if you used that name in your code. I don't see a way to tell flake8 not to behave like this, except with the # noqa comment. There is only a single type annotation like this. I strongly believe that what's in the PR is adequate until Proton moves to 3.6. Then we can simply do `from typing import` and we'll do type annotations the 3.x way.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[hidden email]


> Fix and remove ignores in flake8 configuration
> ----------------------------------------------
>
>                 Key: PROTON-2322
>                 URL: https://issues.apache.org/jira/browse/PROTON-2322
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: python-binding
>    Affects Versions: proton-c-0.34.0
>            Reporter: Jiri DanÄ›k
>            Priority: Major
>
> Fixes with autopep8 in PROTON-2320 resolved most of flake8 warnings. There are still warnings left that require human consideration and fixing.
> For example, usage of bare {{except}} in the code.
> This must be fixed manually. Fixed issues should then be removed from the tox.ini flake8 ignore section.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]