From nobody Sun Nov 24 11:02:49 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1724113423; cv=none; d=zohomail.com; s=zohoarc; b=lctNGgh0uT/9/TeQotrVS8/zBA0g06kRW3wnsUbYQe/iT2jpovPOIHWTfHpMRv/EFC9x/PakYsmlbVpqvajBx9WiUUFrVDRs7oNJEBQc6Byjtusjrq/tdRUDP8eiuG5oMYdsQlja4T9PW9focWc+pQ2u1wPMpZp2dz55nAE1NZU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1724113423; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=uq0gvW6lhA9f5naE5+wCuwIJeRf8GGxda2e3fpP9QGY=; b=WZtI5HOetx8qDH3qKOD2NzFhDKFF/zr/bPkau3051zrBvyKqzppZ6vP7sjmoDFcmuroW9xunMMZXAscP3pg9UouiPEXF4WlL2RrLNdc5yIE4bLwcMF5JyBdhRGXSqB3xqoFXA/+B5jWDXy1KAFJFZW3qzWy2cTEsd+kHKYW8Thc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1724113423805904.9611076642467; Mon, 19 Aug 2024 17:23:43 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sgCes-0005N9-HK; Mon, 19 Aug 2024 20:23:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgCeq-0005BZ-DL for qemu-devel@nongnu.org; Mon, 19 Aug 2024 20:23:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgCeo-0003ri-Rw for qemu-devel@nongnu.org; Mon, 19 Aug 2024 20:23:32 -0400 Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-222-k59HPmzPM6y6AViAG_Jc2w-1; Mon, 19 Aug 2024 20:23:27 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E58951955BFA; Tue, 20 Aug 2024 00:23:24 +0000 (UTC) Received: from scv.localdomain (unknown [10.22.8.20]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id D5BDE19560A3; Tue, 20 Aug 2024 00:23:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724113410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uq0gvW6lhA9f5naE5+wCuwIJeRf8GGxda2e3fpP9QGY=; b=CRdIMNSaa+UucIzOgHsCb/LEBchLgrDsyLhRo+eIITAHVbrSOYuCTLhS2cAwiMOAa+P78v PzCzNZBkwTmxqmdaI6iBQgPMP2AT+GCeFK16aNO8Wllev8cN2qigi4V03IqGkwVFBQwLya 0BjUw6Mf3dURAkRfeho86zjrc3o4WyA= X-MC-Unique: k59HPmzPM6y6AViAG_Jc2w-1 From: John Snow To: qemu-devel@nongnu.org Cc: John Snow , Cleber Rosa , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Thomas Huth , Markus Armbruster , Peter Maydell , Beraldo Leal , Michael Roth , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 1/8] python/qapi: correct re.Match type hints for 3.13 Date: Mon, 19 Aug 2024 20:23:10 -0400 Message-ID: <20240820002318.1380276-2-jsnow@redhat.com> In-Reply-To: <20240820002318.1380276-1-jsnow@redhat.com> References: <20240820002318.1380276-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.134, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1724113424469116600 Content-Type: text/plain; charset="utf-8" typing.Match was removed in Python 3.13, so we need to use re.Match instead. However, Python 3.8 doesn't support using re.Match as a type hint directly, so we need a conditional for now. The import is written oddly so that "Match" is explicitly re-exported for re-use by other modules. mypy will complain otherwise. Signed-off-by: John Snow Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- scripts/qapi/common.py | 10 +++++++++- scripts/qapi/parser.py | 3 +-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py index 737b059e629..444b3acf53a 100644 --- a/scripts/qapi/common.py +++ b/scripts/qapi/common.py @@ -12,16 +12,24 @@ # See the COPYING file in the top-level directory. =20 import re +import sys from typing import ( Any, Dict, - Match, Optional, Sequence, Union, ) =20 =20 +if sys.version_info < (3, 9): + # typing.Match was removed in 3.13, + # but it's still a necessity in 3.8. + from typing import \ + Match as Match # pylint: disable=3Duseless-import-alias +else: + Match =3D re.Match + #: Magic string that gets removed along with all space to its right. EATSPACE =3D '\033EATSPACE.' POINTER_SUFFIX =3D ' *' + EATSPACE diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index adc85b5b394..9a42b119131 100644 --- a/scripts/qapi/parser.py +++ b/scripts/qapi/parser.py @@ -23,13 +23,12 @@ Dict, List, Mapping, - Match, Optional, Set, Union, ) =20 -from .common import must_match +from .common import Match, must_match from .error import QAPISemError, QAPISourceError from .source import QAPISourceInfo =20 --=20 2.45.0 From nobody Sun Nov 24 11:02:49 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1724113457; cv=none; d=zohomail.com; s=zohoarc; b=GznCoDGJdklT2BxWQpK5V0ahDp5OmYS5JKDufAENiQPpPbE8U2YdobnPaNqjF/jaD7PE5d1igMytsN66Pqc0hmTNfW9s2cZ/mcU/qKL9QoptwWZ4I4w+DjhJua3TWwSdvHCimyGCmwna9eAZ4qvvmmooTNa/MjivuNdy49348Eg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1724113457; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=6rWo2Tsdw7qt5kSlRzu/xbKB78mSUh/D6zkAbI38l4s=; b=QXRDj4NgDt7D5mo18bAxFgJLMInk3D5R7eursWjy9sUomIG6CqO3A7P9iKdvkv/PeWLdYeGWFx9NCbBgR/ybvbmgiNl16kOUPky9CZhI4Ee9dRDVik4uqP3oVKe9nJxrXd7D1NR2+E02C+w9RtVekugQ1XORuXSAvTE1/gL/d5w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 172411345751156.14174153920703; Mon, 19 Aug 2024 17:24:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sgCf8-0006JT-2a; Mon, 19 Aug 2024 20:23:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgCet-0005Rr-Im for qemu-devel@nongnu.org; Mon, 19 Aug 2024 20:23:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgCer-0003ry-V5 for qemu-devel@nongnu.org; Mon, 19 Aug 2024 20:23:35 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-167-SLZIk3gnN26nbTu1MhNmzw-1; Mon, 19 Aug 2024 20:23:29 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id DEBA419560B4; Tue, 20 Aug 2024 00:23:27 +0000 (UTC) Received: from scv.localdomain (unknown [10.22.8.20]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 5E87E1956053; Tue, 20 Aug 2024 00:23:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724113413; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6rWo2Tsdw7qt5kSlRzu/xbKB78mSUh/D6zkAbI38l4s=; b=BNax4JqFz8wqJe53gJBW5iUnJGF7+imIPhPuRCPK6rwxbnb6TcRFGSTbutc0HqvLXQeRFd p7WtkSSipCPsn+eNfzzsNLa1zMhjUdFbyJU4N37tfzP8hejji+E8s2EDX1VDltoHd6B9oQ +3JyRe1OmamzDrxP06BebHayumM+71Q= X-MC-Unique: SLZIk3gnN26nbTu1MhNmzw-1 From: John Snow To: qemu-devel@nongnu.org Cc: John Snow , Cleber Rosa , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Thomas Huth , Markus Armbruster , Peter Maydell , Beraldo Leal , Michael Roth , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 2/8] python/qapi: change "FIXME" to "TODO" Date: Mon, 19 Aug 2024 20:23:11 -0400 Message-ID: <20240820002318.1380276-3-jsnow@redhat.com> In-Reply-To: <20240820002318.1380276-1-jsnow@redhat.com> References: <20240820002318.1380276-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.134, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1724113458608116600 Content-Type: text/plain; charset="utf-8" qemu.git/python/setup.cfg disallows checking in any code with "XXX", "FIXME" or "TODO" in the comments. Soften the restriction to only prohibit "FIXME", and change the two occurrences of "FIXME" in qapi to read "TODO" instead. Signed-off-by: John Snow --- python/setup.cfg | 5 +++++ scripts/qapi/commands.py | 2 +- scripts/qapi/events.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/python/setup.cfg b/python/setup.cfg index 3b4e2cc5501..72b58c98c99 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -169,6 +169,11 @@ ignore-signatures=3Dyes # TODO: Remove after we opt in to Pylint 2.8.3. See commit msg. min-similarity-lines=3D6 =20 +[pylint.miscellaneous] + +# forbid FIXME/XXX comments, allow TODO. +notes=3DFIXME, + XXX, =20 [isort] force_grid_wrap=3D4 diff --git a/scripts/qapi/commands.py b/scripts/qapi/commands.py index 79951a841f5..cffed6cd3ba 100644 --- a/scripts/qapi/commands.py +++ b/scripts/qapi/commands.py @@ -385,7 +385,7 @@ def visit_command(self, coroutine: bool) -> None: if not gen: return - # FIXME: If T is a user-defined type, the user is responsible + # TODO: If T is a user-defined type, the user is responsible # for making this work, i.e. to make T's condition the # conjunction of the T-returning commands' conditions. If T # is a built-in type, this isn't possible: the diff --git a/scripts/qapi/events.py b/scripts/qapi/events.py index d1f639981a9..36dc0c50c78 100644 --- a/scripts/qapi/events.py +++ b/scripts/qapi/events.py @@ -84,7 +84,7 @@ def gen_event_send(name: str, boxed: bool, event_enum_name: str, event_emit: str) -> str: - # FIXME: Our declaration of local variables (and of 'errp' in the + # TODO: Our declaration of local variables (and of 'errp' in the # parameter list) can collide with exploded members of the event's # data type passed in as parameters. If this collision ever hits in # practice, we can rename our local variables with a leading _ prefix, --=20 2.45.0 From nobody Sun Nov 24 11:02:49 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1724113498; cv=none; d=zohomail.com; s=zohoarc; b=Ew8cS7pAdXbMo3Jo+cSWGadqJYmIv6w5MErzMVqOsfxYpsWjmPl4Wcf0S72wLxkeLSGChgofc5UfnQTbDRnYbb8q7F3X7WcnKZ60v3F2x0VK2IHu1xQgfF73I4d+QQDfvW4n9k9vkaky6hkW41Nwkq9ZIHZQYbhJb6HO6l+AyGo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1724113498; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=3ChOcyKM7vxrJog08lbTCt4LwIxuTF65PtkjUT+QeaE=; b=cG9mE+TJsvm7pnEXElWxYLhZMrpNqzhoV5KIFC7tk5VnnnPGFOShVosVaQkR+Ycgqhg1RAw8ayPSRUMRQ/ttJr66Kl73DODFMGST4GYIAFKkPoNBoUGMXVpWPIJccaqpwV1OeQsrg34hE7sI0bt2pdQEgPxCbcYLQZ50mUVZ/4k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1724113498612169.14196462610948; Mon, 19 Aug 2024 17:24:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sgCfE-000759-GG; Mon, 19 Aug 2024 20:23:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgCev-0005Z0-7I for qemu-devel@nongnu.org; Mon, 19 Aug 2024 20:23:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgCet-0003s6-K2 for qemu-devel@nongnu.org; Mon, 19 Aug 2024 20:23:36 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-384-KrQ78QTtNgGL6n0865yFhA-1; Mon, 19 Aug 2024 20:23:31 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A8C611955D57; Tue, 20 Aug 2024 00:23:30 +0000 (UTC) Received: from scv.localdomain (unknown [10.22.8.20]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 12E0F1955F44; Tue, 20 Aug 2024 00:23:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724113415; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3ChOcyKM7vxrJog08lbTCt4LwIxuTF65PtkjUT+QeaE=; b=ScEm9opQqgoGAohmmBAUVvdi8xi0LunG2k2uC1QpE4IksCLy/WBF41jx3oYFr5VpzkQjL2 rUmtuNSlF6XniGwNf8jmTEMCQEeufMQGPO/qNAcn6tUVa7kTvQD+ZfhJlCoOohMg5mrlpE cjo6SVtr+RuPA8RKOjnBFKAUw2NKJFQ= X-MC-Unique: KrQ78QTtNgGL6n0865yFhA-1 From: John Snow To: qemu-devel@nongnu.org Cc: John Snow , Cleber Rosa , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Thomas Huth , Markus Armbruster , Peter Maydell , Beraldo Leal , Michael Roth , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 3/8] python/qapi: add pylint pragmas Date: Mon, 19 Aug 2024 20:23:12 -0400 Message-ID: <20240820002318.1380276-4-jsnow@redhat.com> In-Reply-To: <20240820002318.1380276-1-jsnow@redhat.com> References: <20240820002318.1380276-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.134, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1724113498986116600 Content-Type: text/plain; charset="utf-8" We are preparing to move the QAPI generator code into qemu.git/python/qemu/qapi. The qemu.git/python pylint configuration is stricter than the current qapi generator configuration. These additional pragmas bridge the gap without requiring us to loosen the requirements in the python directory. Signed-off-by: John Snow --- scripts/qapi/expr.py | 1 + scripts/qapi/introspect.py | 1 + scripts/qapi/parser.py | 4 ++++ scripts/qapi/visit.py | 1 + 4 files changed, 7 insertions(+) diff --git a/scripts/qapi/expr.py b/scripts/qapi/expr.py index cae0a083591..f60e580dd36 100644 --- a/scripts/qapi/expr.py +++ b/scripts/qapi/expr.py @@ -604,6 +604,7 @@ def check_exprs(exprs: List[QAPIExpression]) -> List[QA= PIExpression]: :raise QAPISemError: When any expression fails validation. :return: The same list of expressions (now modified). """ + # pylint: disable=3Dtoo-many-branches for expr in exprs: info =3D expr.info doc =3D expr.doc diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py index ac14b20f308..9d499f90b7c 100644 --- a/scripts/qapi/introspect.py +++ b/scripts/qapi/introspect.py @@ -106,6 +106,7 @@ def _tree_to_qlit(obj: JSONValue, :param dict_value: True when the value being processed belongs to a dict key; which suppresses the output indent. """ + # pylint: disable=3Dtoo-many-branches =20 def indent(level: int) -> str: return level * 4 * ' ' diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index 9a42b119131..9bb039fe8d3 100644 --- a/scripts/qapi/parser.py +++ b/scripts/qapi/parser.py @@ -118,6 +118,8 @@ def _parse(self) -> None: =20 :return: None. Results are stored in ``.exprs`` and ``.docs``. """ + # pylint: disable=3Dtoo-many-branches + cur_doc =3D None =20 # May raise OSError; allow the caller to handle it. @@ -290,6 +292,7 @@ def accept(self, skip_comment: bool =3D True) -> None: =20 ``.tok`` and ``.val`` will both be None at EOF. """ + # pylint: disable=3Dtoo-many-branches while True: self.tok =3D self.src[self.cursor] self.pos =3D self.cursor @@ -478,6 +481,7 @@ def get_doc_paragraph(self, doc: 'QAPIDoc') -> Optional= [str]: doc.append_line(line) =20 def get_doc(self) -> 'QAPIDoc': + # pylint: disable=3Dtoo-many-statements,too-many-branches if self.val !=3D '##': raise QAPIParseError( self, "junk after '##' at start of documentation comment") diff --git a/scripts/qapi/visit.py b/scripts/qapi/visit.py index 12f92e429f6..20ce6be9978 100644 --- a/scripts/qapi/visit.py +++ b/scripts/qapi/visit.py @@ -65,6 +65,7 @@ def gen_visit_object_members(name: str, base: Optional[QAPISchemaObjectType], members: List[QAPISchemaObjectTypeMember], branches: Optional[QAPISchemaBranches]) -> st= r: + # pylint: disable=3Dtoo-many-branches ret =3D mcgen(''' =20 bool visit_type_%(c_name)s_members(Visitor *v, %(c_name)s *obj, Error **er= rp) --=20 2.45.0 From nobody Sun Nov 24 11:02:49 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1724113494; cv=none; d=zohomail.com; s=zohoarc; b=ktrl53RzT3F5kz0uDXhucV3EALqSO8znE4KH+FPilD75LvBdATS/xYpxe9iyQtZqTzI/330b41afDYs94q+9wW2+SGTkk6OIWWHlLRzHK1+lhDYPpJMYzjNSzAckk9Wb63Wn46NZaVK1ymPTQBMGecibzNJnFTBtxpx51onj0AA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1724113494; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=rzVIR2iKYmZ0GMgj8OYgVR574tB9UHe4tLCIQsBzX3Q=; b=XIlFj0i0gx/F54eOVGWVMvEAGvK2euY8k9nMHCp6D1DrrXRtKDrZKaIlBdJmiiLbhtdbLXAA3MoKRfsmm5wffaOc3ZUjkjrtZEyp2GLslLhtOiAvz9N7lbC175H7EwKdyxlLablkBEPIM0BlCw4lT4w7DLqCn5DWg9ZRi3PDaJU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1724113494192117.59819851683221; Mon, 19 Aug 2024 17:24:54 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sgCfI-0007Tp-9Y; Mon, 19 Aug 2024 20:24:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgCew-0005e9-JO for qemu-devel@nongnu.org; Mon, 19 Aug 2024 20:23:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgCev-0003sK-69 for qemu-devel@nongnu.org; Mon, 19 Aug 2024 20:23:38 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-508-2qYrD8taMsCQUBAPOca5AQ-1; Mon, 19 Aug 2024 20:23:34 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2908D1955BFE; Tue, 20 Aug 2024 00:23:33 +0000 (UTC) Received: from scv.localdomain (unknown [10.22.8.20]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id CF35C1955F45; Tue, 20 Aug 2024 00:23:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724113416; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rzVIR2iKYmZ0GMgj8OYgVR574tB9UHe4tLCIQsBzX3Q=; b=O0HCuzcTMilVFYKmuynJWr2oen2QxoASR4WJoeQeReXgpOEtr7Hr8+KYE+49bDMhKgWMJg XArXDtRHhcYg0oQqjg7UQSujPcG1EO8f+9onsg2f9fNSFdVmh4b4Ebs6URDDw9yhfPjU2G 8F1W4CExZnj8zCxIEAD7vAjbPKy1X7E= X-MC-Unique: 2qYrD8taMsCQUBAPOca5AQ-1 From: John Snow To: qemu-devel@nongnu.org Cc: John Snow , Cleber Rosa , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Thomas Huth , Markus Armbruster , Peter Maydell , Beraldo Leal , Michael Roth , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 4/8] python/qapi: remove outdated pragmas Date: Mon, 19 Aug 2024 20:23:13 -0400 Message-ID: <20240820002318.1380276-5-jsnow@redhat.com> In-Reply-To: <20240820002318.1380276-1-jsnow@redhat.com> References: <20240820002318.1380276-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.134, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1724113494929116600 Content-Type: text/plain; charset="utf-8" These pragmas are no longer neccessary under our current linter/static analysis versions; they can be removed. Signed-off-by: John Snow --- scripts/qapi/gen.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py index 6a8abe00415..ce94aee8e70 100644 --- a/scripts/qapi/gen.py +++ b/scripts/qapi/gen.py @@ -62,11 +62,9 @@ def get_content(self) -> str: return self._top() + self._preamble + self._body + self._bottom() =20 def _top(self) -> str: - # pylint: disable=3Dno-self-use return '' =20 def _bottom(self) -> str: - # pylint: disable=3Dno-self-use return '' =20 def write(self, output_dir: str) -> None: --=20 2.45.0 From nobody Sun Nov 24 11:02:49 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1724113458; cv=none; d=zohomail.com; s=zohoarc; b=haK9p+kI7PrPriKMDBzfNI55h5gjV6NHPy2+1+qhpG6ParTxuqtLC68n3nkX6mJ3dgu20jkpkbcE3rptlZ8oqFwQjm6OSaMlMUgQAMvDc57NlYt5gRsXMOJ9tbg3v7GNYDpJ7Zuvu7K4KYaSMqKJYhS4JjtTVS7U7OJYKpkaikw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1724113458; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=bihOoSkwA1O6zLvD7UvAJE+9N3HlxTZKpPu6NWV7caA=; b=U6jZ4KFK0fVv7XCPdujDrpe4PV5qr1kUVfXJdO0DHzLQXgVnoGaTuouDqybYnaslLiCTtJNZ1pX7GignofEVHuIZvofBslA83XSE+3vU46r48ydKRYA9BgP295BMCmzRXHs7F45McaG8Hap+uEm3V20d3I4ROVkS/gZk63c6RA8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1724113458751840.9677646802961; Mon, 19 Aug 2024 17:24:18 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sgCfC-0006op-K4; Mon, 19 Aug 2024 20:23:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgCf1-0005y9-Ad for qemu-devel@nongnu.org; Mon, 19 Aug 2024 20:23:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgCez-0003sp-CW for qemu-devel@nongnu.org; Mon, 19 Aug 2024 20:23:43 -0400 Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-581-fABkUriQPhi2uGZXnJIoKg-1; Mon, 19 Aug 2024 20:23:36 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 967191954B23; Tue, 20 Aug 2024 00:23:35 +0000 (UTC) Received: from scv.localdomain (unknown [10.22.8.20]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3333419560A3; Tue, 20 Aug 2024 00:23:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724113420; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bihOoSkwA1O6zLvD7UvAJE+9N3HlxTZKpPu6NWV7caA=; b=VXA8ImMdkrwEeeNTvjKiXYcZ8/Y9F6C2KP6BexcYcxCcxcNg72/UZNgUM2JUB6F3dpzkV+ E8wbkFXstCZtPInaTOGEjIROc33q+rKQ4kt1kvTVBkKlkE//XhKH+unDXZ/Js73qCcnYDj 05Vx2ja7GZmtIeo8f2jlB4qvOjKDm9Q= X-MC-Unique: fABkUriQPhi2uGZXnJIoKg-1 From: John Snow To: qemu-devel@nongnu.org Cc: John Snow , Cleber Rosa , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Thomas Huth , Markus Armbruster , Peter Maydell , Beraldo Leal , Michael Roth , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 5/8] python/qapi: ignore missing docstrings in pylint Date: Mon, 19 Aug 2024 20:23:14 -0400 Message-ID: <20240820002318.1380276-6-jsnow@redhat.com> In-Reply-To: <20240820002318.1380276-1-jsnow@redhat.com> References: <20240820002318.1380276-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.134, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1724113460794116600 Content-Type: text/plain; charset="utf-8" Maybe temporary, I am not sure. Instead of disabling docstring checking *globally* for all of our python files, just disable it for QAPI modules. Signed-off-by: John Snow --- scripts/qapi/commands.py | 2 ++ scripts/qapi/common.py | 2 ++ scripts/qapi/events.py | 2 ++ scripts/qapi/expr.py | 2 ++ scripts/qapi/gen.py | 2 ++ scripts/qapi/introspect.py | 2 ++ scripts/qapi/main.py | 2 ++ scripts/qapi/parser.py | 2 ++ scripts/qapi/schema.py | 2 +- scripts/qapi/source.py | 2 ++ scripts/qapi/types.py | 2 ++ scripts/qapi/visit.py | 2 ++ 12 files changed, 23 insertions(+), 1 deletion(-) diff --git a/scripts/qapi/commands.py b/scripts/qapi/commands.py index cffed6cd3ba..b01de93c965 100644 --- a/scripts/qapi/commands.py +++ b/scripts/qapi/commands.py @@ -13,6 +13,8 @@ See the COPYING file in the top-level directory. """ =20 +# pylint: disable=3Dmissing-docstring + from typing import ( Dict, List, diff --git a/scripts/qapi/common.py b/scripts/qapi/common.py index 444b3acf53a..918a1ab728a 100644 --- a/scripts/qapi/common.py +++ b/scripts/qapi/common.py @@ -11,6 +11,8 @@ # This work is licensed under the terms of the GNU GPL, version 2. # See the COPYING file in the top-level directory. =20 +# pylint: disable=3Dmissing-docstring + import re import sys from typing import ( diff --git a/scripts/qapi/events.py b/scripts/qapi/events.py index 36dc0c50c78..9ab9ff4e695 100644 --- a/scripts/qapi/events.py +++ b/scripts/qapi/events.py @@ -12,6 +12,8 @@ See the COPYING file in the top-level directory. """ =20 +# pylint: disable=3Dmissing-docstring + from typing import List, Optional =20 from .common import c_enum_const, c_name, mcgen diff --git a/scripts/qapi/expr.py b/scripts/qapi/expr.py index f60e580dd36..c137dcf950a 100644 --- a/scripts/qapi/expr.py +++ b/scripts/qapi/expr.py @@ -13,6 +13,8 @@ # This work is licensed under the terms of the GNU GPL, version 2. # See the COPYING file in the top-level directory. =20 +# pylint: disable=3Dmissing-docstring + """ Normalize and validate (context-free) QAPI schema expression structures. =20 diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py index ce94aee8e70..f869c751e53 100644 --- a/scripts/qapi/gen.py +++ b/scripts/qapi/gen.py @@ -11,6 +11,8 @@ # This work is licensed under the terms of the GNU GPL, version 2. # See the COPYING file in the top-level directory. =20 +# pylint: disable=3Dmissing-docstring + from contextlib import contextmanager import os import re diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py index 9d499f90b7c..44edc42d18b 100644 --- a/scripts/qapi/introspect.py +++ b/scripts/qapi/introspect.py @@ -11,6 +11,8 @@ See the COPYING file in the top-level directory. """ =20 +# pylint: disable=3Dmissing-docstring + from typing import ( Any, Dict, diff --git a/scripts/qapi/main.py b/scripts/qapi/main.py index 316736b6a29..24ffa15aa2c 100644 --- a/scripts/qapi/main.py +++ b/scripts/qapi/main.py @@ -7,6 +7,8 @@ This is the main entry point for generating C code from the QAPI schema. """ =20 +# pylint: disable=3Dmissing-docstring + import argparse import sys from typing import Optional diff --git a/scripts/qapi/parser.py b/scripts/qapi/parser.py index 9bb039fe8d3..9113c9d1506 100644 --- a/scripts/qapi/parser.py +++ b/scripts/qapi/parser.py @@ -14,6 +14,8 @@ # This work is licensed under the terms of the GNU GPL, version 2. # See the COPYING file in the top-level directory. =20 +# pylint: disable=3Dmissing-docstring + from collections import OrderedDict import os import re diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py index d65c35f6ee6..a06b3e30ffd 100644 --- a/scripts/qapi/schema.py +++ b/scripts/qapi/schema.py @@ -12,7 +12,7 @@ # This work is licensed under the terms of the GNU GPL, version 2. # See the COPYING file in the top-level directory. =20 -# pylint: disable=3Dtoo-many-lines +# pylint: disable=3Dtoo-many-lines, missing-docstring =20 # TODO catching name collisions in generated code would be nice =20 diff --git a/scripts/qapi/source.py b/scripts/qapi/source.py index 7b379fdc925..ad7f4e1a0e5 100644 --- a/scripts/qapi/source.py +++ b/scripts/qapi/source.py @@ -9,6 +9,8 @@ # This work is licensed under the terms of the GNU GPL, version 2. # See the COPYING file in the top-level directory. =20 +# pylint: disable=3Dmissing-docstring + import copy from typing import List, Optional, TypeVar =20 diff --git a/scripts/qapi/types.py b/scripts/qapi/types.py index 0dd0b00ada3..abba5983870 100644 --- a/scripts/qapi/types.py +++ b/scripts/qapi/types.py @@ -13,6 +13,8 @@ # See the COPYING file in the top-level directory. """ =20 +# pylint: disable=3Dmissing-docstring + from typing import List, Optional =20 from .common import c_enum_const, c_name, mcgen diff --git a/scripts/qapi/visit.py b/scripts/qapi/visit.py index 20ce6be9978..851f3b01e97 100644 --- a/scripts/qapi/visit.py +++ b/scripts/qapi/visit.py @@ -13,6 +13,8 @@ See the COPYING file in the top-level directory. """ =20 +# pylint: disable=3Dmissing-docstring + from typing import List, Optional =20 from .common import ( --=20 2.45.0 From nobody Sun Nov 24 11:02:49 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1724113457; cv=none; d=zohomail.com; s=zohoarc; b=B8qRnBhiibxUXbuCtCqz2RMn/aFEw1cnDkoxHcIvdtUeSl/MXQqXVqkoejqzrCvrCQ4B3ELnDfGPvCXkMy9x/QtpcGW4xxPvoG7t01PzDkgholf4vNENW9ixGQ1zg3Qxphq6WRqmNKxiLS7dbDSDeYoh8uS2hfnZX8F9pafE0d0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1724113457; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=+BWut0oMwogFBURxJ7pVFl65sLZ5cIGHleFZfkcXaHk=; b=oElXWBYY80nGgA4y+FDGuVXp7HeVxyHw95xtZAu52ttBWIK3N8JSkVqclScAY7QK2d6om71hlZPHw6XHRh8JLFjhVIMHwY5z/BswlMysrq8V+lwqOeK0tp8WNEhpGhpZIPhBzOc+a0EOPFgTI76JREDMNW04EawJlJAIJN7wNrc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1724113457781623.0621506593903; Mon, 19 Aug 2024 17:24:17 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sgCfF-0007F1-RL; Mon, 19 Aug 2024 20:23:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgCf2-00062k-Gu for qemu-devel@nongnu.org; Mon, 19 Aug 2024 20:23:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgCf0-0003tG-Jb for qemu-devel@nongnu.org; Mon, 19 Aug 2024 20:23:44 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-119-TxBZQL6uMXO8wIz1apXwKQ-1; Mon, 19 Aug 2024 20:23:39 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 145261955D57; Tue, 20 Aug 2024 00:23:38 +0000 (UTC) Received: from scv.localdomain (unknown [10.22.8.20]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 8034A1956053; Tue, 20 Aug 2024 00:23:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724113422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+BWut0oMwogFBURxJ7pVFl65sLZ5cIGHleFZfkcXaHk=; b=eoO5OvX+xE0RRWIQvO+pXmjmTd0j+3m0xpAywJ7y8wpctfXkgnBn0/RZXB7Q+xvmk1YJqW 0gW7y9shWjRtWFqnGtBt16eZAFeu2EMvHDqMeDX3lLEACUhzCSSqZAtsMRcMsQacjr97Q/ wE8/74I8smh8fmja5XejTFKpfZw6xhs= X-MC-Unique: TxBZQL6uMXO8wIz1apXwKQ-1 From: John Snow To: qemu-devel@nongnu.org Cc: John Snow , Cleber Rosa , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Thomas Huth , Markus Armbruster , Peter Maydell , Beraldo Leal , Michael Roth , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 6/8] python: allow short names for variables on older pylint Date: Mon, 19 Aug 2024 20:23:15 -0400 Message-ID: <20240820002318.1380276-7-jsnow@redhat.com> In-Reply-To: <20240820002318.1380276-1-jsnow@redhat.com> References: <20240820002318.1380276-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.134, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1724113458603116600 Content-Type: text/plain; charset="utf-8" Pylint >=3D 3.0.0 disabled this feature, but older pylint does not: allow short names by default by using a regex to do so. Incidentally, this removes the need for most of the allow list we had befor= e, so remove most of that, too. Signed-off-by: John Snow --- python/setup.cfg | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/python/setup.cfg b/python/setup.cfg index 72b58c98c99..58dba90f815 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -148,17 +148,11 @@ disable=3Dconsider-using-f-string, =20 [pylint.basic] # Good variable names which should always be accepted, separated by a comm= a. -good-names=3Di, - j, - k, - ex, - Run, - _, # By convention: Unused variable - fh, # fh =3D open(...) - fd, # fd =3D os.open(...) - c, # for c in string: ... - T, # for TypeVars. See pylint#3401 - SocketAddrT, # Not sure why this is invalid. +good-names=3DSocketAddrT, # Not sure why this is invalid. + +# pylint < 3.0 warns by default on short variable names. +# Disable this for older versions. +good-names-rgxs=3D^[_a-z][_a-z0-9]?$ =20 [pylint.similarities] # Ignore imports when computing similarities. --=20 2.45.0 From nobody Sun Nov 24 11:02:49 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1724113510; cv=none; d=zohomail.com; s=zohoarc; b=G5re5gySU3lkUJFf7PSp5e8IlVmeArZfyaUiw56bG2kF7KMuMLL/tTNYeAFVUKvxb8j5BzN4yg3i39IQqGOJXHCYifspjfJjhxCxGoLl61c1aIcd/QWhkSHZ4l9fjpsvSQ5CrPmxPmOTLAfRNNmbCd63TOP3VlIo2tE22MX+7bk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1724113510; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=3DRnrN6I6/B7gYk188UkJV+Z825z6apeSX/OAnvW++I=; b=V5IKSM1E+TP65ZtyTRTbQSN+1HEo7gCGXNZpjrkcoGYIK755uLapWgQgNPgKNLMd1rTRJXLW95ykJMYyK0Y/B9ZZstDDhJnktN4uzUPeT2q1L+4NqjTQYYbdF1dv9bgMfYTg2Lj7Nls48B74JLTf5us508Kw8xQYto5uXIZniV4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1724113510209793.7886074132114; Mon, 19 Aug 2024 17:25:10 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sgCfE-000757-G2; Mon, 19 Aug 2024 20:23:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgCf4-0006CJ-Ng for qemu-devel@nongnu.org; Mon, 19 Aug 2024 20:23:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgCf2-0003ts-9b for qemu-devel@nongnu.org; Mon, 19 Aug 2024 20:23:46 -0400 Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-287-HtTdzgVUMM-nzQUAOiZPsQ-1; Mon, 19 Aug 2024 20:23:41 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 6397D1954B1F; Tue, 20 Aug 2024 00:23:40 +0000 (UTC) Received: from scv.localdomain (unknown [10.22.8.20]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1A95519560A3; Tue, 20 Aug 2024 00:23:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724113423; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3DRnrN6I6/B7gYk188UkJV+Z825z6apeSX/OAnvW++I=; b=DTl3J7Gn7fWO2a01AH9cFvRF7aXQJhY0QzKwpPLPeVhXCtOuchj9vYqdRQFCOL4gg3sj1n I94qA0Oq1F2Xf2Nntp3k1b12o6quLWEGFpDWE0fceP6DNQbjglTR22tfHSRw9S74RsLLyO H6ucEJkaAH6dWjwB7cgdpumbbCCaQow= X-MC-Unique: HtTdzgVUMM-nzQUAOiZPsQ-1 From: John Snow To: qemu-devel@nongnu.org Cc: John Snow , Cleber Rosa , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Thomas Huth , Markus Armbruster , Peter Maydell , Beraldo Leal , Michael Roth , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 7/8] python/qapi: move scripts/qapi to python/qemu/qapi Date: Mon, 19 Aug 2024 20:23:16 -0400 Message-ID: <20240820002318.1380276-8-jsnow@redhat.com> In-Reply-To: <20240820002318.1380276-1-jsnow@redhat.com> References: <20240820002318.1380276-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.134, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1724113510797116600 Content-Type: text/plain; charset="utf-8" This is being done for the sake of unifying the linting and static type analysis configurations between scripts/qapi and python/qemu/*. With this change, the qapi module will now be checked by mypy, flake8, pylint, isort etc under all python versions from 3.8 through 3.13 under a variety of different dependency configurations in the GitLab testing pipelines. The tests can be run locally, as always: > cd qemu.git/python > make check-minreqs > make check-tox > make check-dev "check-minreqs" is the must-pass GitLab test. "check-tox" is the optional allowed-to-fail GitLab test. Signed-off-by: John Snow --- MAINTAINERS | 2 +- docs/conf.py | 2 +- docs/sphinx/qapidoc.py | 6 ++--- meson.build | 28 ++++++++++----------- {scripts =3D> python/qemu}/qapi/.flake8 | 0 {scripts =3D> python/qemu}/qapi/.isort.cfg | 0 {scripts =3D> python/qemu}/qapi/__init__.py | 0 {scripts =3D> python/qemu}/qapi/commands.py | 0 {scripts =3D> python/qemu}/qapi/common.py | 0 {scripts =3D> python/qemu}/qapi/error.py | 0 {scripts =3D> python/qemu}/qapi/events.py | 0 {scripts =3D> python/qemu}/qapi/expr.py | 0 {scripts =3D> python/qemu}/qapi/gen.py | 0 {scripts =3D> python/qemu}/qapi/introspect.py | 0 {scripts =3D> python/qemu}/qapi/main.py | 0 {scripts =3D> python/qemu}/qapi/mypy.ini | 0 {scripts =3D> python/qemu}/qapi/parser.py | 0 {scripts =3D> python/qemu}/qapi/pylintrc | 0 {scripts =3D> python/qemu}/qapi/schema.py | 0 {scripts =3D> python/qemu}/qapi/source.py | 0 {scripts =3D> python/qemu}/qapi/types.py | 0 {scripts =3D> python/qemu}/qapi/visit.py | 0 python/setup.cfg | 1 + scripts/qapi-gen.py | 4 ++- tests/qapi-schema/meson.build | 2 +- tests/qapi-schema/test-qapi.py | 4 +-- 26 files changed, 26 insertions(+), 23 deletions(-) rename {scripts =3D> python/qemu}/qapi/.flake8 (100%) rename {scripts =3D> python/qemu}/qapi/.isort.cfg (100%) rename {scripts =3D> python/qemu}/qapi/__init__.py (100%) rename {scripts =3D> python/qemu}/qapi/commands.py (100%) rename {scripts =3D> python/qemu}/qapi/common.py (100%) rename {scripts =3D> python/qemu}/qapi/error.py (100%) rename {scripts =3D> python/qemu}/qapi/events.py (100%) rename {scripts =3D> python/qemu}/qapi/expr.py (100%) rename {scripts =3D> python/qemu}/qapi/gen.py (100%) rename {scripts =3D> python/qemu}/qapi/introspect.py (100%) rename {scripts =3D> python/qemu}/qapi/main.py (100%) rename {scripts =3D> python/qemu}/qapi/mypy.ini (100%) rename {scripts =3D> python/qemu}/qapi/parser.py (100%) rename {scripts =3D> python/qemu}/qapi/pylintrc (100%) rename {scripts =3D> python/qemu}/qapi/schema.py (100%) rename {scripts =3D> python/qemu}/qapi/source.py (100%) rename {scripts =3D> python/qemu}/qapi/types.py (100%) rename {scripts =3D> python/qemu}/qapi/visit.py (100%) diff --git a/MAINTAINERS b/MAINTAINERS index 3584d6a6c6d..1912940631d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3214,7 +3214,7 @@ F: tests/unit/test-qapi-*.c F: tests/unit/test-qmp-*.c F: tests/unit/test-visitor-serialization.c F: scripts/qapi-gen.py -F: scripts/qapi/* +F: python/qemu/qapi/* F: docs/sphinx/qapidoc.py F: docs/devel/qapi* T: git https://repo.or.cz/qemu/armbru.git qapi-next diff --git a/docs/conf.py b/docs/conf.py index 876f6768815..6600db976b3 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -46,7 +46,7 @@ # Our extensions are in docs/sphinx; the qapidoc extension requires # the QAPI modules from scripts/. sys.path.insert(0, os.path.join(qemu_docdir, "sphinx")) -sys.path.insert(0, os.path.join(qemu_docdir, "../scripts")) +sys.path.insert(0, os.path.join(qemu_docdir, "../python")) =20 =20 # -- General configuration ------------------------------------------------ diff --git a/docs/sphinx/qapidoc.py b/docs/sphinx/qapidoc.py index 738b2450fb1..777fd1ac836 100644 --- a/docs/sphinx/qapidoc.py +++ b/docs/sphinx/qapidoc.py @@ -33,9 +33,9 @@ from docutils import nodes from docutils.parsers.rst import Directive, directives from docutils.statemachine import ViewList -from qapi.error import QAPIError, QAPISemError -from qapi.gen import QAPISchemaVisitor -from qapi.schema import QAPISchema +from qemu.qapi.error import QAPIError, QAPISemError +from qemu.qapi.gen import QAPISchemaVisitor +from qemu.qapi.schema import QAPISchema =20 from sphinx import addnodes from sphinx.directives.code import CodeBlock diff --git a/meson.build b/meson.build index fbda17c987e..f96c9bebe0c 100644 --- a/meson.build +++ b/meson.build @@ -3274,20 +3274,20 @@ genh +=3D configure_file(output: 'config-host.h', c= onfiguration: config_host_data) hxtool =3D find_program('scripts/hxtool') shaderinclude =3D find_program('scripts/shaderinclude.py') qapi_gen =3D find_program('scripts/qapi-gen.py') -qapi_gen_depends =3D [ meson.current_source_dir() / 'scripts/qapi/__init__= .py', - meson.current_source_dir() / 'scripts/qapi/commands.p= y', - meson.current_source_dir() / 'scripts/qapi/common.py', - meson.current_source_dir() / 'scripts/qapi/error.py', - meson.current_source_dir() / 'scripts/qapi/events.py', - meson.current_source_dir() / 'scripts/qapi/expr.py', - meson.current_source_dir() / 'scripts/qapi/gen.py', - meson.current_source_dir() / 'scripts/qapi/introspect= .py', - meson.current_source_dir() / 'scripts/qapi/main.py', - meson.current_source_dir() / 'scripts/qapi/parser.py', - meson.current_source_dir() / 'scripts/qapi/schema.py', - meson.current_source_dir() / 'scripts/qapi/source.py', - meson.current_source_dir() / 'scripts/qapi/types.py', - meson.current_source_dir() / 'scripts/qapi/visit.py', +qapi_gen_depends =3D [ meson.current_source_dir() / 'python/qemu/qapi/__in= it__.py', + meson.current_source_dir() / 'python/qemu/qapi/comman= ds.py', + meson.current_source_dir() / 'python/qemu/qapi/common= .py', + meson.current_source_dir() / 'python/qemu/qapi/error.= py', + meson.current_source_dir() / 'python/qemu/qapi/events= .py', + meson.current_source_dir() / 'python/qemu/qapi/expr.p= y', + meson.current_source_dir() / 'python/qemu/qapi/gen.py= ', + meson.current_source_dir() / 'python/qemu/qapi/intros= pect.py', + meson.current_source_dir() / 'python/qemu/qapi/main.p= y', + meson.current_source_dir() / 'python/qemu/qapi/parser= .py', + meson.current_source_dir() / 'python/qemu/qapi/schema= .py', + meson.current_source_dir() / 'python/qemu/qapi/source= .py', + meson.current_source_dir() / 'python/qemu/qapi/types.= py', + meson.current_source_dir() / 'python/qemu/qapi/visit.= py', meson.current_source_dir() / 'scripts/qapi-gen.py' ] =20 diff --git a/scripts/qapi/.flake8 b/python/qemu/qapi/.flake8 similarity index 100% rename from scripts/qapi/.flake8 rename to python/qemu/qapi/.flake8 diff --git a/scripts/qapi/.isort.cfg b/python/qemu/qapi/.isort.cfg similarity index 100% rename from scripts/qapi/.isort.cfg rename to python/qemu/qapi/.isort.cfg diff --git a/scripts/qapi/__init__.py b/python/qemu/qapi/__init__.py similarity index 100% rename from scripts/qapi/__init__.py rename to python/qemu/qapi/__init__.py diff --git a/scripts/qapi/commands.py b/python/qemu/qapi/commands.py similarity index 100% rename from scripts/qapi/commands.py rename to python/qemu/qapi/commands.py diff --git a/scripts/qapi/common.py b/python/qemu/qapi/common.py similarity index 100% rename from scripts/qapi/common.py rename to python/qemu/qapi/common.py diff --git a/scripts/qapi/error.py b/python/qemu/qapi/error.py similarity index 100% rename from scripts/qapi/error.py rename to python/qemu/qapi/error.py diff --git a/scripts/qapi/events.py b/python/qemu/qapi/events.py similarity index 100% rename from scripts/qapi/events.py rename to python/qemu/qapi/events.py diff --git a/scripts/qapi/expr.py b/python/qemu/qapi/expr.py similarity index 100% rename from scripts/qapi/expr.py rename to python/qemu/qapi/expr.py diff --git a/scripts/qapi/gen.py b/python/qemu/qapi/gen.py similarity index 100% rename from scripts/qapi/gen.py rename to python/qemu/qapi/gen.py diff --git a/scripts/qapi/introspect.py b/python/qemu/qapi/introspect.py similarity index 100% rename from scripts/qapi/introspect.py rename to python/qemu/qapi/introspect.py diff --git a/scripts/qapi/main.py b/python/qemu/qapi/main.py similarity index 100% rename from scripts/qapi/main.py rename to python/qemu/qapi/main.py diff --git a/scripts/qapi/mypy.ini b/python/qemu/qapi/mypy.ini similarity index 100% rename from scripts/qapi/mypy.ini rename to python/qemu/qapi/mypy.ini diff --git a/scripts/qapi/parser.py b/python/qemu/qapi/parser.py similarity index 100% rename from scripts/qapi/parser.py rename to python/qemu/qapi/parser.py diff --git a/scripts/qapi/pylintrc b/python/qemu/qapi/pylintrc similarity index 100% rename from scripts/qapi/pylintrc rename to python/qemu/qapi/pylintrc diff --git a/scripts/qapi/schema.py b/python/qemu/qapi/schema.py similarity index 100% rename from scripts/qapi/schema.py rename to python/qemu/qapi/schema.py diff --git a/scripts/qapi/source.py b/python/qemu/qapi/source.py similarity index 100% rename from scripts/qapi/source.py rename to python/qemu/qapi/source.py diff --git a/scripts/qapi/types.py b/python/qemu/qapi/types.py similarity index 100% rename from scripts/qapi/types.py rename to python/qemu/qapi/types.py diff --git a/scripts/qapi/visit.py b/python/qemu/qapi/visit.py similarity index 100% rename from scripts/qapi/visit.py rename to python/qemu/qapi/visit.py diff --git a/python/setup.cfg b/python/setup.cfg index 58dba90f815..d1582f74ddd 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -28,6 +28,7 @@ packages =3D qemu.qmp qemu.machine qemu.utils + qemu.qapi =20 [options.package_data] * =3D py.typed diff --git a/scripts/qapi-gen.py b/scripts/qapi-gen.py index f3518d29a54..42912c91716 100644 --- a/scripts/qapi-gen.py +++ b/scripts/qapi-gen.py @@ -11,9 +11,11 @@ execution environment. """ =20 +import os import sys =20 -from qapi import main +sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'python')) +from qemu.qapi import main =20 if __name__ =3D=3D '__main__': sys.exit(main.main()) diff --git a/tests/qapi-schema/meson.build b/tests/qapi-schema/meson.build index 0f479d93170..080444d0cd4 100644 --- a/tests/qapi-schema/meson.build +++ b/tests/qapi-schema/meson.build @@ -1,5 +1,5 @@ test_env =3D environment() -test_env.set('PYTHONPATH', meson.project_source_root() / 'scripts') +test_env.set('PYTHONPATH', meson.project_source_root() / 'python') test_env.set('PYTHONIOENCODING', 'utf-8') =20 schemas =3D [ diff --git a/tests/qapi-schema/test-qapi.py b/tests/qapi-schema/test-qapi.py index 7e3f9f4aa1f..dcc0d949971 100755 --- a/tests/qapi-schema/test-qapi.py +++ b/tests/qapi-schema/test-qapi.py @@ -18,8 +18,8 @@ import sys from io import StringIO =20 -from qapi.error import QAPIError -from qapi.schema import QAPISchema, QAPISchemaVisitor +from qemu.qapi.error import QAPIError +from qemu.qapi.schema import QAPISchema, QAPISchemaVisitor =20 =20 class QAPISchemaTestVisitor(QAPISchemaVisitor): --=20 2.45.0 From nobody Sun Nov 24 11:02:49 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1724113462; cv=none; d=zohomail.com; s=zohoarc; b=lFRCeevporUpIYL6T5xcqHoh119CLm52AiOH2tP5Z8k6sTUXF6qyJnfk45YeXMFqRPKff4uCNcFBDsTh4CZhaknXIz6yghqmVZHemNdEyboYAoGcySbVWmmns8ALOC8DXoFpKmrliwuPCKBYoxGTCxDHIJ9nBqA6YYO4v+w3bTU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1724113462; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=djrLVOxNjhTkJaYMvjaJgjyI+LpTJmogtLtfxxjcqvM=; b=TxK12nSaZkqbPmUAy2jiD7YevDu1G+Szeyn5hYMXjr2SZAbcAbGQhO+wEX6K5PvlkN35Dtm0TQruPsMB25qYgqL6opuIofy2Nvhx/I+dG47pvmZDVBmCpRqdBMrJb4NLyCpLqgGn7fuZKvKn8LkWfQvY2BOFAlWsGXqs0H0bpOc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1724113462112285.0063734885621; Mon, 19 Aug 2024 17:24:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sgCfG-0007M6-UB; Mon, 19 Aug 2024 20:23:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgCf7-0006RI-Nq for qemu-devel@nongnu.org; Mon, 19 Aug 2024 20:23:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgCf6-0003vQ-49 for qemu-devel@nongnu.org; Mon, 19 Aug 2024 20:23:49 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-68-EGIJiM86MamjCYN6V2OjaQ-1; Mon, 19 Aug 2024 20:23:43 -0400 Received: from mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.17]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id AB6A01955D54; Tue, 20 Aug 2024 00:23:42 +0000 (UTC) Received: from scv.localdomain (unknown [10.22.8.20]) by mx-prod-int-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 880FA19560A3; Tue, 20 Aug 2024 00:23:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724113426; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=djrLVOxNjhTkJaYMvjaJgjyI+LpTJmogtLtfxxjcqvM=; b=HiZw/MLuvKbiylymC74TbYFrxD1xpQBFW/C+pih6LxKvjT8nFlkPFgrhDF8v9D3b6thslt KdpZXDFBX+SoVZa8d/npoZohQd85p9l4FuvB2C19EPp8Wj2SrKiwfVWVxOztVEg9sy0XTN Ut7Omy6z5vTFAuiXtccGjouuQ8kl4Oo= X-MC-Unique: EGIJiM86MamjCYN6V2OjaQ-1 From: John Snow To: qemu-devel@nongnu.org Cc: John Snow , Cleber Rosa , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Thomas Huth , Markus Armbruster , Peter Maydell , Beraldo Leal , Michael Roth , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 8/8] python/qapi: remove redundant linter configuration Date: Mon, 19 Aug 2024 20:23:17 -0400 Message-ID: <20240820002318.1380276-9-jsnow@redhat.com> In-Reply-To: <20240820002318.1380276-1-jsnow@redhat.com> References: <20240820002318.1380276-1-jsnow@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.17 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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.134, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1724113462589116600 Content-Type: text/plain; charset="utf-8" Now that the qemu.qapi module is checked by the standard python tests, we don't need separate configuration for it anymore. Signed-off-by: John Snow --- python/qemu/qapi/.flake8 | 3 -- python/qemu/qapi/.isort.cfg | 7 ----- python/qemu/qapi/mypy.ini | 4 --- python/qemu/qapi/pylintrc | 61 ------------------------------------- 4 files changed, 75 deletions(-) delete mode 100644 python/qemu/qapi/.flake8 delete mode 100644 python/qemu/qapi/.isort.cfg delete mode 100644 python/qemu/qapi/mypy.ini delete mode 100644 python/qemu/qapi/pylintrc diff --git a/python/qemu/qapi/.flake8 b/python/qemu/qapi/.flake8 deleted file mode 100644 index a873ff67309..00000000000 --- a/python/qemu/qapi/.flake8 +++ /dev/null @@ -1,3 +0,0 @@ -[flake8] -# Prefer pylint's bare-except checks to flake8's -extend-ignore =3D E722 diff --git a/python/qemu/qapi/.isort.cfg b/python/qemu/qapi/.isort.cfg deleted file mode 100644 index 643caa1fbd6..00000000000 --- a/python/qemu/qapi/.isort.cfg +++ /dev/null @@ -1,7 +0,0 @@ -[settings] -force_grid_wrap=3D4 -force_sort_within_sections=3DTrue -include_trailing_comma=3DTrue -line_length=3D72 -lines_after_imports=3D2 -multi_line_output=3D3 diff --git a/python/qemu/qapi/mypy.ini b/python/qemu/qapi/mypy.ini deleted file mode 100644 index 8109470a031..00000000000 --- a/python/qemu/qapi/mypy.ini +++ /dev/null @@ -1,4 +0,0 @@ -[mypy] -strict =3D True -disallow_untyped_calls =3D False -python_version =3D 3.8 diff --git a/python/qemu/qapi/pylintrc b/python/qemu/qapi/pylintrc deleted file mode 100644 index c028a1f9f51..00000000000 --- a/python/qemu/qapi/pylintrc +++ /dev/null @@ -1,61 +0,0 @@ -[MASTER] - -[MESSAGES CONTROL] - -# Disable the message, report, category or checker with the given id(s). Y= ou -# can either give multiple identifiers separated by comma (,) or put this -# option multiple times (only on the command line, not in the configuration -# file where it should appear only once). You can also use "--disable=3Dal= l" to -# disable everything first and then reenable specific checks. For example,= if -# you want to run only the similarities checker, you can use "--disable=3D= all -# --enable=3Dsimilarities". If you want to run only the classes checker, b= ut have -# no Warning level messages displayed, use "--disable=3Dall --enable=3Dcla= sses -# --disable=3DW". -disable=3Dconsider-using-f-string, - fixme, - missing-docstring, - too-many-arguments, - too-many-branches, - too-many-instance-attributes, - too-many-statements, - useless-option-value, - -[REPORTS] - -[REFACTORING] - -[MISCELLANEOUS] - -[LOGGING] - -[BASIC] - -# Good variable names regexes, separated by a comma. If names match any re= gex, -# they will always be accepted. -# -# Suppress complaints about short names. PEP-8 is cool with them, -# and so are we. -good-names-rgxs=3D^[_a-z][_a-z0-9]?$ - -[VARIABLES] - -[STRING] - -[SPELLING] - -[FORMAT] - -[SIMILARITIES] - -# Ignore import statements themselves when computing similarities. -ignore-imports=3Dyes - -[TYPECHECK] - -[CLASSES] - -[IMPORTS] - -[DESIGN] - -[EXCEPTIONS] --=20 2.45.0