[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 14/16] iotests/linters: Add workaround for mypy bug #9852
From: |
John Snow |
Subject: |
[PATCH v3 14/16] iotests/linters: Add workaround for mypy bug #9852 |
Date: |
Thu, 16 Sep 2021 00:09:53 -0400 |
This one is insidious: if you use the invocation
"from {namespace} import {subpackage}" as mirror-top-perms does,
mypy will fail on every-other invocation *if* the package being
imported is a package.
Now, I could just edit mirror-top-perms to avoid this invocation, but
since I tripped on a landmine, I might as well head it off at the pass
and make sure nobody else trips on the same landmine.
It seems to have something to do with the order in which files are
checked as well, meaning the random order in which set(os.listdir())
produces the list of files to test will cause problems intermittently.
mypy >= 0.920 isn't released yet, so add this workaround for now.
See also:
https://github.com/python/mypy/issues/11010
https://github.com/python/mypy/issues/9852
Signed-off-by: John Snow <jsnow@redhat.com>
---
tests/qemu-iotests/linters.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tests/qemu-iotests/linters.py b/tests/qemu-iotests/linters.py
index 4df062a973..9c97324e87 100755
--- a/tests/qemu-iotests/linters.py
+++ b/tests/qemu-iotests/linters.py
@@ -100,6 +100,9 @@ def run_linters(
'--warn-unused-ignores',
'--no-implicit-reexport',
'--namespace-packages',
+ # Until we can use mypy >= 0.920, see
+ # https://github.com/python/mypy/issues/9852
+ '--no-incremental',
filename,
),
cwd=directory,
--
2.31.1
- Re: [PATCH v3 09/16] iotests/297: Separate environment setup from test execution, (continued)
- [PATCH v3 10/16] iotests/297: Add 'directory' argument to run_linters, John Snow, 2021/09/16
- [PATCH v3 11/16] iotests/297: return error code from run_linters(), John Snow, 2021/09/16
- [PATCH v3 13/16] iotests/linters: Add entry point for Python CI linters, John Snow, 2021/09/16
- [PATCH v3 15/16] python: Add iotest linters to test suite, John Snow, 2021/09/16
- [PATCH v3 12/16] iotests/297: split linters.py off from 297, John Snow, 2021/09/16
- [PATCH v3 14/16] iotests/linters: Add workaround for mypy bug #9852,
John Snow <=
- [PATCH v3 16/16] iotests/linters: check mypy files all at once, John Snow, 2021/09/16
- Re: [PATCH v3 00/16] python/iotests: Run iotest linters during Python CI, John Snow, 2021/09/17