Fix ci: pin linux, pin flake8, ignore type error, fix mypy#308
Fix ci: pin linux, pin flake8, ignore type error, fix mypy#308julianlocke merged 4 commits intomainfrom
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
devPalacio
left a comment
There was a problem hiding this comment.
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. |
johnlarkin1
left a comment
There was a problem hiding this comment.
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 |
| 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 |
|
|
||
| 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.
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.
Yeah, I'll run this one day: https://github.com/ilevkivskyi/com2ann
There was a problem hiding this comment.
Then we'll be able to unpin flake8
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?