From 30ec845c599acc0616a57811316bc506a08344f2 Mon Sep 17 00:00:00 2001 From: John Snow Date: Wed, 2 Jun 2021 20:37:15 -0400 Subject: 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 Message-id: 20210603003719.1321369-16-jsnow@redhat.com Signed-off-by: John Snow --- python/setup.cfg | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'python') diff --git a/python/setup.cfg b/python/setup.cfg index c9b9445..ba8d29f 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 -- cgit v1.1