From 84e327e8448eacef879a0f85d38d212b6f58ee4a Mon Sep 17 00:00:00 2001 From: John Snow Date: Wed, 26 Jun 2024 19:22:27 -0400 Subject: python: linter changes for pylint 3.x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New bleeding edge versions, new nits to iron out. This addresses the 'check-python-tox' optional GitLab test, while 'check-python-minreqs' saw no regressions, since it's frozen on an older version of pylint. Fixes: qemu/machine/machine.py:345:52: E0606: Possibly using variable 'sock' before assignment (possibly-used-before-assignment) qemu/utils/qemu_ga_client.py:168:4: R1711: Useless return at end of function or method (useless-return) Signed-off-by: John Snow Reviewed-by: Alex Bennée Message-id: 20240626232230.408004-2-jsnow@redhat.com Signed-off-by: John Snow --- python/qemu/machine/machine.py | 1 + python/qemu/utils/qemu_ga_client.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'python') diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py index f648f6af45..ebb58d5b68 100644 --- a/python/qemu/machine/machine.py +++ b/python/qemu/machine/machine.py @@ -335,6 +335,7 @@ class QEMUMachine: def _pre_launch(self) -> None: if self._qmp_set: + sock = None if self._monitor_address is None: self._sock_pair = socket.socketpair() os.set_inheritable(self._sock_pair[0].fileno(), True) diff --git a/python/qemu/utils/qemu_ga_client.py b/python/qemu/utils/qemu_ga_client.py index 9a665e6e99..cf0fcf9a8b 100644 --- a/python/qemu/utils/qemu_ga_client.py +++ b/python/qemu/utils/qemu_ga_client.py @@ -174,7 +174,7 @@ class QemuGuestAgentClient: # On error exception will raise except asyncio.TimeoutError: # On success command will timed out - return + pass def shutdown(self, mode: str = 'powerdown') -> None: if mode not in ['powerdown', 'halt', 'reboot']: -- cgit 1.4.1 From c5be244534f918adf5aea0ced9cf13344be3e62b Mon Sep 17 00:00:00 2001 From: John Snow Date: Wed, 26 Jun 2024 19:22:28 -0400 Subject: python: Do not use pylint 3.2.4 with python 3.8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is a bug in this version, see: https://github.com/pylint-dev/pylint/issues/9751 Signed-off-by: John Snow Reviewed-by: Alex Bennée Message-id: 20240626232230.408004-3-jsnow@redhat.com Signed-off-by: John Snow --- python/setup.cfg | 1 + 1 file changed, 1 insertion(+) (limited to 'python') diff --git a/python/setup.cfg b/python/setup.cfg index 48668609d3..8ebd345d7e 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -41,6 +41,7 @@ devel = isort >= 5.1.2 mypy >= 1.4.0 pylint >= 2.17.3 + pylint != 3.2.4; python_version<"3.9" tox >= 3.18.0 urwid >= 2.1.2 urwid-readline >= 0.13 -- cgit 1.4.1 From 45b14be9b63ac3df9f2b31c249fc4520837c00b9 Mon Sep 17 00:00:00 2001 From: John Snow Date: Wed, 26 Jun 2024 19:22:30 -0400 Subject: python: enable testing for 3.13 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Python 3.13 is in beta and Fedora 41 is preparing to make it the default system interpreter; enable testing for it. (In the event problems develop prior to release, it should only impact the check-python-tox job, which is not run by default and is allowed to fail.) Signed-off-by: John Snow Reviewed-by: Alex Bennée Tested-by: Alex Bennée Message-id: 20240626232230.408004-5-jsnow@redhat.com Signed-off-by: John Snow --- python/setup.cfg | 3 ++- tests/docker/dockerfiles/python.docker | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'python') diff --git a/python/setup.cfg b/python/setup.cfg index 8ebd345d7e..3b4e2cc550 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -19,6 +19,7 @@ classifiers = Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 Programming Language :: Python :: 3.12 + Programming Language :: Python :: 3.13 Typing :: Typed [options] @@ -184,7 +185,7 @@ multi_line_output=3 # of python available on your system to run this test. [tox:tox] -envlist = py38, py39, py310, py311, py312 +envlist = py38, py39, py310, py311, py312, py313 skip_missing_interpreters = true [testenv] diff --git a/tests/docker/dockerfiles/python.docker b/tests/docker/dockerfiles/python.docker index a3c1321190..8f0af9ef25 100644 --- a/tests/docker/dockerfiles/python.docker +++ b/tests/docker/dockerfiles/python.docker @@ -14,6 +14,7 @@ ENV PACKAGES \ python3.10 \ python3.11 \ python3.12 \ + python3.13 \ python3.8 \ python3.9 -- cgit 1.4.1