Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Commit

Permalink
Merge pull request #120 from gluetool/update-mypy
Browse files Browse the repository at this point in the history
typing: update to latest mypy
  • Loading branch information
thrix committed Jun 28, 2021
2 parents f5d4bab + 703e406 commit 568d111
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion gluetool/glue.py
Expand Up @@ -947,7 +947,8 @@ def _for_each_option(callback, options):

# Sort options by their names - no code has a strong option on their order, so force
# one to all users of this helper.
option_names = sorted(iterkeys(options), key=lambda x: x[1] if isinstance(x, tuple) else x)
# Mypy is not happy about lambda function: https://github.com/python/mypy/issues/9656#issuecomment-718284938
option_names = sorted(iterkeys(options), key=lambda x: x[1] if isinstance(x, tuple) else x) # type: ignore

for names in option_names:
params = options[names]
Expand Down
4 changes: 3 additions & 1 deletion gluetool/log.py
Expand Up @@ -897,9 +897,11 @@ def format(self, record):
#
# Regular sort would yield contexts by their priorities from lower to higher ones, therefore reversed flag.
# That way we'd start inserting higher priority contexts sooner than lower priority ones.

# Mypy is not happy about lambda function: https://github.com/python/mypy/issues/9656#issuecomment-718284938
sorted_contexts = sorted(
iterkeys(contexts),
key=lambda ctx_name: contexts[ctx_name][0],
key=lambda ctx_name: contexts[ctx_name][0], # type: ignore
reverse=True
)

Expand Down
2 changes: 1 addition & 1 deletion gluetool/utils.py
Expand Up @@ -489,7 +489,7 @@ def __init__(self, executable, options=None, logger=None):

self._command = None # type: Optional[List[str]]
self._popen_kwargs = None # type: Optional[Dict[str, Any]]
self._process = None # type: Optional[subprocess.Popen]
self._process = None # type: Optional[subprocess.Popen[str]]
self._exit_code = None # type: Optional[int]

self._stdout = None # type: Optional[str]
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Expand Up @@ -52,8 +52,8 @@ envdir = {toxinidir}/.tox/type-check
basepython = python3.6
skip_install = True
deps =
mypy==0.720
mypy-extensions==0.4.1
mypy==0.812
mypy-extensions==0.4.3
setenv =
MYPATH = {toxinidir}

Expand Down

0 comments on commit 568d111

Please sign in to comment.