From nobody Tue May 7 05:47:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1641842776611205.26868460816877; Mon, 10 Jan 2022 11:26:16 -0800 (PST) Received: from localhost ([::1]:56546 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n70J5-00062E-L2 for importer@patchew.org; Mon, 10 Jan 2022 14:26:15 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44092) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n707M-0003bS-2q for qemu-devel@nongnu.org; Mon, 10 Jan 2022 14:14:08 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:27850) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n707J-0004K3-7z for qemu-devel@nongnu.org; Mon, 10 Jan 2022 14:14:06 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-317-ZdeE_pvXM3yWrx3OHlLtgA-1; Mon, 10 Jan 2022 14:13:56 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C29F681EE60; Mon, 10 Jan 2022 19:13:54 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.33.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1EB2119D9B; Mon, 10 Jan 2022 19:13:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641842039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=R3DOD+6A818wXSNBjhzU9R78xumTHf3z2M82tyexEWs=; b=NalsfC5iVAq0LkH//RYLwO53GwFuMuLkdjrO4wMpKwJiihJ+AW1RGPxVJGc8gRmw0ZX6WO WQLOqhwjvFwhQyBZyZxT4HpiLAKsZvl79KQ8yzwcDBHsXEz0bTzrhkWifZDFXNliUt026z V54pxltO/ZEBNmi01I506TSOtayrqcI= X-MC-Unique: ZdeE_pvXM3yWrx3OHlLtgA-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH 1/3] python/aqmp: use absolute import statement Date: Mon, 10 Jan 2022 14:13:47 -0500 Message-Id: <20220110191349.1841027-2-jsnow@redhat.com> In-Reply-To: <20220110191349.1841027-1-jsnow@redhat.com> References: <20220110191349.1841027-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.597, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , John Snow , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1641842777245100001 Content-Type: text/plain; charset="utf-8" pylint's dependency astroid appears to have bugs in 2.9.1 and 2.9.2 (Dec 31 and Jan 3) that appear to erroneously expect the qemu namespace to have an __init__.py file. astroid 2.9.3 (Jan 9) avoids that problem, but appears to not understand a relative import within a namespace package. Update the relative import - it was worth changing anyway, because these packages will eventually be packaged and distributed separately. Signed-off-by: John Snow Reviewed-by: Beraldo Leal --- python/qemu/aqmp/aqmp_tui.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/qemu/aqmp/aqmp_tui.py b/python/qemu/aqmp/aqmp_tui.py index a2929f771c..f1e926dd75 100644 --- a/python/qemu/aqmp/aqmp_tui.py +++ b/python/qemu/aqmp/aqmp_tui.py @@ -35,7 +35,8 @@ import urwid import urwid_readline =20 -from ..qmp import QEMUMonitorProtocol, QMPBadPortError +from qemu.qmp import QEMUMonitorProtocol, QMPBadPortError + from .error import ProtocolError from .message import DeserializationError, Message, UnexpectedTypeError from .protocol import ConnectError, Runstate --=20 2.31.1 From nobody Tue May 7 05:47:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 164184229727982.20170432980797; Mon, 10 Jan 2022 11:18:17 -0800 (PST) Received: from localhost ([::1]:45146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n70BM-0006Uh-0B for importer@patchew.org; Mon, 10 Jan 2022 14:18:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44098) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n707N-0003bg-30 for qemu-devel@nongnu.org; Mon, 10 Jan 2022 14:14:10 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:45765) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n707J-0004K7-8Q for qemu-devel@nongnu.org; Mon, 10 Jan 2022 14:14:07 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-12-5YOYE5YSM42HHg5kFZOtCg-1; Mon, 10 Jan 2022 14:13:56 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A08F91023F4E; Mon, 10 Jan 2022 19:13:55 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.33.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id E4E5B19724; Mon, 10 Jan 2022 19:13:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641842040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3Zq98eDi1EyZSuUL5HDy8SVHM8lIBUIi4+o/WwznR4A=; b=dalLO0TMplX0cZWNpJGhEbxrycEL4/JaRbqk2Bmwj4TNyzO1AfU7QQ9ak3NEt+fPcrMvDy H3FgeBmN5NQZr//Q3+fAlT3W40nXJZbLr2vozwQt+Skt1s2IqiMZexlkX4l2TQeKZzLhlO pf2dZRJWb1xLV9Fhh5EHCYtONDVvf+o= X-MC-Unique: 5YOYE5YSM42HHg5kFZOtCg-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH 2/3] Python/aqmp: fix type definitions for mypy 0.920 Date: Mon, 10 Jan 2022 14:13:48 -0500 Message-Id: <20220110191349.1841027-3-jsnow@redhat.com> In-Reply-To: <20220110191349.1841027-1-jsnow@redhat.com> References: <20220110191349.1841027-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.597, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , John Snow , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1641842298713100005 Content-Type: text/plain; charset="utf-8" 0.920 (Released 2021-12-15) is not entirely happy with the way that I was defining _FutureT: qemu/aqmp/protocol.py:601: error: Item "object" of the upper bound "Optional[Future[Any]]" of type variable "_FutureT" has no attribute "done" Update it with something a little mechanically simpler that works better across a wider array of mypy versions. Signed-off-by: John Snow --- python/qemu/aqmp/protocol.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/qemu/aqmp/protocol.py b/python/qemu/aqmp/protocol.py index 5190b33b13..c4fbe35a0e 100644 --- a/python/qemu/aqmp/protocol.py +++ b/python/qemu/aqmp/protocol.py @@ -43,8 +43,8 @@ =20 =20 T =3D TypeVar('T') +_U =3D TypeVar('_U') _TaskFN =3D Callable[[], Awaitable[None]] # aka ``async def func() -> Non= e`` -_FutureT =3D TypeVar('_FutureT', bound=3DOptional['asyncio.Future[Any]']) =20 =20 class Runstate(Enum): @@ -591,7 +591,8 @@ def _cleanup(self) -> None: """ Fully reset this object to a clean state and return to `IDLE`. """ - def _paranoid_task_erase(task: _FutureT) -> Optional[_FutureT]: + def _paranoid_task_erase(task: Optional['asyncio.Future[_U]'] + ) -> Optional['asyncio.Future[_U]']: # Help to erase a task, ENSURING it is fully quiesced first. assert (task is None) or task.done() return None if (task and task.done()) else task --=20 2.31.1 From nobody Tue May 7 05:47:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1641842473181674.3810138563051; Mon, 10 Jan 2022 11:21:13 -0800 (PST) Received: from localhost ([::1]:50488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n70EC-0001mn-4o for importer@patchew.org; Mon, 10 Jan 2022 14:21:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44100) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n707N-0003bh-33 for qemu-devel@nongnu.org; Mon, 10 Jan 2022 14:14:10 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:60291) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n707J-0004KD-8i for qemu-devel@nongnu.org; Mon, 10 Jan 2022 14:14:07 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-631-BZ6E2oNENvy8kCyTTAf4nw-1; Mon, 10 Jan 2022 14:13:57 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6F36781EE61; Mon, 10 Jan 2022 19:13:56 +0000 (UTC) Received: from scv.redhat.com (unknown [10.22.33.97]) by smtp.corp.redhat.com (Postfix) with ESMTP id C334519D9B; Mon, 10 Jan 2022 19:13:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641842040; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BfOv0/rdi6Dz2EGqr8Uc/FttFgjKn2CNy9zz2yuRkh4=; b=EpkGYCGZhRhPhuUq6kXTorsIzJvf2Cokmz9U8aboSjfLgnxLTLe2K9VhemDIeR2xvvHfAg 5k6MCQBftRHRJzo5LZnuEZ/ioXzI4B0LIFUtZvnmji2cff7rtm4v/UmO0pSnZVBaoJM2ZN IfS03IAcvPx4KARtpTtjxbQ9a2Nebqs= X-MC-Unique: BZ6E2oNENvy8kCyTTAf4nw-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH 3/3] python: update type hints for mypy 0.930 Date: Mon, 10 Jan 2022 14:13:49 -0500 Message-Id: <20220110191349.1841027-4-jsnow@redhat.com> In-Reply-To: <20220110191349.1841027-1-jsnow@redhat.com> References: <20220110191349.1841027-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -33 X-Spam_score: -3.4 X-Spam_bar: --- X-Spam_report: (-3.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.597, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , John Snow , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Cleber Rosa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1641842474728100001 Content-Type: text/plain; charset="utf-8" Mypy 0.930, released Dec 22, changes the way argparse objects are considered. Crafting a definition that works under Python 3.6 and an older mypy alongside newer versions simultaneously is ... difficult, so... eh. Stub it out with an 'Any' definition to get the CI moving again. Oh well. Signed-off-by: John Snow Reviewed-by: Beraldo Leal --- python/qemu/qmp/qom_common.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/python/qemu/qmp/qom_common.py b/python/qemu/qmp/qom_common.py index a59ae1a2a1..2e4c741f77 100644 --- a/python/qemu/qmp/qom_common.py +++ b/python/qemu/qmp/qom_common.py @@ -30,10 +30,6 @@ from . import QEMUMonitorProtocol, QMPError =20 =20 -# The following is needed only for a type alias. -Subparsers =3D argparse._SubParsersAction # pylint: disable=3Dprotected-a= ccess - - class ObjectPropertyInfo: """ Represents the return type from e.g. qom-list. @@ -89,7 +85,7 @@ def __init__(self, args: argparse.Namespace): self.qmp.connect() =20 @classmethod - def register(cls, subparsers: Subparsers) -> None: + def register(cls, subparsers: Any) -> None: """ Register this command with the argument parser. =20 --=20 2.31.1