diff options
author | John Snow <jsnow@redhat.com> | 2021-06-02 20:37:15 -0400 |
---|---|---|
committer | John Snow <jsnow@redhat.com> | 2021-06-18 16:10:06 -0400 |
commit | 30ec845c599acc0616a57811316bc506a08344f2 (patch) | |
tree | 46b17e394aa04134aadf2c942dcf0a8a21bcdde1 /python/setup.cfg | |
parent | 2cea7134620749b106af167322d921716ef61144 (diff) |
scripts/qom-fuse: add static type hints
Because fusepy does not have type hints, add some targeted warning
suppressions.
Namely, we need to allow subclassing something of an unknown type (in
qom_fuse.py), and we need to allow missing imports (recorded against
fuse itself) because mypy will be unable to import fusepy (even when
installed) as it has no types nor type stubs available.
Note: Until now, it was possible to run invocations like 'mypy qemu/'
from ./python and have that work. However, these targeted suppressions
require that you run 'mypy -p qemu/' instead. The correct, canonical
invocation is recorded in ./python/tests/mypy.sh and all of the various
CI invocations always use this correct form.
Signed-off-by: John Snow <jsnow@redhat.com>
Message-id: 20210603003719.1321369-16-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
Diffstat (limited to 'python/setup.cfg')
-rw-r--r-- | python/setup.cfg | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/python/setup.cfg b/python/setup.cfg index c9b9445af9..ba8d29fd62 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -57,6 +57,14 @@ python_version = 3.6 warn_unused_configs = True namespace_packages = True +[mypy-qemu.qmp.qom_fuse] +# fusepy has no type stubs: +allow_subclassing_any = True + +[mypy-fuse] +# fusepy has no type stubs: +ignore_missing_imports = True + [pylint.messages control] # Disable the message, report, category or checker with the given id(s). You # can either give multiple identifiers separated by comma (,) or put this |