8000 python: add mypy to pipenv · qemu/qemu@0542a4c · GitHub
[go: up one dir, main page]

Skip to content

Commit 0542a4c

Browse files
committed
python: add mypy to pipenv
0.730 appears to be about the oldest version that works with the features we want, including nice human readable output (to make sure iotest 297 passes), and type-parameterized Popen generics. 0.770, however, supports adding 'strict' to the config file, so require at least 0.770. Now that we are checking a namespace package, we need to tell mypy to allow PEP420 namespaces, so modify the mypy config as part of the move. mypy can now be run from the python root by typing 'mypy -p qemu'. A note on mypy invocation: Running it as "mypy qemu/" changes the import path detection mechanisms in mypy slightly, and it will fail. See python/mypy#8584 for a decent entry point with more breadcrumbs on the various behaviors that contribute to this subtle difference. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> Tested-by: Cleber Rosa <crosa@redhat.com> Message-id: 20210527211715.394144-23-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
1 parent e941c84 commit 0542a4c

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

python/Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ verify_ssl = true
55

66
[dev-packages]
77
flake8 = ">=3.6.0"
8+
mypy = ">=0.770"
89
pylint = ">=2.8.0"
910

1011
[packages]

python/Pipfile.lock

Lines changed: 36 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

python/setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ exclude = __pycache__,
3131
strict = True
3232
python_version = 3.6
3333
warn_unused_configs = True
34+
namespace_packages = True
3435

3536
[pylint.messages control]
3637
# Disable the message, report, category or checker with the given id(s). You
< 31B7 /td>

0 commit comments

Comments
 (0)
0