scripts/qom-fuse: add static type hints
authorJohn Snow <jsnow@redhat.com>
Thu, 3 Jun 2021 00:37:15 +0000 (20:37 -0400)
committerJohn Snow <jsnow@redhat.com>
Fri, 18 Jun 2021 20:10:06 +0000 (16:10 -0400)
commit30ec845c599acc0616a57811316bc506a08344f2
tree46b17e394aa04134aadf2c942dcf0a8a21bcdde1
parent2cea7134620749b106af167322d921716ef61144
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>
python/setup.cfg
scripts/qmp/qom-fuse