[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/9] python: update for mypy 0.950
From: |
John Snow |
Subject: |
[PATCH 1/9] python: update for mypy 0.950 |
Date: |
Wed, 25 May 2022 20:09:13 -0400 |
typeshed (included in mypy) recently updated to improve the typing for
WriteTransport objects. I was working around this, but now there's a
version where I shouldn't work around it.
Unfortunately this creates some minor ugliness if I want to support both
pre- and post-0.950 versions. For now, for my sanity, just disable the
unused-ignores warning.
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
---
python/qemu/qmp/util.py | 4 +++-
python/setup.cfg | 1 +
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/python/qemu/qmp/util.py b/python/qemu/qmp/util.py
index eaa5fc7d5f9..ca6225e9cda 100644
--- a/python/qemu/qmp/util.py
+++ b/python/qemu/qmp/util.py
@@ -40,7 +40,9 @@ async def flush(writer: asyncio.StreamWriter) -> None:
drain. The flow control limits are restored after the call is
completed.
"""
- transport = cast(asyncio.WriteTransport, writer.transport)
+ transport = cast( # type: ignore[redundant-cast]
+ asyncio.WriteTransport, writer.transport
+ )
# https://github.com/python/typeshed/issues/5779
low, high = transport.get_write_buffer_limits() # type: ignore
diff --git a/python/setup.cfg b/python/setup.cfg
index e877ea56475..c2c61c75190 100644
--- a/python/setup.cfg
+++ b/python/setup.cfg
@@ -79,6 +79,7 @@ strict = True
python_version = 3.6
warn_unused_configs = True
namespace_packages = True
+warn_unused_ignores = False
[mypy-qemu.utils.qom_fuse]
# fusepy has no type stubs:
--
2.34.1
- [PATCH 0/9] tests, python: prepare to expand usage of test venv, John Snow, 2022/05/25
- [PATCH 1/9] python: update for mypy 0.950,
John Snow <=
- [PATCH 2/9] tests: add "TESTS_PYTHON" variable to Makefile, John Snow, 2022/05/25
- [PATCH 3/9] tests: use python3 as the python executable name, John Snow, 2022/05/25
- [PATCH 4/9] tests: silence pip upgrade warnings during venv creation, John Snow, 2022/05/25
- [PATCH 5/9] tests: add quiet-venv-pip macro, John Snow, 2022/05/25
- Re: [PATCH 5/9] tests: add quiet-venv-pip macro, Paolo Bonzini, 2022/05/26