{"id":2052219,"url":"http://patchwork.ozlabs.org/api/patches/2052219/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20250226102842.3721046-4-armbru@redhat.com/","project":{"id":14,"url":"http://patchwork.ozlabs.org/api/projects/14/?format=json","name":"QEMU Development","link_name":"qemu-devel","list_id":"qemu-devel.nongnu.org","list_email":"qemu-devel@nongnu.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20250226102842.3721046-4-armbru@redhat.com>","list_archive_url":null,"date":"2025-02-26T10:28:39","name":"[PULL,3/6] python: add qapi static analysis tests","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"acf75ffde42ca169ea0b9a321681aae0f93f43c0","submitter":{"id":2645,"url":"http://patchwork.ozlabs.org/api/people/2645/?format=json","name":"Markus Armbruster","email":"armbru@redhat.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/qemu-devel/patch/20250226102842.3721046-4-armbru@redhat.com/mbox/","series":[{"id":446100,"url":"http://patchwork.ozlabs.org/api/series/446100/?format=json","web_url":"http://patchwork.ozlabs.org/project/qemu-devel/list/?series=446100","date":"2025-02-26T10:28:36","name":"[PULL,1/6] qapi/char.json: minor doc rewording for `hub` device","version":1,"mbox":"http://patchwork.ozlabs.org/series/446100/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2052219/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2052219/checks/","tags":{},"related":[],"headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=hAHTdXep;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4Z2rM36kZsz1yCp\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 26 Feb 2025 21:29:49 +1100 (AEDT)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1tnEeu-0004FV-90; Wed, 26 Feb 2025 05:28:56 -0500","from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <armbru@redhat.com>) id 1tnEes-0004F6-Gg\n for qemu-devel@nongnu.org; Wed, 26 Feb 2025 05:28:54 -0500","from us-smtp-delivery-124.mimecast.com ([170.10.133.124])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <armbru@redhat.com>) id 1tnEep-0003ff-Mk\n for qemu-devel@nongnu.org; Wed, 26 Feb 2025 05:28:54 -0500","from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-612-Km1t_5SqNZSAEfAtrsqkHw-1; Wed,\n 26 Feb 2025 05:28:47 -0500","from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id 510E31800374\n for <qemu-devel@nongnu.org>; Wed, 26 Feb 2025 10:28:46 +0000 (UTC)","from blackfin.pond.sub.org (unknown [10.45.242.9])\n by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with\n ESMTPS\n id 0805719560AB\n for <qemu-devel@nongnu.org>; Wed, 26 Feb 2025 10:28:45 +0000 (UTC)","by blackfin.pond.sub.org (Postfix, from userid 1000)\n id 9768121E65E7; Wed, 26 Feb 2025 11:28:42 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1740565729;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=MedsTxUualw/qrNjp+MvIvUAwmLUCs7v+1mvzgKpQWk=;\n b=hAHTdXepQ3TB32TLuuj3wvTsa5euix6Q3TntqUofx3Ed/IrEb5TwDF7O83Hx/WNbPRIQjE\n kbEwKnU4TUbzrsOqSw5u9h+MvNJRK+dvIRy1yrZhC24dX5DLoEWP7Ynj2JjkwbTTd+NQvG\n mM17+tIPfLU5aKLZOfG12Ozmq/ohwVw=","X-MC-Unique":"Km1t_5SqNZSAEfAtrsqkHw-1","X-Mimecast-MFC-AGG-ID":"Km1t_5SqNZSAEfAtrsqkHw_1740565726","From":"Markus Armbruster <armbru@redhat.com>","To":"qemu-devel@nongnu.org","Cc":"stefanha@redhat.com,\n\tJohn Snow <jsnow@redhat.com>","Subject":"[PULL 3/6] python: add qapi static analysis tests","Date":"Wed, 26 Feb 2025 11:28:39 +0100","Message-ID":"<20250226102842.3721046-4-armbru@redhat.com>","In-Reply-To":"<20250226102842.3721046-1-armbru@redhat.com>","References":"<20250226102842.3721046-1-armbru@redhat.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-Scanned-By":"MIMEDefang 3.0 on 10.30.177.40","Received-SPF":"pass client-ip=170.10.133.124; envelope-from=armbru@redhat.com;\n helo=us-smtp-delivery-124.mimecast.com","X-Spam_score_int":"-24","X-Spam_score":"-2.5","X-Spam_bar":"--","X-Spam_report":"(-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.443,\n DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=0.001,\n RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001,\n RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,\n 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":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"},"content":"From: John Snow <jsnow@redhat.com>\n\nUpdate the python tests to also check qapi. No idea why I didn't do this\nbefore. I guess I was counting on moving it under python/ and then just\nforgot after that was NACKed. Oops, this turns out to be really easy.\n\nflake8, isort and mypy use the tool configuration from the existing\npython directory. pylint continues to use the special configuration\nlocated in scripts/qapi/ - that configuration is more permissive. If we\nwish to unify the two configurations, that's a separate series and a\ndiscussion for a later date.\n\nAs a result of this patch, one would be able to run any of the following\ntests locally from the qemu.git/python directory and have it cover the\nscripts/qapi/ module as well. All of the following options run the\npython tests, static analysis tests, and linter checks; but with\ndifferent combinations of dependencies and interpreters.\n\n- \"make check-minreqs\" Run tests specifically under our oldest supported\n  Python and our oldest supported dependencies. This is the test that\n  runs on GitLab as \"check-python-minreqs\". This helps ensure we do not\n  regress support on older platforms accidentally.\n\n- \"make check-tox\" Runs the tests under the newest supported\n  dependencies, but under each supported version of Python in turn. At\n  time of writing, this is Python 3.8 to 3.13 inclusive. This test helps\n  catch bleeding-edge problems before they become problems for developer\n  workstations. This is the GitLab test \"check-python-tox\" and is an\n  optionally run, may-fail test due to the unpredictable nature of new\n  dependencies being released into the ecosystem that may cause\n  regressions.\n\n- \"make check-dev\" Runs the tests under the newest supported\n  dependencies using whatever version of Python the user happens to have\n  installed. This is a quick convenience check that does not map to any\n  particular GitLab test.\n\n(Note! check-dev may be busted on Fedora 41 and bleeding edge versions\nof setuptools. That's unrelated to this patch and I'll address it\nseparately and soon. Thank you for your patience, --mgmt)\n\nSigned-off-by: John Snow <jsnow@redhat.com>\nMessage-ID: <20250224033741.222749-3-jsnow@redhat.com>\nAcked-by: Markus Armbruster <armbru@redhat.com>\nSigned-off-by: Markus Armbruster <armbru@redhat.com>\n---\n python/tests/qapi-flake8.sh | 2 ++\n python/tests/qapi-isort.sh  | 2 ++\n python/tests/qapi-mypy.sh   | 2 ++\n python/tests/qapi-pylint.sh | 4 ++++\n 4 files changed, 10 insertions(+)\n create mode 100755 python/tests/qapi-flake8.sh\n create mode 100755 python/tests/qapi-isort.sh\n create mode 100755 python/tests/qapi-mypy.sh\n create mode 100755 python/tests/qapi-pylint.sh","diff":"diff --git a/python/tests/qapi-flake8.sh b/python/tests/qapi-flake8.sh\nnew file mode 100755\nindex 0000000000..51916a9019\n--- /dev/null\n+++ b/python/tests/qapi-flake8.sh\n@@ -0,0 +1,2 @@\n+#!/bin/sh -e\n+python3 -m flake8 ../scripts/qapi/\ndiff --git a/python/tests/qapi-isort.sh b/python/tests/qapi-isort.sh\nnew file mode 100755\nindex 0000000000..60ed5eeb34\n--- /dev/null\n+++ b/python/tests/qapi-isort.sh\n@@ -0,0 +1,2 @@\n+#!/bin/sh -e\n+python3 -m isort --sp . -c ../scripts/qapi/\ndiff --git a/python/tests/qapi-mypy.sh b/python/tests/qapi-mypy.sh\nnew file mode 100755\nindex 0000000000..377b29b873\n--- /dev/null\n+++ b/python/tests/qapi-mypy.sh\n@@ -0,0 +1,2 @@\n+#!/bin/sh -e\n+python3 -m mypy ../scripts/qapi\ndiff --git a/python/tests/qapi-pylint.sh b/python/tests/qapi-pylint.sh\nnew file mode 100755\nindex 0000000000..d4869578e5\n--- /dev/null\n+++ b/python/tests/qapi-pylint.sh\n@@ -0,0 +1,4 @@\n+#!/bin/sh -e\n+SETUPTOOLS_USE_DISTUTILS=stdlib python3 -m pylint \\\n+                                --rcfile=../scripts/qapi/pylintrc \\\n+                                ../scripts/qapi/\n","prefixes":["PULL","3/6"]}