Skip to content

Commit 6fc5cfc

Browse files
committed
Update MyPy
Now logging is correctly inspected and should not be scipped in typecheck.
1 parent e59514f commit 6fc5cfc

File tree

10 files changed

+11
-11
lines changed

10 files changed

+11
-11
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
install:
7575
- *upgrade_python_toolset
7676
- *install_deps
77-
- pip install --upgrade "mypy >= 0.670"
77+
- pip install --upgrade "mypy >= 0.700"
7878
script:
7979
- mypy --strict exec_helpers
8080
- <<: *static_analysis

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
python -m pip install --upgrade pip
7171
pip install -U setuptools
7272
pip install -r requirements.txt
73-
pip install -U mypy
73+
pip install -U "mypy>=0.700"
7474
displayName: 'Install dependencies'
7575
7676
- script: |

exec_helpers/_ssh_client_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@ def execute_async( # pylint: disable=arguments-differ
592592
"""
593593
cmd_for_log: str = self._mask_command(cmd=command, log_mask_re=log_mask_re)
594594

595-
self.logger.log( # type: ignore
595+
self.logger.log(
596596
level=logging.INFO if verbose else logging.DEBUG, msg=_log_templates.CMD_EXEC.format(cmd=cmd_for_log)
597597
)
598598

@@ -770,7 +770,7 @@ def execute_through_host(
770770
.. versionchanged:: 4.0.0 Expose stdin and log_mask_re as optional keyword-only arguments
771771
"""
772772
cmd_for_log: str = self._mask_command(cmd=command, log_mask_re=log_mask_re)
773-
self.logger.log( # type: ignore
773+
self.logger.log(
774774
level=logging.INFO if verbose else logging.DEBUG, msg=_log_templates.CMD_EXEC.format(cmd=cmd_for_log)
775775
)
776776

exec_helpers/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ def execute(
350350
**kwargs,
351351
)
352352
message = f"Command {result.cmd!r} exit code: {result.exit_code!s}"
353-
self.logger.log(level=logging.INFO if verbose else logging.DEBUG, msg=message) # type: ignore
353+
self.logger.log(level=logging.INFO if verbose else logging.DEBUG, msg=message)
354354
return result
355355

356356
def __call__(

exec_helpers/async_api/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ async def execute( # type: ignore
226226
**kwargs,
227227
)
228228
message: str = f"Command {result.cmd!r} exit code: {result.exit_code!s}"
229-
self.logger.log(level=logging.INFO if verbose else logging.DEBUG, msg=message) # type: ignore
229+
self.logger.log(level=logging.INFO if verbose else logging.DEBUG, msg=message)
230230
return result
231231

232232
async def __call__( # type: ignore

exec_helpers/async_api/exec_result.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ async def _poll_stream( # type: ignore
4343
async for line in src:
4444
dst.append(line)
4545
if log:
46-
log.log( # type: ignore
46+
log.log(
4747
level=logging.INFO if verbose else logging.DEBUG,
4848
msg=line.decode("utf-8", errors="backslashreplace").rstrip(),
4949
)

exec_helpers/async_api/subprocess_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ async def execute_async( # type: ignore
216216
"""
217217
cmd_for_log: str = self._mask_command(cmd=command, log_mask_re=log_mask_re)
218218

219-
self.logger.log( # type: ignore
219+
self.logger.log(
220220
level=logging.INFO if verbose else logging.DEBUG, msg=_log_templates.CMD_EXEC.format(cmd=cmd_for_log)
221221
)
222222

exec_helpers/exec_result.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ def _poll_stream(
282282
for line in src:
283283
dst.append(line)
284284
if log:
285-
log.log( # type: ignore
285+
log.log(
286286
level=logging.INFO if verbose else logging.DEBUG,
287287
msg=line.decode("utf-8", errors="backslashreplace").rstrip(),
288288
)

exec_helpers/subprocess_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ def execute_async( # pylint: disable=arguments-differ
243243
"""
244244
cmd_for_log: str = self._mask_command(cmd=command, log_mask_re=log_mask_re)
245245

246-
self.logger.log( # type: ignore
246+
self.logger.log(
247247
level=logging.INFO if verbose else logging.DEBUG, msg=_log_templates.CMD_EXEC.format(cmd=cmd_for_log)
248248
)
249249

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ commands = pipdeptree
9999

100100
[testenv:mypy]
101101
deps =
102-
mypy>=0.670
102+
mypy>=0.700
103103
lxml
104104
-r{toxinidir}/CI_REQUIREMENTS.txt
105105
commands = mypy --strict --xslt-html-report mypy_report -p exec_helpers

0 commit comments

Comments
 (0)