qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 15/24] python: add mypy to pipenv


From: John Snow
Subject: Re: [PATCH v4 15/24] python: add mypy to pipenv
Date: Wed, 17 Feb 2021 11:40:10 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0

On 2/16/21 11:38 PM, Cleber Rosa wrote:
On Thu, Feb 11, 2021 at 01:58:47PM -0500, John Snow wrote:
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 qemu'.


  $ mypy qemu
  qemu/utils/accel.py: error: Source file found twice under different module 
names: 'qmp' and 'qemu.qmp'
  Found 1 error in 1 file (errors prevented further checking)

I guess you meant 'mypy -p qemu'.


Ah, crud! Yes, this is something that has popped up recently.

mypy's "figure out where we are when run without arguments" functionality does not work exactly correct in some cases.

I forget the specifics, but "mypy qemu" used to work for this series, and at some point it ... stopped working. I updated the pytest invocation, but I didn't update the comments here.

There's a github meta-issue about this, and about how mypy's package discovery is extremely confusing:

https://github.com/python/mypy/issues/8584

It's extremely a big landmine on which you may hoist yourself.

Signed-off-by: John Snow <jsnow@redhat.com>
---
  python/Pipfile      |  1 +
  python/Pipfile.lock | 37 ++++++++++++++++++++++++++++++++++++-
  python/setup.cfg    |  1 +
  3 files changed, 38 insertions(+), 1 deletion(-)


With that change,

Reviewed-by: Cleber Rosa <crosa@redhat.com>
Tested-by: Cleber Rosa <crosa@redhat.com>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]