-
Notifications
You must be signed in to change notification settings - Fork 79
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 ci: pin linux, pin flake8, ignore type error, fix mypy #308
Conversation
Codecov Report
@@ Coverage Diff @@
## main #308 +/- ##
=======================================
Coverage 52.02% 52.02%
=======================================
Files 37 37
Lines 8462 8451 -11
Branches 1810 1810
=======================================
- Hits 4402 4397 -5
+ Misses 3743 3737 -6
Partials 317 317
Flags with carried forward coverage won't be shown. Click here to find out more.
|
c21d73e
to
7b49e85
Compare
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.
It's beautiful, good riddance python2
Maybe we should update the readme to reflect that Python 3 is required? Is that just a given since we're 3 years past EOL? |
I like this idea. I think it's probably about time. |
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.
Nice! Thanks for doing this.
# Hack to get around some of Python 2's standard library modules that | ||
# accept ascii-encodable unicode literals in lieu of strs, but where | ||
# actually passing such literals results in errors with mypy --py2. See | ||
# <https://github.com/python/typeshed/issues/756> and | ||
# <https://github.com/python/mypy/issues/2536>. | ||
import importlib | ||
argparse = importlib.import_module(str('argparse')) # type: typing.Any |
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.
😍 love to see this.
@@ -9,19 +9,13 @@ | |||
try: | |||
from inspect import getfullargspec as get_args | |||
except ImportError: | |||
from inspect import getargspec as get_args | |||
from inspect import getargspec as get_args # type: ignore |
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.
Thanks
@@ -27,7 +27,7 @@ | |||
from test.backend_test_util import _mock_output | |||
|
|||
|
|||
def _make_backend(target_folder_path, template_path, custom_args=None): | |||
def _make_backend(target_folder_path, template_path, custom_args=None): # type: ignore | |||
# type: (typing.Text, typing.Text, typing.List) -> TSDTypesBackend |
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.
Not for the sake of this PR, but we should be able to update these to modern type hint syntax right?
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.
Yeah, I'll run this one day: https://github.com/ilevkivskyi/com2ann
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.
Then we'll be able to unpin flake8
* Fix ci: pin linux, pin flake8, ignore type error, fix mypy (#308) * Replace uses of deprecated imp with importlib (#307) * Update cli.py to work with java sdk (#310) --------- Co-authored-by: Jay <[email protected]>
Removes python 2 support.
Ignores a flake8 type error caused by a conditional import of two (similar for our purposes) types.
Pins flake8 to a version <6 as versions past that no longer parse type annotations. Without the type annotations, we encounter "imported but unused" errors.
Removes now-unrecognized show_none_errors mypy setting. Apparently strict_optional enforces this anyway.
Pins linux to ubuntu-20.04, as versions past that no longer ship with python 3.6.
Checklist
General Contributing
Is This a Code Change?
Validation
tox
?