-
Notifications
You must be signed in to change notification settings - Fork 94
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
Fix flake8 E231 #6534
Fix flake8 E231 #6534
Conversation
.github/workflows/test_fast.yml
Outdated
@@ -130,7 +128,8 @@ jobs: | |||
run: etc/bin/shellchecker | |||
|
|||
- name: MyPy | |||
run: mypy | |||
# specify --python-version to avoid errors regarding site-packages | |||
run: mypy --python-version 3.8 |
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.
3.7?
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.
$ mypy --python-version=3.7
[...]/python3.12/site-packages/matplotlib/pyplot.py:246: error: Assignment expressions are only supported in Python 3.8 and greater [syntax]
Found 1 error in 1 file (errors prevented further checking)
We could split off mypy into its own job on python 3.7. But seeing as we run tests on python 3.7 they should already catch any 3.7-incompatible annotations
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.
Assignment expressions are only supported in Python 3.8 and greater
I think mypy has reported a legit error here that the tests failed to spot! Thankfully this issue only applies to the developer main loop plugins so is of little consequence. Would introducing an upper pin on matplotlib clear the error?
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.
This version of matplotlib would not install on Python 3.7 so there's no legit error here. It's just that Mypy can't work in Python 3.7 mode when it comes across 3.7-incompatible code in 3rd-party libraries: python/mypy#9972
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.
See also #5736
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.
Wait I just realised that since we moved to linting in its own job on GH Actions, we're not installing matplotlib during that job so this error is not raised anymore!
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.
Ach dammit, we should probably install the all
group, one for another day...
(re-running the failed test) |
For some reason, Flake8 was not detecting some problems on python 3.9.
Check List
CONTRIBUTING.md
and added my name as a Code Contributor.?.?.x
branch.