From nobody Thu Nov 14 07:08:09 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 ARC-Seal: i=1; a=rsa-sha256; t=1622150560; cv=none; d=zohomail.com; s=zohoarc; b=nTH3jf4aKvvwp/8X0QgPr83watvmHq6pwuRuiK+y5auhIhYkmP0cz7ONGoyc4d3KjKrwsiZ1jTHun5503CT3qhCaAKGh8x7KEp3SZD5jtxllnlGwC+k5x3ThSCg5o1WtZYsKYGBoAD5mnZKysHexT8K5cvD2cjuVAFltO3Sro8M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622150560; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZhCNTpzcHcwho5kIg8KV9BdUVKKRcFUxrM35LYxVhJE=; b=OkJEfxtETKunNt0KwOoYIv1iMYfAE3n1LRdKuzCccDxEr0zr8fxAetWpk9SDl6X3tXm/vWT1eOZWEF3XLa9y3mcnN0M1SkYZb5G5aQBjmSLgkM5h1gIC+tDfSWZY2WQf0z4SRQwRm4kxIE9RHHVb86MboxQ1t8EshrHtEstoyU8= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 162215056039074.15418286273177; Thu, 27 May 2021 14:22:40 -0700 (PDT) Received: from localhost ([::1]:51156 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNSh-0001hF-C4 for importer@patchew.org; Thu, 27 May 2021 17:22:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47504) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNNx-0001IQ-MB for qemu-devel@nongnu.org; Thu, 27 May 2021 17:17:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:53755) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNNm-00086Y-5f for qemu-devel@nongnu.org; Thu, 27 May 2021 17:17:45 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-530-wCmXykl7Md-7pHwtI8mOkw-1; Thu, 27 May 2021 17:17:30 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AC62D801B20; Thu, 27 May 2021 21:17:29 +0000 (UTC) Received: from scv.redhat.com (ovpn-116-137.rdu2.redhat.com [10.10.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id D339A5D9C6; Thu, 27 May 2021 21:17:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622150252; 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=ZhCNTpzcHcwho5kIg8KV9BdUVKKRcFUxrM35LYxVhJE=; b=JFEjlAnsSHw5sHZS24f6weH2qbk78hS6Gg+EKN+lTZpMDxlb8kZHdFBOwJRDtGtXvy2AHG HAwxL0oJlwf2UK22+YqWA1x0ZKdGYiz4IKOEJ3rN2KVVgTz0nWCR6hoQikR7+mpftPa7fo tb0dr1OT/uM5hnoMHKV3EIcc4ZbfS40= X-MC-Unique: wCmXykl7Md-7pHwtI8mOkw-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v8 01/31] python/console_socket: avoid one-letter variable Date: Thu, 27 May 2021 17:16:45 -0400 Message-Id: <20210527211715.394144-2-jsnow@redhat.com> In-Reply-To: <20210527211715.394144-1-jsnow@redhat.com> References: <20210527211715.394144-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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-Type: text/plain; charset="utf-8" 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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, 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_H4=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Fixes pylint warnings. Signed-off-by: John Snow Reviewed-by: Cleber Rosa Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20210517184808.3562549-2-jsnow@redhat.com Signed-off-by: John Snow --- python/qemu/console_socket.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python/qemu/console_socket.py b/python/qemu/console_socket.py index ac21130e446..87237bebef7 100644 --- a/python/qemu/console_socket.py +++ b/python/qemu/console_socket.py @@ -46,11 +46,11 @@ def __init__(self, address: str, file: Optional[str] = =3D None, self._drain_thread =3D self._thread_start() =20 def __repr__(self) -> str: - s =3D super().__repr__() - s =3D s.rstrip(">") - s =3D "%s, logfile=3D%s, drain_thread=3D%s>" % (s, self._logfile, - self._drain_thread) - return s + tmp =3D super().__repr__() + tmp =3D tmp.rstrip(">") + tmp =3D "%s, logfile=3D%s, drain_thread=3D%s>" % (tmp, self._logf= ile, + self._drain_thread) + return tmp =20 def _drain_fn(self) -> None: """Drains the socket and runs while the socket is open.""" --=20 2.31.1 From nobody Thu Nov 14 07:08:09 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 ARC-Seal: i=1; a=rsa-sha256; t=1622150414; cv=none; d=zohomail.com; s=zohoarc; b=KW8r3Tct++SQuMEmulvBmQB2FvFFKagF8QW0bxBu6LSXSvUDtUDEKHSeuIdA/1+OIFJ+wvCvWImbMnxcJV571JcoiJzy4qoIkjWrsVX0+HltjSZdwol1nKUUs3bMjUCmbY5h7r35uzNHsJ5Apq3LDkJ2MaJulGd/XGHZ/dhec8M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622150414; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=qifxhGbIIW3jJYdwCvPlOZZ/iEIUOfnWfM2Zp+tBOx8=; b=ePI4KhSd4U1sV5oDa2ZI3kTXPXZ2aDdtM+mA9hlzBR9YMkZ63mz6cqe6NTQneZLW9qXXhOyUMIcLyBbaQ/gEUZGwVxQK7Xhp+KcRT2inLCJSLWFOTqr2cEZycNQWZJV1nbDyiMU5Z1mDQslpcSj3OSkGEH33dkbdluhjPK0aQEA= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622150414840957.7226194031651; Thu, 27 May 2021 14:20:14 -0700 (PDT) Received: from localhost ([::1]:42604 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNQL-0004GR-Jf for importer@patchew.org; Thu, 27 May 2021 17:20:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47494) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNNv-0001Gq-MV for qemu-devel@nongnu.org; Thu, 27 May 2021 17:17:43 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:53514) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNNp-00088I-Uj for qemu-devel@nongnu.org; Thu, 27 May 2021 17:17:43 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-391-IucfGiokOe6StbxDO8qLmQ-1; Thu, 27 May 2021 17:17:34 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 25693801B14; Thu, 27 May 2021 21:17:33 +0000 (UTC) Received: from scv.redhat.com (ovpn-116-137.rdu2.redhat.com [10.10.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 256F75D9C6; Thu, 27 May 2021 21:17:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622150257; 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=qifxhGbIIW3jJYdwCvPlOZZ/iEIUOfnWfM2Zp+tBOx8=; b=RkZDF6fnFSBDyfwTe8xe0JT8OCrOQR/gdf2IyxOpfyObm0cMT102ekcgRxAXZ1JHLFr8S8 Pc+5uHua/j6yz9h/EMunkiDaVNhjHSAwtSUutM0jh4w3fjTf5HWbTSxFddNRkw07FcVTcd xSu/KVzzD0uMtdgg9N+ZKBWMVsQ032k= X-MC-Unique: IucfGiokOe6StbxDO8qLmQ-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v8 02/31] python/machine: use subprocess.DEVNULL instead of open(os.path.devnull) Date: Thu, 27 May 2021 17:16:46 -0400 Message-Id: <20210527211715.394144-3-jsnow@redhat.com> In-Reply-To: <20210527211715.394144-1-jsnow@redhat.com> References: <20210527211715.394144-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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-Type: text/plain; charset="utf-8" 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=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, 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_H4=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) One less file resource to manage, and it helps quiet some pylint >=3D 2.8.0 warnings about not using a with-context manager for the open call. Signed-off-by: John Snow Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Cleber Rosa Message-id: 20210517184808.3562549-3-jsnow@redhat.com Signed-off-by: John Snow --- python/qemu/machine.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/python/qemu/machine.py b/python/qemu/machine.py index b379fcbe726..5b87e9ce024 100644 --- a/python/qemu/machine.py +++ b/python/qemu/machine.py @@ -223,9 +223,8 @@ def send_fd_scm(self, fd: Optional[int] =3D None, assert fd is not None fd_param.append(str(fd)) =20 - devnull =3D open(os.path.devnull, 'rb') proc =3D subprocess.Popen( - fd_param, stdin=3Ddevnull, stdout=3Dsubprocess.PIPE, + fd_param, stdin=3Dsubprocess.DEVNULL, stdout=3Dsubprocess.PIPE, stderr=3Dsubprocess.STDOUT, close_fds=3DFalse ) output =3D proc.communicate()[0] @@ -391,7 +390,6 @@ def _launch(self) -> None: """ Launch the VM and establish a QMP connection """ - devnull =3D open(os.path.devnull, 'rb') self._pre_launch() self._qemu_full_args =3D tuple( chain(self._wrapper, @@ -401,7 +399,7 @@ def _launch(self) -> None: ) LOG.debug('VM launch command: %r', ' '.join(self._qemu_full_args)) self._popen =3D subprocess.Popen(self._qemu_full_args, - stdin=3Ddevnull, + stdin=3Dsubprocess.DEVNULL, stdout=3Dself._qemu_log_file, stderr=3Dsubprocess.STDOUT, shell=3DFalse, --=20 2.31.1 From nobody Thu Nov 14 07:08:09 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 ARC-Seal: i=1; a=rsa-sha256; t=1622150420; cv=none; d=zohomail.com; s=zohoarc; b=K/jg27qk47b6M687qMkQM7qfzy9n0HgVGaKG6lXRojNNPBb3fll9otJn+fc62GmH4v+t7vRZJxXYJnJMgsvwocW6ruslRrEDIkTXYlagrnyYPmvn//HwX4Ns4oRDTLIeLWfbNQ8BSXT6hiQR5FWEiiuP86Oa+0hGYl+/1W+65nY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622150420; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=AeqWqqe4byyu5sN2IyiJ1hoR9egPsJjOm1lcyJLaQbI=; b=mh4BFxssSTH4VtoM+xXaydSNNIZjYsv0Ei9qykGp/+udI4OdhE4SclL2MKEx28gzFTtw8ZqcJqIzr8P24XW6JdScg6vJBm05zBch8pme67aSVjLCMsQU256cID6tI3mVmOX7z3Mh5vaqL5RW4rFDNVKH0lioXJI8ncTW3zHLxRI= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622150420793236.15739987641507; Thu, 27 May 2021 14:20:20 -0700 (PDT) Received: from localhost ([::1]:43018 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNQR-0004Y4-NZ for importer@patchew.org; Thu, 27 May 2021 17:20:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47540) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNO1-0001KY-Nt for qemu-devel@nongnu.org; Thu, 27 May 2021 17:17:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:31086) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNNr-000897-Uc for qemu-devel@nongnu.org; Thu, 27 May 2021 17:17:48 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-501-yasT0yz4PC2JiBMts7QD4w-1; Thu, 27 May 2021 17:17:37 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 356388030CF; Thu, 27 May 2021 21:17:36 +0000 (UTC) Received: from scv.redhat.com (ovpn-116-137.rdu2.redhat.com [10.10.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 67F4D5D9C6; Thu, 27 May 2021 21:17:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622150259; 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=AeqWqqe4byyu5sN2IyiJ1hoR9egPsJjOm1lcyJLaQbI=; b=DHd8gZZhIQxtuqb/qIgmcpKxWGMA41DY04ww3lReojXx3r59UDliqNkMSplRXev7yVhjRA GR0BI49d/iAgNzzP9QSRD2SlLHA1imONYeuDOfIrDC20mrOiM/r2wcfJAr008nj6OjwmEe InKdybBv/aMfGBxGURqHjqNJBAI8IZI= X-MC-Unique: yasT0yz4PC2JiBMts7QD4w-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v8 03/31] python/machine: use subprocess.run instead of subprocess.Popen Date: Thu, 27 May 2021 17:16:47 -0400 Message-Id: <20210527211715.394144-4-jsnow@redhat.com> In-Reply-To: <20210527211715.394144-1-jsnow@redhat.com> References: <20210527211715.394144-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, 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_H4=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" use run() instead of Popen() -- to assert to pylint that we are not forgetting to close a long-running program. Signed-off-by: John Snow Reviewed-by: Cleber Rosa Tested-by: Cleber Rosa Message-id: 20210517184808.3562549-4-jsnow@redhat.com Signed-off-by: John Snow --- python/qemu/machine.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/python/qemu/machine.py b/python/qemu/machine.py index 5b87e9ce024..04e005f3811 100644 --- a/python/qemu/machine.py +++ b/python/qemu/machine.py @@ -223,13 +223,16 @@ def send_fd_scm(self, fd: Optional[int] =3D None, assert fd is not None fd_param.append(str(fd)) =20 - proc =3D subprocess.Popen( - fd_param, stdin=3Dsubprocess.DEVNULL, stdout=3Dsubprocess.PIPE, - stderr=3Dsubprocess.STDOUT, close_fds=3DFalse + proc =3D subprocess.run( + fd_param, + stdin=3Dsubprocess.DEVNULL, + stdout=3Dsubprocess.PIPE, + stderr=3Dsubprocess.STDOUT, + check=3DFalse, + close_fds=3DFalse, ) - output =3D proc.communicate()[0] - if output: - LOG.debug(output) + if proc.stdout: + LOG.debug(proc.stdout) =20 return proc.returncode =20 --=20 2.31.1 From nobody Thu Nov 14 07:08:09 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 ARC-Seal: i=1; a=rsa-sha256; t=1622150682; cv=none; d=zohomail.com; s=zohoarc; b=nU0cnTZ/s6CU+5amffbrUsi9wrcfZwmn9GaVL4TgqhU+RXnQofaFUgtKgKpr0Nk09U7WMU/0ox1J2F/0U1TkBOq5LqR4aZJVQN41tjFjrrHLuNS7+oPhvUPPd5tYIGom2tpDMhkkl2cYKqgbpMO6daZUzzb9i1MWhCxbWqLjjiQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622150682; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=uEB8ttZqtDFWX9gWuSnDQ9aVec3brBFL5KZhZggHdig=; b=PYrBlfEJlEU/Y//ZK8y2geTnhga72DI3HhoUyJ8hsSY0LT7DqXap9n2DRNMJ/MkWJFSGKBgMeV+5lqlMPImmyS9dqXRBAyIXnBbYt8E8YQn6XHjdnBVEXxPA/CrYfE2RfvWq4EZ5njohJt15RglSpPLFa8VW18RMRQ/vcckD0I0= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622150682693709.3557286404601; Thu, 27 May 2021 14:24:42 -0700 (PDT) Received: from localhost ([::1]:59718 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNUf-0007OP-M9 for importer@patchew.org; Thu, 27 May 2021 17:24:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47576) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNO6-0001QU-2a for qemu-devel@nongnu.org; Thu, 27 May 2021 17:17:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:57669) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNO3-0008Dm-E0 for qemu-devel@nongnu.org; Thu, 27 May 2021 17:17:53 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-276-x36VPYd_M_eIgMSEh7reTg-1; Thu, 27 May 2021 17:17:48 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E0437107ACED; Thu, 27 May 2021 21:17:47 +0000 (UTC) Received: from scv.redhat.com (ovpn-116-137.rdu2.redhat.com [10.10.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 976925D9C6; Thu, 27 May 2021 21:17:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622150270; 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=uEB8ttZqtDFWX9gWuSnDQ9aVec3brBFL5KZhZggHdig=; b=MV0SW9QH+yobhIbhXbaUnLmH+aB7U1cG1sif8pySu2I6RPalP17omCfI96ieNL/OXo21Sd AxegukmTzQ2D8DrvHnXz+7yNDe0DDMPgfDCYioPlQ9XdYRNaBXq2o7h117ZVU+6kIsQmVI ctgU/QwV29pLUS8VWQo59pOlye0ku+s= X-MC-Unique: x36VPYd_M_eIgMSEh7reTg-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v8 04/31] python/console_socket: Add a pylint ignore Date: Thu, 27 May 2021 17:16:48 -0400 Message-Id: <20210527211715.394144-5-jsnow@redhat.com> In-Reply-To: <20210527211715.394144-1-jsnow@redhat.com> References: <20210527211715.394144-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, 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_H4=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" We manage cleaning up this resource ourselves. Pylint should shush. Signed-off-by: John Snow Reviewed-by: Cleber Rosa Message-id: 20210517184808.3562549-5-jsnow@redhat.com Signed-off-by: John Snow --- python/qemu/console_socket.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/qemu/console_socket.py b/python/qemu/console_socket.py index 87237bebef7..8c4ff598ad7 100644 --- a/python/qemu/console_socket.py +++ b/python/qemu/console_socket.py @@ -39,6 +39,7 @@ def __init__(self, address: str, file: Optional[str] =3D = None, self.connect(address) self._logfile =3D None if file: + # pylint: disable=3Dconsider-using-with self._logfile =3D open(file, "bw") self._open =3D True self._drain_thread =3D None --=20 2.31.1 From nobody Thu Nov 14 07:08:09 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 ARC-Seal: i=1; a=rsa-sha256; t=1622150828; cv=none; d=zohomail.com; s=zohoarc; b=Q/EylSBHipBSWZbcjB3cLMlAJZZ+UNBOkCrB9r3LkGr3qwm1aADvVYFUfBHYbsv/JBbvegOsJ9wd2hITWN6SFn+0ruObyCTu+XIZlvFKzVIviqaRcuIFJ2NPfdJpQL5U7gKbA8A+qUnk9hFxq66qxcMAc49ya264ZcN7u2fzYmI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622150828; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=WwrTT2qkQZciJ9bA6Dbm8rGrg7RswV824H1jgqdNc+w=; b=Dau2qVTsn+rDQKUvferArwr09E8BK6lzYRA/gPoM7qb5beWNK7FwVMkhaNR/TaPb4Sgs6dYwagbERhYKoE0/jRCd+DaJYbw0vjeYw7r2VcPJLCfqPA6JrWWW6Zm0cX4gxyrBm2scY5zahsI+23UBLHcZShAoIggoQ/b4sB9UmBQ= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622150828238425.6969520442059; Thu, 27 May 2021 14:27:08 -0700 (PDT) Received: from localhost ([::1]:40500 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNX1-0005AY-8E for importer@patchew.org; Thu, 27 May 2021 17:27:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47640) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNOA-0001mb-VE for qemu-devel@nongnu.org; Thu, 27 May 2021 17:17:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:40156) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNO7-0008Gl-NR for qemu-devel@nongnu.org; Thu, 27 May 2021 17:17:58 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-484-ZbK6HmUjOBeCJ4Prx1AlbQ-1; Thu, 27 May 2021 17:17:53 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 282E88042AD; Thu, 27 May 2021 21:17:52 +0000 (UTC) Received: from scv.redhat.com (ovpn-116-137.rdu2.redhat.com [10.10.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 585685D9C6; Thu, 27 May 2021 21:17:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622150275; 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=WwrTT2qkQZciJ9bA6Dbm8rGrg7RswV824H1jgqdNc+w=; b=dXloRWhtlkl3WUXT723l2ulLf1Prz/FWTBrtCE6pjj95keiWm0aTPQFmSIVyVAkQBIvEdn EwnvvzpO736Gj9qoWxpl/o9LI/Ff50LomiDN+CVHqa+u36siOkNV5EAr6+nIyVvCrRvka5 7/WT9z9brnukzc1QLdofJGGlmRInmD0= X-MC-Unique: ZbK6HmUjOBeCJ4Prx1AlbQ-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v8 05/31] python/machine: Disable pylint warning for open() in _pre_launch Date: Thu, 27 May 2021 17:16:49 -0400 Message-Id: <20210527211715.394144-6-jsnow@redhat.com> In-Reply-To: <20210527211715.394144-1-jsnow@redhat.com> References: <20210527211715.394144-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, 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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Shift the open() call later so that the pylint pragma applies *only* to that one open() call. Add a note that suggests why this is safe: the resource is unconditionally cleaned up in _post_shutdown(). _post_shutdown is called after failed launches (see launch()), and unconditionally after every call to shutdown(), and therefore also on __exit__. Signed-off-by: John Snow Reviewed-by: Wainer dos Santos Moschetta Reviewed-by: Cleber Rosa Message-id: 20210517184808.3562549-6-jsnow@redhat.com Signed-off-by: John Snow --- python/qemu/machine.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python/qemu/machine.py b/python/qemu/machine.py index 04e005f3811..c66bc6a9c69 100644 --- a/python/qemu/machine.py +++ b/python/qemu/machine.py @@ -306,7 +306,6 @@ def _base_args(self) -> List[str]: =20 def _pre_launch(self) -> None: self._qemu_log_path =3D os.path.join(self.temp_dir, self._name + "= .log") - self._qemu_log_file =3D open(self._qemu_log_path, 'wb') =20 if self._console_set: self._remove_files.append(self._console_address) @@ -321,6 +320,11 @@ def _pre_launch(self) -> None: nickname=3Dself._name ) =20 + # NOTE: Make sure any opened resources are *definitely* freed in + # _post_shutdown()! + # pylint: disable=3Dconsider-using-with + self._qemu_log_file =3D open(self._qemu_log_path, 'wb') + def _post_launch(self) -> None: if self._qmp_connection: self._qmp.accept() --=20 2.31.1 From nobody Thu Nov 14 07:08:09 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 ARC-Seal: i=1; a=rsa-sha256; t=1622150576; cv=none; d=zohomail.com; s=zohoarc; b=C1bVVBVmqpgDDyJ5SA6ONX2pbqLw/87EGhjMMJP3FOw+bnCGggXidZrSaK9/LlZMNia7jsE7Sw8XcoQ8WxF0MhWyz5GnmPq+S7XrBlpjtU/+h+BpbeMqFvm3UOQ2tnRHBdrdltqMexwc26GTl50ZgnyJK6LG4VDAR4wo6dZmGm4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622150576; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yA4CF5Ey/D7VFRocqXfTbjfx8UMyvTMtS1LJPfjlxEM=; b=fjj9pGGUUecx9POyIZT7KRw5cuXkFiUhAh2ntNs/uC5C92y9U3XkM64b3Mruwb2wrdd/XarOOuCJSa5obvJ/adX5mWGS5HIPVedSUbJS/mmICcx8F2No0Wmo9mbsQBgVCp0uZa9BED1hCn8T0ZoEVuzGi9UqZdcI0lEljIDsPvU= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 162215057616989.1714707537011; Thu, 27 May 2021 14:22:56 -0700 (PDT) Received: from localhost ([::1]:52626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNSw-0002ei-3X for importer@patchew.org; Thu, 27 May 2021 17:22:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47664) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNOE-0001zi-DI for qemu-devel@nongnu.org; Thu, 27 May 2021 17:18:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:50193) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNOB-0008Ki-S1 for qemu-devel@nongnu.org; Thu, 27 May 2021 17:18:02 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-557-KvAUVG2IMz-lz44iUdEOcg-1; Thu, 27 May 2021 17:17:57 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 35519800D55; Thu, 27 May 2021 21:17:56 +0000 (UTC) Received: from scv.redhat.com (ovpn-116-137.rdu2.redhat.com [10.10.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6ED165D9C6; Thu, 27 May 2021 21:17:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622150279; 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=yA4CF5Ey/D7VFRocqXfTbjfx8UMyvTMtS1LJPfjlxEM=; b=QtwZ7reRVj6a0ucSE2g+QV83ZFo5s4EHzWTnyLYf5jdAro/tpa9NLZeTPVvPteCv81UrRi KhYc+9f3Jxx25WaCGoes4OeSaEr9D6HsyOSa4c/xuZKLR7k1eQTaIbFUOM3Tlx6TfIL5Rc X+NRON5KpkqyIHLa9rEmuuiyo8yhT0U= X-MC-Unique: KvAUVG2IMz-lz44iUdEOcg-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v8 06/31] python/machine: disable warning for Popen in _launch() Date: Thu, 27 May 2021 17:16:50 -0400 Message-Id: <20210527211715.394144-7-jsnow@redhat.com> In-Reply-To: <20210527211715.394144-1-jsnow@redhat.com> References: <20210527211715.394144-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, 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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" We handle this resource rather meticulously in shutdown/kill/wait/__exit__ et al, through the laborious mechanisms in _do_shutdown(). Quiet this pylint warning here. Signed-off-by: John Snow Reviewed-by: Cleber Rosa Message-id: 20210517184808.3562549-7-jsnow@redhat.com Signed-off-by: John Snow --- python/qemu/machine.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/qemu/machine.py b/python/qemu/machine.py index c66bc6a9c69..5d72c4ca369 100644 --- a/python/qemu/machine.py +++ b/python/qemu/machine.py @@ -405,6 +405,9 @@ def _launch(self) -> None: self._args) ) LOG.debug('VM launch command: %r', ' '.join(self._qemu_full_args)) + + # Cleaning up of this subprocess is guaranteed by _do_shutdown. + # pylint: disable=3Dconsider-using-with self._popen =3D subprocess.Popen(self._qemu_full_args, stdin=3Dsubprocess.DEVNULL, stdout=3Dself._qemu_log_file, --=20 2.31.1 From nobody Thu Nov 14 07:08:09 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 ARC-Seal: i=1; a=rsa-sha256; t=1622150696; cv=none; d=zohomail.com; s=zohoarc; b=h94P57RZZL2XBtfHm9jaF4tDpVgVRx+WrTOsyuToOW52SmdxLZsMlwFS6FzLyYhKWdK8Xb8HFcZIfhSaMaERP60BvyZr3T9R0NjPmMUf4CvW5XS4fQEuOeBbyAzHEoF7zwrtYk9u+7pIRjBriICsxnoV9tmUc9//QA+Drth1YHU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622150696; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CSIdbHXvqlutGHkdUqfQayDVD76DO1g1kmXlRv8cfy4=; b=gwame7vsUrxWs+nAUuyvNL2i1cyrMmfbJO/JzlAh1t4Df+JKbA7e8kzPO70EHpTdLeGPpZtoXZR+UnuyTS4My8LrVmC9ij/m1JCAZzRmY0q6w9hQ0k1n6W8TKApynlEDPvrKEDRBlWMbTaYRHgyU5guNv9jVH082njRT1Wi/1e8= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622150696242944.2574640795663; Thu, 27 May 2021 14:24:56 -0700 (PDT) Received: from localhost ([::1]:32954 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNUt-0008NJ-5o for importer@patchew.org; Thu, 27 May 2021 17:24:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47688) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNOL-0002P5-9S for qemu-devel@nongnu.org; Thu, 27 May 2021 17:18:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:36303) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNOJ-0008PS-PN for qemu-devel@nongnu.org; Thu, 27 May 2021 17:18:09 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-357-uShbmYw7Odab1kGeMCy5Dw-1; Thu, 27 May 2021 17:18:04 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B6FF6801B13; Thu, 27 May 2021 21:18:02 +0000 (UTC) Received: from scv.redhat.com (ovpn-116-137.rdu2.redhat.com [10.10.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 655B85D9C6; Thu, 27 May 2021 21:17:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622150287; 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=CSIdbHXvqlutGHkdUqfQayDVD76DO1g1kmXlRv8cfy4=; b=iDctfRHW85KAROuzjkJxQJNDCssR6TQ2Y6Rtq4SLLCOi1QIpHDh49ly35lZvtDA5WpcJ/t UJWG8ekxKG9gb+wUzFtnLbQLyZB4qAdDw+mY1SYZvLGgE/E9HH85gO/QnXbhb/r+ughsAE 7UJu2q4vqZ+FlGmQ8hXedgT7hEqeUlo= X-MC-Unique: uShbmYw7Odab1kGeMCy5Dw-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v8 07/31] python/machine: Trim line length to below 80 chars Date: Thu, 27 May 2021 17:16:51 -0400 Message-Id: <20210527211715.394144-8-jsnow@redhat.com> In-Reply-To: <20210527211715.394144-1-jsnow@redhat.com> References: <20210527211715.394144-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, 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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Vladimir Sementsov-Ogievskiy , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" One more little delinting fix that snuck in. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Cleber Rosa --- python/qemu/machine.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/qemu/machine.py b/python/qemu/machine.py index 5d72c4ca369..a8837b36e47 100644 --- a/python/qemu/machine.py +++ b/python/qemu/machine.py @@ -97,7 +97,7 @@ def __init__(self, @param args: list of extra arguments @param wrapper: list of arguments used as prefix to qemu binary @param name: prefix for socket and log file names (default: qemu-P= ID) - @param base_temp_dir: default location where temporary files are c= reated + @param base_temp_dir: default location where temp files are created @param monitor_address: address for QMP monitor @param socket_scm_helper: helper program, required for send_fd_scm= () @param sock_dir: where to create socket (defaults to base_temp_dir) --=20 2.31.1 From nobody Thu Nov 14 07:08:09 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 ARC-Seal: i=1; a=rsa-sha256; t=1622150572; cv=none; d=zohomail.com; s=zohoarc; b=n+9YdNVoAo9pMBeO3uYMT11x2o24i31Z3CuocdPtvAbcXZRa+eSCJDAMByXlbEgqj8TqxVUECDUKSr+Fsi7LlmmVGqjsgWj/FY+vywWDy80+A07WzVH+g+/1ENCZ8CGSsGZ0w09SXSSxma4to+5fAWnQWnfJMPNMlP93xv6bTuI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622150572; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=EvOKHXyoUr7OZgodpzb8NbOcW0arAD4Ud+p/Sg2lgyM=; b=m0CNHn9iLRD6Rpa6fzhA29R9ni94+vhHJb45w1umWzwnKgkgEUMyvljhPEa9RDc78GW4SlfuHzmt0lCcbK1d4oHagOuhESH4KB+f8xziDQz2F+7Fo/G6W4iaY1O+5Ksbae/+i+h7jsFwEaWkQiuT4Mr+XE8qbcYzrh+v4D9dlBk= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622150572570947.8480023400552; Thu, 27 May 2021 14:22:52 -0700 (PDT) Received: from localhost ([::1]:52348 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNSt-0002Tn-EB for importer@patchew.org; Thu, 27 May 2021 17:22:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47718) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNOT-0002jj-Tv for qemu-devel@nongnu.org; Thu, 27 May 2021 17:18:17 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:56156) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNOR-0008TV-1A for qemu-devel@nongnu.org; Thu, 27 May 2021 17:18:17 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-353-sqVP6S-gOM2fXKXSgkWYLA-1; Thu, 27 May 2021 17:18:12 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CF621800D55; Thu, 27 May 2021 21:18:09 +0000 (UTC) Received: from scv.redhat.com (ovpn-116-137.rdu2.redhat.com [10.10.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 23D815D9C6; Thu, 27 May 2021 21:18:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622150293; 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=EvOKHXyoUr7OZgodpzb8NbOcW0arAD4Ud+p/Sg2lgyM=; b=PNPZgelqbMbScsA9BgTJgEItq2/58a6FofDI2VE5yK3RQpBZyjcj7n2h/fraDMfcY+M//X 9+36JwlKNAobS72AooHR9PUiCKByrrM9by7ErrJluEHDQQHJb69LGII5xneP0yLl4u98mu d51x7xULEnFUXI1lMpWdXjnJJw+Nz7s= X-MC-Unique: sqVP6S-gOM2fXKXSgkWYLA-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v8 08/31] iotests/297: add --namespace-packages to mypy arguments Date: Thu, 27 May 2021 17:16:52 -0400 Message-Id: <20210527211715.394144-9-jsnow@redhat.com> In-Reply-To: <20210527211715.394144-1-jsnow@redhat.com> References: <20210527211715.394144-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, 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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" mypy is kind of weird about how it handles imports. For legacy reasons, it won't load PEP 420 namespaces, because of logic implemented prior to that becoming a standard. So, if you plan on using any, you have to pass --namespace-packages. Alright, fine. Signed-off-by: John Snow Reviewed-by: Cleber Rosa --- tests/qemu-iotests/297 | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qemu-iotests/297 b/tests/qemu-iotests/297 index a37910b42d9..433b7323368 100755 --- a/tests/qemu-iotests/297 +++ b/tests/qemu-iotests/297 @@ -95,6 +95,7 @@ def run_linters(): '--warn-redundant-casts', '--warn-unused-ignores', '--no-implicit-reexport', + '--namespace-packages', filename), env=3Denv, check=3DFalse, --=20 2.31.1 From nobody Thu Nov 14 07:08:09 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 ARC-Seal: i=1; a=rsa-sha256; t=1622150849; cv=none; d=zohomail.com; s=zohoarc; b=AiDgvZryP+ZS9hPfXOVxh1vw9ExspMUe2uh6ON84LYZ06sLT8/pzpNWr9cms0EKe53XuN4uyiCB+IYvTA4+EY8DLN4vGPfXD8J68GfMeLjpRHv+6r4AEMVuTQqzRX1gDwlp1rpzlqZy8pxB22kO7RuZ5UQfxyxkIJ3WNA+p5H7Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622150849; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=PpPLwUduOPBU/MDJ39RcDLoxJY5nYaTvJH5KCIXC+XI=; b=mvQMWMqmgxwwCtgVS6CSoUInjiop6pHCU64IKVI01e/tPzNbz/5fHpD2IWKXSsXlgW6N1gTn/5DCgpWZe4nJSFyVy/zBKmvG570G0+BaMkePscU8MyeqaIYiphkDu+Hd71olODwjL04QnXfyvb+/Dvq+iVHKadWtfrwQTFoJcU0= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16221508494691002.8058854926028; Thu, 27 May 2021 14:27:29 -0700 (PDT) Received: from localhost ([::1]:41520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNXM-0005qt-81 for importer@patchew.org; Thu, 27 May 2021 17:27:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47758) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNOa-0002xE-Bn for qemu-devel@nongnu.org; Thu, 27 May 2021 17:18:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:40239) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNOW-000057-4H for qemu-devel@nongnu.org; Thu, 27 May 2021 17:18:24 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-541-sFH4yYD0PqaE7VKGrRyEdw-1; Thu, 27 May 2021 17:18:15 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 98F661883520; Thu, 27 May 2021 21:18:14 +0000 (UTC) Received: from scv.redhat.com (ovpn-116-137.rdu2.redhat.com [10.10.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4D3B45D9C6; Thu, 27 May 2021 21:18:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622150299; 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=PpPLwUduOPBU/MDJ39RcDLoxJY5nYaTvJH5KCIXC+XI=; b=RofcGFOt7HGvtyGhVME6g3E8Q0ck9LefILRztyBzk1IiJK4JYkGSEJGWR0iUNrxw7WxaIS PNpY1GTDoHU15KAawsYn6gdTaAn9DZcyTBFHYkkTMsTHg0refchbqQJc+mmUCT9hFPMpAo 3K+D9ZhOW7L4FFgn2qNH3AioKbOwOOk= X-MC-Unique: sFH4yYD0PqaE7VKGrRyEdw-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v8 09/31] python: create qemu packages Date: Thu, 27 May 2021 17:16:53 -0400 Message-Id: <20210527211715.394144-10-jsnow@redhat.com> In-Reply-To: <20210527211715.394144-1-jsnow@redhat.com> References: <20210527211715.394144-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, 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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Vladimir Sementsov-Ogievskiy , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" move python/qemu/*.py to python/qemu/[machine, qmp, utils]/*.py and update import directives across the tree. This is done to create a PEP420 namespace package, in which we may create subpackages. To do this, the namespace directory ("qemu") should not have any modules in it. Those files will go into new 'machine', 'qmp' and 'utils' subpackages instead. Implement machine/__init__.py making the top-level classes and functions from its various modules available directly inside the package. Change qmp.py to qmp/__init__.py similarly, such that all of the useful QMP library classes are available directly from "qemu.qmp" instead of "qemu.qmp.qmp". Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Cleber Rosa --- python/{qemu =3D> }/.isort.cfg | 0 python/qemu/__init__.py | 11 ------- python/qemu/{ =3D> machine}/.flake8 | 0 python/qemu/machine/__init__.py | 33 +++++++++++++++++++++ python/qemu/{ =3D> machine}/console_socket.py | 0 python/qemu/{ =3D> machine}/machine.py | 16 ++++++---- python/qemu/{ =3D> machine}/pylintrc | 0 python/qemu/{ =3D> machine}/qtest.py | 3 +- python/qemu/{qmp.py =3D> qmp/__init__.py} | 12 +++++++- python/qemu/{utils.py =3D> utils/__init__.py} | 18 +++++++++-- python/qemu/{ =3D> utils}/accel.py | 0 tests/acceptance/avocado_qemu/__init__.py | 9 +++--- tests/acceptance/virtio-gpu.py | 2 +- tests/qemu-iotests/300 | 4 +-- tests/qemu-iotests/iotests.py | 2 +- tests/vm/aarch64vm.py | 2 +- tests/vm/basevm.py | 3 +- 17 files changed, 83 insertions(+), 32 deletions(-) rename python/{qemu =3D> }/.isort.cfg (100%) delete mode 100644 python/qemu/__init__.py rename python/qemu/{ =3D> machine}/.flake8 (100%) create mode 100644 python/qemu/machine/__init__.py rename python/qemu/{ =3D> machine}/console_socket.py (100%) rename python/qemu/{ =3D> machine}/machine.py (98%) rename python/qemu/{ =3D> machine}/pylintrc (100%) rename python/qemu/{ =3D> machine}/qtest.py (99%) rename python/qemu/{qmp.py =3D> qmp/__init__.py} (96%) rename python/qemu/{utils.py =3D> utils/__init__.py} (66%) rename python/qemu/{ =3D> utils}/accel.py (100%) diff --git a/python/qemu/.isort.cfg b/python/.isort.cfg similarity index 100% rename from python/qemu/.isort.cfg rename to python/.isort.cfg diff --git a/python/qemu/__init__.py b/python/qemu/__init__.py deleted file mode 100644 index 4ca06c34a41..00000000000 --- a/python/qemu/__init__.py +++ /dev/null @@ -1,11 +0,0 @@ -# QEMU library -# -# Copyright (C) 2015-2016 Red Hat Inc. -# Copyright (C) 2012 IBM Corp. -# -# Authors: -# Fam Zheng -# -# This work is licensed under the terms of the GNU GPL, version 2. See -# the COPYING file in the top-level directory. -# diff --git a/python/qemu/.flake8 b/python/qemu/machine/.flake8 similarity index 100% rename from python/qemu/.flake8 rename to python/qemu/machine/.flake8 diff --git a/python/qemu/machine/__init__.py b/python/qemu/machine/__init__= .py new file mode 100644 index 00000000000..98302ea31e7 --- /dev/null +++ b/python/qemu/machine/__init__.py @@ -0,0 +1,33 @@ +""" +QEMU development and testing library. + +This library provides a few high-level classes for driving QEMU from a +test suite, not intended for production use. + +- QEMUMachine: Configure and Boot a QEMU VM + - QEMUQtestMachine: VM class, with a qtest socket. + +- QEMUQtestProtocol: Connect to, send/receive qtest messages. +""" + +# Copyright (C) 2020-2021 John Snow for Red Hat Inc. +# Copyright (C) 2015-2016 Red Hat Inc. +# Copyright (C) 2012 IBM Corp. +# +# Authors: +# John Snow +# Fam Zheng +# +# This work is licensed under the terms of the GNU GPL, version 2. See +# the COPYING file in the top-level directory. +# + +from .machine import QEMUMachine +from .qtest import QEMUQtestMachine, QEMUQtestProtocol + + +__all__ =3D ( + 'QEMUMachine', + 'QEMUQtestProtocol', + 'QEMUQtestMachine', +) diff --git a/python/qemu/console_socket.py b/python/qemu/machine/console_so= cket.py similarity index 100% rename from python/qemu/console_socket.py rename to python/qemu/machine/console_socket.py diff --git a/python/qemu/machine.py b/python/qemu/machine/machine.py similarity index 98% rename from python/qemu/machine.py rename to python/qemu/machine/machine.py index a8837b36e47..d33b02d2ce6 100644 --- a/python/qemu/machine.py +++ b/python/qemu/machine/machine.py @@ -38,8 +38,14 @@ Type, ) =20 -from . import console_socket, qmp -from .qmp import QMPMessage, QMPReturnValue, SocketAddrT +from qemu.qmp import ( + QEMUMonitorProtocol, + QMPMessage, + QMPReturnValue, + SocketAddrT, +) + +from . import console_socket =20 =20 LOG =3D logging.getLogger(__name__) @@ -139,7 +145,7 @@ def __init__(self, self._events: List[QMPMessage] =3D [] self._iolog: Optional[str] =3D None self._qmp_set =3D True # Enable QMP monitor by default. - self._qmp_connection: Optional[qmp.QEMUMonitorProtocol] =3D None + self._qmp_connection: Optional[QEMUMonitorProtocol] =3D None self._qemu_full_args: Tuple[str, ...] =3D () self._temp_dir: Optional[str] =3D None self._launched =3D False @@ -314,7 +320,7 @@ def _pre_launch(self) -> None: if self._remove_monitor_sockfile: assert isinstance(self._monitor_address, str) self._remove_files.append(self._monitor_address) - self._qmp_connection =3D qmp.QEMUMonitorProtocol( + self._qmp_connection =3D QEMUMonitorProtocol( self._monitor_address, server=3DTrue, nickname=3Dself._name @@ -541,7 +547,7 @@ def set_qmp_monitor(self, enabled: bool =3D True) -> No= ne: self._qmp_set =3D enabled =20 @property - def _qmp(self) -> qmp.QEMUMonitorProtocol: + def _qmp(self) -> QEMUMonitorProtocol: if self._qmp_connection is None: raise QEMUMachineError("Attempt to access QMP with no connecti= on") return self._qmp_connection diff --git a/python/qemu/pylintrc b/python/qemu/machine/pylintrc similarity index 100% rename from python/qemu/pylintrc rename to python/qemu/machine/pylintrc diff --git a/python/qemu/qtest.py b/python/qemu/machine/qtest.py similarity index 99% rename from python/qemu/qtest.py rename to python/qemu/machine/qtest.py index 78b97d13cf0..e893ca3697a 100644 --- a/python/qemu/qtest.py +++ b/python/qemu/machine/qtest.py @@ -26,8 +26,9 @@ TextIO, ) =20 +from qemu.qmp import SocketAddrT + from .machine import QEMUMachine -from .qmp import SocketAddrT =20 =20 class QEMUQtestProtocol: diff --git a/python/qemu/qmp.py b/python/qemu/qmp/__init__.py similarity index 96% rename from python/qemu/qmp.py rename to python/qemu/qmp/__init__.py index 2cd4d43036c..9606248a3d2 100644 --- a/python/qemu/qmp.py +++ b/python/qemu/qmp/__init__.py @@ -1,4 +1,14 @@ -""" QEMU Monitor Protocol Python class """ +""" +QEMU Monitor Protocol (QMP) development library & tooling. + +This package provides a fairly low-level class for communicating to QMP +protocol servers, as implemented by QEMU, the QEMU Guest Agent, and the +QEMU Storage Daemon. This library is not intended for production use. + +`QEMUMonitorProtocol` is the primary class of interest, and all errors +raised derive from `QMPError`. +""" + # Copyright (C) 2009, 2010 Red Hat Inc. # # Authors: diff --git a/python/qemu/utils.py b/python/qemu/utils/__init__.py similarity index 66% rename from python/qemu/utils.py rename to python/qemu/utils/__init__.py index 5ed789275ee..7f1a5138c4b 100644 --- a/python/qemu/utils.py +++ b/python/qemu/utils/__init__.py @@ -1,13 +1,14 @@ """ -QEMU utility library +QEMU development and testing utilities =20 -This offers miscellaneous utility functions, which may not be easily -distinguishable or numerous to be in their own module. +This package provides a small handful of utilities for performing +various tasks not directly related to the launching of a VM. """ =20 # Copyright (C) 2021 Red Hat Inc. # # Authors: +# John Snow # Cleber Rosa # # This work is licensed under the terms of the GNU GPL, version 2. See @@ -17,6 +18,17 @@ import re from typing import Optional =20 +# pylint: disable=3Dimport-error +from .accel import kvm_available, list_accel, tcg_available + + +__all__ =3D ( + 'get_info_usernet_hostfwd_port', + 'kvm_available', + 'list_accel', + 'tcg_available', +) + =20 def get_info_usernet_hostfwd_port(info_usernet_output: str) -> Optional[in= t]: """ diff --git a/python/qemu/accel.py b/python/qemu/utils/accel.py similarity index 100% rename from python/qemu/accel.py rename to python/qemu/utils/accel.py diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/a= vocado_qemu/__init__.py index 1062a851b97..93c4b9851f4 100644 --- a/tests/acceptance/avocado_qemu/__init__.py +++ b/tests/acceptance/avocado_qemu/__init__.py @@ -41,11 +41,12 @@ =20 sys.path.append(os.path.join(SOURCE_DIR, 'python')) =20 -from qemu.accel import kvm_available -from qemu.accel import tcg_available from qemu.machine import QEMUMachine -from qemu.utils import get_info_usernet_hostfwd_port - +from qemu.utils import ( + get_info_usernet_hostfwd_port, + kvm_available, + tcg_available, +) =20 def is_readable_executable_file(path): return os.path.isfile(path) and os.access(path, os.R_OK | os.X_OK) diff --git a/tests/acceptance/virtio-gpu.py b/tests/acceptance/virtio-gpu.py index ab18cddbb73..e7979343e93 100644 --- a/tests/acceptance/virtio-gpu.py +++ b/tests/acceptance/virtio-gpu.py @@ -10,7 +10,7 @@ from avocado_qemu import exec_command_and_wait_for_pattern from avocado_qemu import is_readable_executable_file =20 -from qemu.accel import kvm_available +from qemu.utils import kvm_available =20 import os import socket diff --git a/tests/qemu-iotests/300 b/tests/qemu-iotests/300 index b475a92c478..fe94de84edd 100755 --- a/tests/qemu-iotests/300 +++ b/tests/qemu-iotests/300 @@ -28,7 +28,7 @@ import iotests =20 # Import qemu after iotests.py has amended sys.path # pylint: disable=3Dwrong-import-order -import qemu +from qemu.machine import machine =20 BlockBitmapMapping =3D List[Dict[str, object]] =20 @@ -466,7 +466,7 @@ class TestBlockBitmapMappingErrors(TestDirtyBitmapMigra= tion): # the failed migration try: self.vm_b.shutdown() - except qemu.machine.AbnormalShutdown: + except machine.AbnormalShutdown: pass =20 def test_aliased_bitmap_name_too_long(self) -> None: diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 92681907ed9..89663dac06d 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -38,7 +38,7 @@ =20 # pylint: disable=3Dimport-error, wrong-import-position sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'pytho= n')) -from qemu import qtest +from qemu.machine import qtest from qemu.qmp import QMPMessage =20 # Use this logger for logging messages directly from the iotests module diff --git a/tests/vm/aarch64vm.py b/tests/vm/aarch64vm.py index d70ab843b6b..b00cce07eb8 100644 --- a/tests/vm/aarch64vm.py +++ b/tests/vm/aarch64vm.py @@ -14,7 +14,7 @@ import sys import subprocess import basevm -from qemu.accel import kvm_available +from qemu.utils import kvm_available =20 # This is the config needed for current version of QEMU. # This works for both kvm and tcg. diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 75ce07df364..6f4f0fc95e3 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -19,9 +19,8 @@ import time import datetime sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'pytho= n')) -from qemu.accel import kvm_available from qemu.machine import QEMUMachine -from qemu.utils import get_info_usernet_hostfwd_port +from qemu.utils import get_info_usernet_hostfwd_port, kvm_available import subprocess import hashlib import argparse --=20 2.31.1 From nobody Thu Nov 14 07:08:09 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 ARC-Seal: i=1; a=rsa-sha256; t=1622150501; cv=none; d=zohomail.com; s=zohoarc; b=W2yJIcVuGct1UgLaPClcjiGR+azHIcGSImbne9VfQJtABSGKB/h8EY7vRxekiZtNsftiUT7f7ivbaDhJ6h+5uSJ+B4bOqBKa1LezF1ETzaY/G0QWSO9iIPoYm84OKUec7U7ODrT5paArXwz/N4/GrKw1DyHZFqxWAyrJXZTuaxw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622150501; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=sGhjIgXo7uWaYdanbzxIlShB9hku8IEEb4j7ORURLmw=; b=kqSJrIj7dzBTvm5LjYJ3+TyvTZVd3EfX8WvTLQYmWiozC/2GMzxxTR2nKIF8al9/aA3gzNKZV4HTtRM2C0fdP/g4BQJIyyZvoz61nrJSmIz/IXoi5gATbJnKyqVln2K75L7lyxhuVsyqaV4c7SNgRcFAp4kIMvyhPTjI4I10EE8= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622150501987616.0376136854653; Thu, 27 May 2021 14:21:41 -0700 (PDT) Received: from localhost ([::1]:47758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNRk-0007sX-Ti for importer@patchew.org; Thu, 27 May 2021 17:21:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47784) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNOh-0003Co-CG for qemu-devel@nongnu.org; Thu, 27 May 2021 17:18:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:34148) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNOc-00009J-NY for qemu-devel@nongnu.org; Thu, 27 May 2021 17:18:31 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-394-dEBYg744NA6ClpHb5msm9Q-1; Thu, 27 May 2021 17:18:22 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7D588FC9A; Thu, 27 May 2021 21:18:21 +0000 (UTC) Received: from scv.redhat.com (ovpn-116-137.rdu2.redhat.com [10.10.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id E6DEE5D9C6; Thu, 27 May 2021 21:18:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622150306; 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=sGhjIgXo7uWaYdanbzxIlShB9hku8IEEb4j7ORURLmw=; b=h2YVCuc0qz8peMrxOFC/XZ9vKA1j4zHAEAerTBJD62ioIBIhVBf90TnKpyAvChMeeVFeUv lJMEpAQ+vIu7h4fMkUJYOwRWWUgYW+7xdORY7Qv6lwhTZ+sW3IG67LreB8MHoS1ZiF7DPl eFaogYzZFeTrMWA2oMFQ2EzY80hfw+M= X-MC-Unique: dEBYg744NA6ClpHb5msm9Q-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v8 10/31] python: add qemu package installer Date: Thu, 27 May 2021 17:16:54 -0400 Message-Id: <20210527211715.394144-11-jsnow@redhat.com> In-Reply-To: <20210527211715.394144-1-jsnow@redhat.com> References: <20210527211715.394144-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, 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_H4=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Vladimir Sementsov-Ogievskiy , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Add setup.cfg and setup.py, necessary for installing a package via pip. Add a ReST document (PACKAGE.rst) explaining the basics of what this package is for and who to contact for more information. This document will be used as the landing page for the package on PyPI. List the subpackages we intend to package by name instead of using find_namespace because find_namespace will naively also packages tests, things it finds in the dist/ folder, etc. I could not figure out how to modify this behavior; adding allow/deny lists to setuptools kept changing the packaged hierarchy. This works, roll with it. I am not yet using a pyproject.toml style package manifest, because "editable" installs are not defined (yet?) by PEP-517/518. I consider editable installs crucial for development, though they have (apparently) always been somewhat poorly defined. Pip now (19.2 and later) now supports editable installs for projects using pyproject.toml manifests, but might require the use of the --no-use-pep517 flag, which somewhat defeats the point. Full support for setup.py-less editable installs was not introduced until pip 21.1.1: https://github.com/pypa/pip/pull/9547/commits/7a95720e796a5e56481c1cc20b6ce= 6249c50f357 For now, while the dust settles, stick with the de-facto setup.py/setup.cfg combination supported by setuptools. It will be worth re-evaluating this point again in the future when our supported build platforms all ship a fairly modern pip. Additional reading on this matter: https://github.com/pypa/packaging-problems/issues/256 https://github.com/pypa/pip/issues/6334 https://github.com/pypa/pip/issues/6375 https://github.com/pypa/pip/issues/6434 https://github.com/pypa/pip/issues/6438 Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Cleber Rosa --- python/PACKAGE.rst | 33 +++++++++++++++++++++++++++++++++ python/setup.cfg | 22 ++++++++++++++++++++++ python/setup.py | 23 +++++++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 python/PACKAGE.rst create mode 100644 python/setup.cfg create mode 100755 python/setup.py diff --git a/python/PACKAGE.rst b/python/PACKAGE.rst new file mode 100644 index 00000000000..1bbfe1b58e2 --- /dev/null +++ b/python/PACKAGE.rst @@ -0,0 +1,33 @@ +QEMU Python Tooling +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +This package provides QEMU tooling used by the QEMU project to build, +configure, and test QEMU. It is not a fully-fledged SDK and it is subject +to change at any time. + +Usage +----- + +The ``qemu.qmp`` subpackage provides a library for communicating with +QMP servers. The ``qemu.machine`` subpackage offers rudimentary +facilities for launching and managing QEMU processes. Refer to each +package's documentation +(``>>> help(qemu.qmp)``, ``>>> help(qemu.machine)``) +for more information. + +Contributing +------------ + +This package is maintained by John Snow as part of +the QEMU source tree. Contributions are welcome and follow the `QEMU +patch submission process +`_, which involves +sending patches to the QEMU development mailing list. + +John maintains a `GitLab staging branch +`_, and there is an +official `GitLab mirror `_. + +Please report bugs on the `QEMU issue tracker +`_ and tag ``@jsnow`` in +the report. diff --git a/python/setup.cfg b/python/setup.cfg new file mode 100644 index 00000000000..3fa92a2e73f --- /dev/null +++ b/python/setup.cfg @@ -0,0 +1,22 @@ +[metadata] +name =3D qemu +maintainer =3D QEMU Developer Team +maintainer_email =3D qemu-devel@nongnu.org +url =3D https://www.qemu.org/ +download_url =3D https://www.qemu.org/download/ +description =3D QEMU Python Build, Debug and SDK tooling. +long_description =3D file:PACKAGE.rst +long_description_content_type =3D text/x-rst +classifiers =3D + Development Status :: 3 - Alpha + License :: OSI Approved :: GNU General Public License v2 (GPLv2) + Natural Language :: English + Operating System :: OS Independent + Programming Language :: Python :: 3 :: Only + +[options] +python_requires =3D >=3D 3.6 +packages =3D + qemu.qmp + qemu.machine + qemu.utils diff --git a/python/setup.py b/python/setup.py new file mode 100755 index 00000000000..2014f81b757 --- /dev/null +++ b/python/setup.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python3 +""" +QEMU tooling installer script +Copyright (c) 2020-2021 John Snow for Red Hat, Inc. +""" + +import setuptools +import pkg_resources + + +def main(): + """ + QEMU tooling installer + """ + + # https://medium.com/@daveshawley/safely-using-setup-cfg-for-metadata-= 1babbe54c108 + pkg_resources.require('setuptools>=3D39.2') + + setuptools.setup() + + +if __name__ =3D=3D '__main__': + main() --=20 2.31.1 From nobody Thu Nov 14 07:08:09 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 ARC-Seal: i=1; a=rsa-sha256; t=1622150640; cv=none; d=zohomail.com; s=zohoarc; b=cToC+gf7OOSTeklc5kZncuY6lRgjkmMgzB5ubtFdIeN0x4fmTPiLH4cF+DBEzPF278HLbvM/Q/zYf8GQLNxSZkXEbLutOJXvEsVXna7ZTcxpRni6rwcEohf+VqNmZyrZ8DTwwfl7wmJfIWXYfMuLXxdC2FgHAncHfOt6juQyvm8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622150640; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=OAQFsAcqAWHeVWemcANeGLkAUwryyfgmR5AM+gZyTXE=; b=DFEqG1/0rIz2AIbdcIqx1+MvJMLdDLXqStIWWMkSIBaridbvOQVm+ysf6p0Oe1MV93XFVDxPvioeG9zXnmOQNmFKENvHsc3X+XFmWiVMHk6oiiWHW+BnopdRbbdg7t6TJySmew45/Q1lvx+sqUwLV5yE2jQjCxPsMM97+VVKpkg= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622150640455233.59070690483668; Thu, 27 May 2021 14:24:00 -0700 (PDT) Received: from localhost ([::1]:56398 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNTz-0005Ac-76 for importer@patchew.org; Thu, 27 May 2021 17:23:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47846) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNOl-0003Gb-Ps for qemu-devel@nongnu.org; Thu, 27 May 2021 17:18:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:37485) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNOk-0000CI-1U for qemu-devel@nongnu.org; Thu, 27 May 2021 17:18:35 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-536-_Lv86pmcMOOyTmw9TZ_Zgg-1; Thu, 27 May 2021 17:18:29 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1B74D800D62; Thu, 27 May 2021 21:18:28 +0000 (UTC) Received: from scv.redhat.com (ovpn-116-137.rdu2.redhat.com [10.10.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id DAD4A5D9C6; Thu, 27 May 2021 21:18:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622150312; 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=OAQFsAcqAWHeVWemcANeGLkAUwryyfgmR5AM+gZyTXE=; b=LPAJD7ma2aXU2Sl2PVb11Qa41SnqhJwnQdYsRHcFsTE7S+RMUYHjDvzi5p6mr1WzgIxe2g gxebVSneh6UkWy/kpDh+PQx4m2v+U28CzlCWNp4kWTH1caIhd4oU25clwyo0pb9a74HJ6w 6w+7I91UPxhuyljTjjHNQLQaWWykdGI= X-MC-Unique: _Lv86pmcMOOyTmw9TZ_Zgg-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v8 11/31] python: add VERSION file Date: Thu, 27 May 2021 17:16:55 -0400 Message-Id: <20210527211715.394144-12-jsnow@redhat.com> In-Reply-To: <20210527211715.394144-1-jsnow@redhat.com> References: <20210527211715.394144-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, 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_H4=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Python infrastructure as it exists today is not capable reliably of single-sourcing a package version from a parent directory. The authors of pip are working to correct this, but as of today this is not possible. The problem is that when using pip to build and install a python package, it copies files over to a temporary directory and performs its build there. This loses access to any information in the parent directory, including git itself. Further, Python versions have a standard (PEP 440) that may or may not follow QEMU's versioning. In general, it does; but naturally QEMU does not follow PEP 440. To avoid any automatically-generated conflict, a manual version file is preferred. I am proposing: - Python tooling follows the QEMU version, indirectly, but with a major version of 0 to indicate that the API is not expected to be stable. This would mean version 0.5.2.0, 0.5.1.1, 0.5.3.0, etc. - In the event that a Python package needs to be updated independently of the QEMU version, a pre-release alpha version should be preferred, but *only* after inclusion to the qemu development or stable branches. e.g. 0.5.2.0a1, 0.5.2.0a2, and so on should be preferred prior to 5.2.0's release. - The Python core tooling makes absolutely no version compatibility checks or constraints. It *may* work with releases of QEMU from the past or future, but it is not required to. i.e., "qemu.machine" will, for now, remain in lock-step with QEMU. - We reserve the right to split the qemu package into independently versioned subpackages at a later date. This might allow for us to begin versioning QMP independently from QEMU at a later date, if we so choose. Implement this versioning scheme by adding a VERSION file and setting it to 0.6.0.0a1. Signed-off-by: John Snow Reviewed-by: Cleber Rosa --- python/VERSION | 1 + python/setup.cfg | 1 + 2 files changed, 2 insertions(+) create mode 100644 python/VERSION diff --git a/python/VERSION b/python/VERSION new file mode 100644 index 00000000000..c19f3b832b7 --- /dev/null +++ b/python/VERSION @@ -0,0 +1 @@ +0.6.1.0a1 diff --git a/python/setup.cfg b/python/setup.cfg index 3fa92a2e73f..b0010e0188f 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -1,5 +1,6 @@ [metadata] name =3D qemu +version =3D file:VERSION maintainer =3D QEMU Developer Team maintainer_email =3D qemu-devel@nongnu.org url =3D https://www.qemu.org/ --=20 2.31.1 From nobody Thu Nov 14 07:08:09 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 ARC-Seal: i=1; a=rsa-sha256; t=1622150769; cv=none; d=zohomail.com; s=zohoarc; b=nplYk7+byp88wgF/ew2PWBi15miQGsX6ksWX6ZpFOJ0iujH5/uq1yHutPcdf+7Y8o0zKtdo5Y3nm1HQJPiHoni0sorK7qTeaDn5ar+MLstmhBYVgG8xTmP3YI9BKc2CgktcH83W8cZhrkXllyf2b9iNdBNZNtVdllfMKFKqGJ/w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622150769; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=SrYVkz4Fxmvr6dN6MEOxdAqVQSL7NLPsWRBBhVc+uVI=; b=IDG02Xg63r5uW662ypxqz1UPRvVDfIRtpw7cZRTLJAKBdxT2QeTQK4/VT06wRBR7OjA1LXRAP72HTDERFdgVUgf2iUUfLr5y2sQ86EaRFk+A/SgJjQ3ssCnXuGyGIm5zhq3Y2U23yZNsSgeITdGszj6msOCj86DpjhbFVfUshdU= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622150769842217.42441374440023; Thu, 27 May 2021 14:26:09 -0700 (PDT) Received: from localhost ([::1]:36578 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNW4-0002PT-S1 for importer@patchew.org; Thu, 27 May 2021 17:26:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47938) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNOx-0003Pd-F1 for qemu-devel@nongnu.org; Thu, 27 May 2021 17:18:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:24523) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNOl-0000DZ-PF for qemu-devel@nongnu.org; Thu, 27 May 2021 17:18:46 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-409-WkM3d2KoP2yeTLOEbcMZfQ-1; Thu, 27 May 2021 17:18:32 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7DF651883522; Thu, 27 May 2021 21:18:31 +0000 (UTC) Received: from scv.redhat.com (ovpn-116-137.rdu2.redhat.com [10.10.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8411F5D9C6; Thu, 27 May 2021 21:18:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622150315; 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=SrYVkz4Fxmvr6dN6MEOxdAqVQSL7NLPsWRBBhVc+uVI=; b=SvK1ymr1nV+mvJQKmD3vlXAyG3ow8BRmGZqMv/M/Vu+exW4Tz4ajhZfW0OOB5dwRrVcFzD 5t/MsNThW6xWZkWS97PvGoE7E+hH1misaEC6uEcfA8tCK1vhbqgw73KKg6/zAZZe5yfx1i z8vPuTnhCzW/GAnUpwOynHU0Qamn1xg= X-MC-Unique: WkM3d2KoP2yeTLOEbcMZfQ-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v8 12/31] python: add directory structure README.rst files Date: Thu, 27 May 2021 17:16:56 -0400 Message-Id: <20210527211715.394144-13-jsnow@redhat.com> In-Reply-To: <20210527211715.394144-1-jsnow@redhat.com> References: <20210527211715.394144-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, 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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Add short readmes to python/, python/qemu/, python/qemu/machine, python/qemu/qmp, and python/qemu/utils that explain the directory hierarchy. These readmes are visible when browsing the source on e.g. gitlab/github and are designed to help new developers/users quickly make sense of the source tree. They are not designed for inclusion in a published manual. Signed-off-by: John Snow Reviewed-by: Cleber Rosa --- python/README.rst | 41 ++++++++++++++++++++++++++++++++++ python/qemu/README.rst | 8 +++++++ python/qemu/machine/README.rst | 9 ++++++++ python/qemu/qmp/README.rst | 9 ++++++++ python/qemu/utils/README.rst | 7 ++++++ 5 files changed, 74 insertions(+) create mode 100644 python/README.rst create mode 100644 python/qemu/README.rst create mode 100644 python/qemu/machine/README.rst create mode 100644 python/qemu/qmp/README.rst create mode 100644 python/qemu/utils/README.rst diff --git a/python/README.rst b/python/README.rst new file mode 100644 index 00000000000..38b0c83f321 --- /dev/null +++ b/python/README.rst @@ -0,0 +1,41 @@ +QEMU Python Tooling +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +This directory houses Python tooling used by the QEMU project to build, +configure, and test QEMU. It is organized by namespace (``qemu``), and +then by package (e.g. ``qemu/machine``, ``qemu/qmp``, etc). + +``setup.py`` is used by ``pip`` to install this tooling to the current +environment. ``setup.cfg`` provides the packaging configuration used by +``setup.py`` in a setuptools specific format. You will generally invoke +it by doing one of the following: + +1. ``pip3 install .`` will install these packages to your current + environment. If you are inside a virtual environment, they will + install there. If you are not, it will attempt to install to the + global environment, which is **not recommended**. + +2. ``pip3 install --user .`` will install these packages to your user's + local python packages. If you are inside of a virtual environment, + this will fail; you likely want the first invocation above. + +If you append the ``-e`` argument, pip will install in "editable" mode; +which installs a version of the package that installs a forwarder +pointing to these files, such that the package always reflects the +latest version in your git tree. + +See `Installing packages using pip and virtual environments +`_ +for more information. + + +Files in this directory +----------------------- + +- ``qemu/`` Python package source directory. +- ``PACKAGE.rst`` is used as the README file that is visible on PyPI.org. +- ``README.rst`` you are here! +- ``VERSION`` contains the PEP-440 compliant version used to describe + this package; it is referenced by ``setup.cfg``. +- ``setup.cfg`` houses setuptools package configuration. +- ``setup.py`` is the setuptools installer used by pip; See above. diff --git a/python/qemu/README.rst b/python/qemu/README.rst new file mode 100644 index 00000000000..d04943f526c --- /dev/null +++ b/python/qemu/README.rst @@ -0,0 +1,8 @@ +QEMU Python Namespace +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +This directory serves as the root of a `Python PEP 420 implicit +namespace package `_. + +Each directory below is assumed to be an installable Python package that +is available under the ``qemu.`` namespace. diff --git a/python/qemu/machine/README.rst b/python/qemu/machine/README.rst new file mode 100644 index 00000000000..ac2b4fffb42 --- /dev/null +++ b/python/qemu/machine/README.rst @@ -0,0 +1,9 @@ +qemu.machine package +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +This package provides core utilities used for testing and debugging +QEMU. It is used by the iotests, vm tests, acceptance tests, and several +other utilities in the ./scripts directory. It is not a fully-fledged +SDK and it is subject to change at any time. + +See the documentation in ``__init__.py`` for more information. diff --git a/python/qemu/qmp/README.rst b/python/qemu/qmp/README.rst new file mode 100644 index 00000000000..c21951491cf --- /dev/null +++ b/python/qemu/qmp/README.rst @@ -0,0 +1,9 @@ +qemu.qmp package +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +This package provides a library used for connecting to and communicating +with QMP servers. It is used extensively by iotests, vm tests, +acceptance tests, and other utilities in the ./scripts directory. It is +not a fully-fledged SDK and is subject to change at any time. + +See the documentation in ``__init__.py`` for more information. diff --git a/python/qemu/utils/README.rst b/python/qemu/utils/README.rst new file mode 100644 index 00000000000..975fbf4d7de --- /dev/null +++ b/python/qemu/utils/README.rst @@ -0,0 +1,7 @@ +qemu.utils package +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +This package provides miscellaneous utilities used for testing and +debugging QEMU. It is used primarily by the vm and acceptance tests. + +See the documentation in ``__init__.py`` for more information. --=20 2.31.1 From nobody Thu Nov 14 07:08:09 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 ARC-Seal: i=1; a=rsa-sha256; t=1622150984; cv=none; d=zohomail.com; s=zohoarc; b=MkIOZpLFYAYNYscqzozTbZWcLZsFx9B+nne1iRwKGZh8pum8wAn/QrXxvsw1Q+fi4R27/6poo7I9fT4jK2B2to4qFfjvXNzYDwiax32+yYpvN0FhMz33WEdkHZz0qhfqRCCvVVVpdYmq+uvfa83GgWLegKa6hb510acFRRGEhoI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622150984; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=BKPijCeWqCKMLi3d7ubkG9xEouBFQsRHfjVWRRnITYE=; b=n9sgPMl6++5iPb7VLZgBBbGKfF57i+An3YaWqorrVyTvbAixcAxTCLt0jBSxwb9aj7NJ6bk+VGNCuCTGLg0DEB7L9zW0oUEf+SsO/lkxnMP2rkl1sSAQpTDmCDOt0BxjZ0rvwRlA5Szucq1fOh8NY+y5LLJgbXiy7u7KnNAyhpA= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622150984496251.1973986864749; Thu, 27 May 2021 14:29:44 -0700 (PDT) Received: from localhost ([::1]:49656 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNZX-0002yD-Es for importer@patchew.org; Thu, 27 May 2021 17:29:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47912) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNOv-0003PO-W9 for qemu-devel@nongnu.org; Thu, 27 May 2021 17:18:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:60518) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNOr-0000F6-MM for qemu-devel@nongnu.org; Thu, 27 May 2021 17:18:45 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-285-yhyJcZrHOX6Jc5tKhV_6iA-1; Thu, 27 May 2021 17:18:36 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DC571FC99; Thu, 27 May 2021 21:18:34 +0000 (UTC) Received: from scv.redhat.com (ovpn-116-137.rdu2.redhat.com [10.10.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id C68615D9C6; Thu, 27 May 2021 21:18:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622150319; 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=BKPijCeWqCKMLi3d7ubkG9xEouBFQsRHfjVWRRnITYE=; b=TP1ry8WfNXDX84+SV7Ndn02/Vde7dHqKPxCr6RVYDViRda2HGyMLV5t4ca3sU+xUYQhgqW BhqbY/nl3XwX+RnH0DqStWCwCnUaECvqPmKrG7C6HzN8Xl/QCr8Jm2OOF7T1VlFbSxT74r asj8fubt4nt50oD29NS4jHbNYm5Bu9s= X-MC-Unique: yhyJcZrHOX6Jc5tKhV_6iA-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v8 13/31] python: add MANIFEST.in Date: Thu, 27 May 2021 17:16:57 -0400 Message-Id: <20210527211715.394144-14-jsnow@redhat.com> In-Reply-To: <20210527211715.394144-1-jsnow@redhat.com> References: <20210527211715.394144-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, 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_H4=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Vladimir Sementsov-Ogievskiy , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" When creating a source or binary distribution via 'python3 setup.py ', the VERSION and PACKAGE.rst files aren't bundled by default. Create a MANIFEST.in file that instructs the build tools to include these so that installation from these files won't fail. This is required by 'tox', as well as by the tooling needed to upload packages to PyPI. Exclude the 'README.rst' file -- that's intended as a guidebook to our source tree, not a file that needs to be distributed. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Cleber Rosa --- python/README.rst | 2 ++ python/MANIFEST.in | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 python/MANIFEST.in diff --git a/python/README.rst b/python/README.rst index 38b0c83f321..0099646ae2f 100644 --- a/python/README.rst +++ b/python/README.rst @@ -33,6 +33,8 @@ Files in this directory ----------------------- =20 - ``qemu/`` Python package source directory. +- ``MANIFEST.in`` is read by python setuptools, it specifies additional fi= les + that should be included by a source distribution. - ``PACKAGE.rst`` is used as the README file that is visible on PyPI.org. - ``README.rst`` you are here! - ``VERSION`` contains the PEP-440 compliant version used to describe diff --git a/python/MANIFEST.in b/python/MANIFEST.in new file mode 100644 index 00000000000..7059ad28221 --- /dev/null +++ b/python/MANIFEST.in @@ -0,0 +1,3 @@ +include VERSION +include PACKAGE.rst +exclude README.rst --=20 2.31.1 From nobody Thu Nov 14 07:08:09 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 ARC-Seal: i=1; a=rsa-sha256; t=1622151019; cv=none; d=zohomail.com; s=zohoarc; b=FzIO90VtPRrZJw7nsFBz+UfZYQOQqQ5XTiez18jHGUppQWgOz7VsMQKxBY5xV1LtCs3q8yr6TblkAR90LIdo8l0ixmknobd/mOYID6umBqF5j8dtpCCc5/spl+D7D9lMLD+qI4kqZZhQABX8dMOtEeVuOFbYUXTFFcR/2n4ZZG4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622151019; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=XjTON+urjvzsuWmOwqRwlI6Ai+/vsJHIDLeKE2IUKuQ=; b=EmYmRHoXJ9UJy1ZwKEit2DgXfXmxW37JHkWsSYgN7JYnw3zbVshttqXzkap2L7k0B1T1qWf89sD9qL1+PL96+nGQq8Xkp3ZVyhd6rKzYpXcA7JXUluH5uJDZQ2e84RzmY648CKBbzuWj5rtggHkQxQRP6QoBEqRf7PHHDxMXNFU= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622151019250780.952131751103; Thu, 27 May 2021 14:30:19 -0700 (PDT) Received: from localhost ([::1]:51388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNa6-00049W-3E for importer@patchew.org; Thu, 27 May 2021 17:30:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47982) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNP3-0003TN-6P for qemu-devel@nongnu.org; Thu, 27 May 2021 17:18:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:31350) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNOy-0000H9-IL for qemu-devel@nongnu.org; Thu, 27 May 2021 17:18:52 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-515-k1kAL5KmNOCWNTxu-NdrpA-1; Thu, 27 May 2021 17:18:42 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B37331883520; Thu, 27 May 2021 21:18:41 +0000 (UTC) Received: from scv.redhat.com (ovpn-116-137.rdu2.redhat.com [10.10.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3EC695D9C6; Thu, 27 May 2021 21:18:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622150327; 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=XjTON+urjvzsuWmOwqRwlI6Ai+/vsJHIDLeKE2IUKuQ=; b=KQzIMfIT8mMrG8xdWiq7YBa2Vmao0axK5L6Nca4wIdBgpvZ4YwxLTP5t3wqlkam4aM2fw8 AByeqfUc2Zm4vBNdzNwvyFmT9J11WBm/Ms5RwG9deSaWWHhZRH1SyIE7cEIHqRkRkhKhRD 4JH1Uw1y0HVRurPbBLYam98I0IKZ1TQ= X-MC-Unique: k1kAL5KmNOCWNTxu-NdrpA-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v8 14/31] python: Add pipenv support Date: Thu, 27 May 2021 17:16:58 -0400 Message-Id: <20210527211715.394144-15-jsnow@redhat.com> In-Reply-To: <20210527211715.394144-1-jsnow@redhat.com> References: <20210527211715.394144-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, 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_H4=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" pipenv is a tool used for managing virtual environments with pinned, explicit dependencies. It is used for precisely recreating python virtual environments. pipenv uses two files to do this: (1) Pipfile, which is similar in purpose and scope to what setup.cfg lists. It specifies the requisite minimum to get a functional environment for using this package. (2) Pipfile.lock, which is similar in purpose to `pip freeze > requirements.txt`. It specifies a canonical virtual environment used for deployment or testing. This ensures that all users have repeatable results. The primary benefit of using this tool is to ensure *rock solid* repeatable CI results with a known set of packages. Although I endeavor to support as many versions as I can, the fluid nature of the Python toolchain often means tailoring code for fairly specific versions. Note that pipenv is *not* required to install or use this module; this is purely for the sake of repeatable testing by CI or developers. Here, a "blank" pipfile is added with no dependencies, but specifies Python 3.6 for the virtual environment. Pipfile will specify our version minimums, while Pipfile.lock specifies an exact loadout of packages that were known to operate correctly. This latter file provides the real value for easy setup of container images and CI environments. Signed-off-by: John Snow Reviewed-by: Cleber Rosa --- python/README.rst | 3 +++ python/Pipfile | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100644 python/Pipfile diff --git a/python/README.rst b/python/README.rst index 0099646ae2f..bf9bbca979a 100644 --- a/python/README.rst +++ b/python/README.rst @@ -36,6 +36,9 @@ Files in this directory - ``MANIFEST.in`` is read by python setuptools, it specifies additional fi= les that should be included by a source distribution. - ``PACKAGE.rst`` is used as the README file that is visible on PyPI.org. +- ``Pipfile`` is used by Pipenv to generate ``Pipfile.lock``. +- ``Pipfile.lock`` is a set of pinned package dependencies that this packa= ge + is tested under in our CI suite. It is used by ``make venv-check``. - ``README.rst`` you are here! - ``VERSION`` contains the PEP-440 compliant version used to describe this package; it is referenced by ``setup.cfg``. diff --git a/python/Pipfile b/python/Pipfile new file mode 100644 index 00000000000..9534830b5eb --- /dev/null +++ b/python/Pipfile @@ -0,0 +1,11 @@ +[[source]] +name =3D "pypi" +url =3D "https://pypi.org/simple" +verify_ssl =3D true + +[dev-packages] + +[packages] + +[requires] +python_version =3D "3.6" --=20 2.31.1 From nobody Thu Nov 14 07:08:09 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 ARC-Seal: i=1; a=rsa-sha256; t=1622150715; cv=none; d=zohomail.com; s=zohoarc; b=iodPgHZbhB10aI80heVchgp5crWFbQtG8OdqTscKLuMErZw2eNiasEOj+FstkI+Fv5YOrlRifIpCT1XhYwYtuNqmQCup2DROetJefJrzxe/nzWYk7tiLefcVrWTlw2cvUFeMQC9Loe3Yw1wAD3B6bXoMj9wWDfrLGoigr5UPhqg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622150715; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=AoH2IuAccvwCITZAvHPvvv8iP/8tQqealoRJc8NYsTU=; b=inRluYFxgE+gUjEygWCPAlOr9HEqX8NHp3lnosOIRCyG4wRA6S7YI5y5FocjK4tLbvdxu6Gj6P5PqBQ5ctHLZMBrlZtu3FFc5HwRJsd6Bkwxnk5sFI/4yW2HsBtk07xK4S/DihGQ2ovEJfD6XkhRwlYIJMbdr8DsZ7AKurt71EA= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622150715114462.5531403953805; Thu, 27 May 2021 14:25:15 -0700 (PDT) Received: from localhost ([::1]:34692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNVC-000173-0b for importer@patchew.org; Thu, 27 May 2021 17:25:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48018) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNP8-0003gu-0A for qemu-devel@nongnu.org; Thu, 27 May 2021 17:18:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:59239) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNP5-0000M8-TA for qemu-devel@nongnu.org; Thu, 27 May 2021 17:18:57 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-425--EihTT1PNZGdFe8IM_jE-Q-1; Thu, 27 May 2021 17:18:52 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D1842107ACE6; Thu, 27 May 2021 21:18:50 +0000 (UTC) Received: from scv.redhat.com (ovpn-116-137.rdu2.redhat.com [10.10.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2423F5D9C6; Thu, 27 May 2021 21:18:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622150335; 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=AoH2IuAccvwCITZAvHPvvv8iP/8tQqealoRJc8NYsTU=; b=SlFMcS8JWuVK5MxvsfqBuog8RJh8pc2Xfz1uKohSNwQ8LxcM8tvIcj3Zmuq4NVWmHClPZg aGMbF9nGIh80N2RV9WstYQcH9bSnTazahcqIBrz/ksLAGHSivpMk2qr1D3IjjqI/Su+fBF 7V/poiBP8QVuCjC25YnFI6PrRzhsrnw= X-MC-Unique: -EihTT1PNZGdFe8IM_jE-Q-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v8 15/31] python: add pylint import exceptions Date: Thu, 27 May 2021 17:16:59 -0400 Message-Id: <20210527211715.394144-16-jsnow@redhat.com> In-Reply-To: <20210527211715.394144-1-jsnow@redhat.com> References: <20210527211715.394144-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, 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_H4=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Pylint 2.5.x - 2.7.x have regressions that make import checking inconsistent, see: https://github.com/PyCQA/pylint/issues/3609 https://github.com/PyCQA/pylint/issues/3624 https://github.com/PyCQA/pylint/issues/3651 Pinning to 2.4.4 is worse, because it mandates versions of shared dependencies that are too old for features we want in isort and mypy. Oh well. Signed-off-by: John Snow Reviewed-by: Cleber Rosa --- python/qemu/machine/__init__.py | 3 +++ python/qemu/machine/machine.py | 2 +- python/qemu/machine/qtest.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/python/qemu/machine/__init__.py b/python/qemu/machine/__init__= .py index 98302ea31e7..728f27adbed 100644 --- a/python/qemu/machine/__init__.py +++ b/python/qemu/machine/__init__.py @@ -22,6 +22,9 @@ # the COPYING file in the top-level directory. # =20 +# pylint: disable=3Dimport-error +# see: https://github.com/PyCQA/pylint/issues/3624 +# see: https://github.com/PyCQA/pylint/issues/3651 from .machine import QEMUMachine from .qtest import QEMUQtestMachine, QEMUQtestProtocol =20 diff --git a/python/qemu/machine/machine.py b/python/qemu/machine/machine.py index d33b02d2ce6..b62435528e2 100644 --- a/python/qemu/machine/machine.py +++ b/python/qemu/machine/machine.py @@ -38,7 +38,7 @@ Type, ) =20 -from qemu.qmp import ( +from qemu.qmp import ( # pylint: disable=3Dimport-error QEMUMonitorProtocol, QMPMessage, QMPReturnValue, diff --git a/python/qemu/machine/qtest.py b/python/qemu/machine/qtest.py index e893ca3697a..93700684d1c 100644 --- a/python/qemu/machine/qtest.py +++ b/python/qemu/machine/qtest.py @@ -26,7 +26,7 @@ TextIO, ) =20 -from qemu.qmp import SocketAddrT +from qemu.qmp import SocketAddrT # pylint: disable=3Dimport-error =20 from .machine import QEMUMachine =20 --=20 2.31.1 From nobody Thu Nov 14 07:08:09 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 ARC-Seal: i=1; a=rsa-sha256; t=1622150862; cv=none; d=zohomail.com; s=zohoarc; b=P7U0z4uZ51YifMyLvevcMyV22jdZ5seMDYR4OJMP+QcSF8vfAmGiSk39SZEqjhjZq4w+pRJM7C8mpJqemz3qT4HYIKs8MowibldeousS7vq+PBEHOp+X47A3UkV3l4ePxUx0i9NKfpQbXy/L//SiBS3ZX5fpSfy4qe7ZBBfz1Zc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622150862; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=UyzDVTdszApWjedDvs1PkJmJRjaLD/7Vh5q3VOGL5dA=; b=h1lzn2zQkv9AGuXvaKrfteXgvg6blDYJIiNpLsitMYQkGcUovDrD+KD+hi+qq55lPGev/wm7WSS88PPj57LbpAi5WZcQv/tdapNaAqo51RHz/SkU3E3OYGiLstISlFYW+VVnOoTSaPv5/IkfrwRJLVn2DOSzrpg6Dl2Uiyviyt4= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622150862914419.8875979088035; Thu, 27 May 2021 14:27:42 -0700 (PDT) Received: from localhost ([::1]:43024 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNXZ-0006sT-TW for importer@patchew.org; Thu, 27 May 2021 17:27:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48054) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNPB-0003qo-2T for qemu-devel@nongnu.org; Thu, 27 May 2021 17:19:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:35130) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNP7-0000Mt-NX for qemu-devel@nongnu.org; Thu, 27 May 2021 17:19:00 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-67-UwK_W5AWM-2hdKKQTVCYVw-1; Thu, 27 May 2021 17:18:55 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3A54F1883520; Thu, 27 May 2021 21:18:54 +0000 (UTC) Received: from scv.redhat.com (ovpn-116-137.rdu2.redhat.com [10.10.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3E18B5D9D3; Thu, 27 May 2021 21:18:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622150337; 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=UyzDVTdszApWjedDvs1PkJmJRjaLD/7Vh5q3VOGL5dA=; b=ACZYAizEjx6ycG3T9MguWCKLu7SD2oityf9pMoenbUfMTTtT5z0r0MHFUuSjLUK8hYSFN3 GUEz6DxZ7w87P5B6NMgrBqPXFYtrhGKbamkPKwy9zgIYFetrzQkf2Ar6HWhHgk97iBm2Xz bKI3vIbM/2/yU42Y7iZGZQ+9D6KvVT0= X-MC-Unique: UwK_W5AWM-2hdKKQTVCYVw-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v8 16/31] python: move pylintrc into setup.cfg Date: Thu, 27 May 2021 17:17:00 -0400 Message-Id: <20210527211715.394144-17-jsnow@redhat.com> In-Reply-To: <20210527211715.394144-1-jsnow@redhat.com> References: <20210527211715.394144-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, 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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Delete the empty settings now that it's sharing a home with settings for other tools. pylint can now be run from this folder as "pylint qemu". Signed-off-by: John Snow Reviewed-by: Cleber Rosa Tested-by: Cleber Rosa --- python/qemu/machine/pylintrc | 58 ------------------------------------ python/setup.cfg | 29 ++++++++++++++++++ 2 files changed, 29 insertions(+), 58 deletions(-) delete mode 100644 python/qemu/machine/pylintrc diff --git a/python/qemu/machine/pylintrc b/python/qemu/machine/pylintrc deleted file mode 100644 index 3f69205000d..00000000000 --- a/python/qemu/machine/pylintrc +++ /dev/null @@ -1,58 +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=3Dtoo-many-arguments, - too-many-instance-attributes, - too-many-public-methods, - -[REPORTS] - -[REFACTORING] - -[MISCELLANEOUS] - -[LOGGING] - -[BASIC] - -# Good variable names which should always be accepted, separated by a comm= a. -good-names=3Di, - j, - k, - ex, - Run, - _, - fd, - c, -[VARIABLES] - -[STRING] - -[SPELLING] - -[FORMAT] - -[SIMILARITIES] - -# Ignore imports when computing similarities. -ignore-imports=3Dyes - -[TYPECHECK] - -[CLASSES] - -[IMPORTS] - -[DESIGN] - -[EXCEPTIONS] diff --git a/python/setup.cfg b/python/setup.cfg index b0010e0188f..36b4253e939 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -21,3 +21,32 @@ packages =3D qemu.qmp qemu.machine qemu.utils + +[pylint.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=3Dtoo-many-arguments, + too-many-instance-attributes, + too-many-public-methods, + +[pylint.basic] +# Good variable names which should always be accepted, separated by a comm= a. +good-names=3Di, + j, + k, + ex, + Run, + _, + fd, + c, + +[pylint.similarities] +# Ignore imports when computing similarities. +ignore-imports=3Dyes --=20 2.31.1 From nobody Thu Nov 14 07:08:09 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 ARC-Seal: i=1; a=rsa-sha256; t=1622151216; cv=none; d=zohomail.com; s=zohoarc; b=oAUmg6QUCnVIWlYkVtZrLl1ocSEM6tRJHNyWie5TX9Y3rVR8PhnHB5hkfAI7zoa9PfENRB7f/JGl4gxD/f8NeaVOjxGkr7bKeImFeq6KdFMTTCYxNlOSqFxYVWqh7WNX1pgXzt3K+IDbm+vJiLWpuS6Dif/vXW9udS9NyO+ypM0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622151216; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Qh3ZgX4mhAkn20nJ63KIOHZuXKgsA5T5MiuM5Gqj/P8=; b=CbyShxjFID9uIKqNBQQAIrriSSOeKzng1RiWQelvm5iD4u5bRGNMRJQUfWLrfsGn9CQV3VLZhFGpN5EoBSFsN78/UNIHNsOXd05yCoIZvB4RTW5vcXxnyGX/HmVg5S6ugoau5e0VgFr7NQ2LVabnXX+SiAYB+jyyde4GbXbSOc8= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622151216610872.2182322674678; Thu, 27 May 2021 14:33:36 -0700 (PDT) Received: from localhost ([::1]:60486 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNdH-00020S-IL for importer@patchew.org; Thu, 27 May 2021 17:33:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48082) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNPJ-00040D-RM for qemu-devel@nongnu.org; Thu, 27 May 2021 17:19:10 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:26016) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNPH-0000Sn-4D for qemu-devel@nongnu.org; Thu, 27 May 2021 17:19:09 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-394-HudGAKGFOcKf-MNJeUsBSw-1; Thu, 27 May 2021 17:19:02 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EE0B51883522; Thu, 27 May 2021 21:19:00 +0000 (UTC) Received: from scv.redhat.com (ovpn-116-137.rdu2.redhat.com [10.10.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 981835D9CC; Thu, 27 May 2021 21:18:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622150345; 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=Qh3ZgX4mhAkn20nJ63KIOHZuXKgsA5T5MiuM5Gqj/P8=; b=PkmKgFHJ7o+jm7hufk3Bdff88PF973+vdbmuNglnWzqKIkYNC3gmWlWWSSKQ3fJhXEIdrP 7pxd89oDRRhCqi7h/CbHOTpZz4bjocBXywC28MVokgFXJvCP741FB3xP9kz/qAxsBr+3jR ZKvi9WaEqip8HdcrM+EgCYGJjzeXvys= X-MC-Unique: HudGAKGFOcKf-MNJeUsBSw-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v8 17/31] python: add pylint to pipenv Date: Thu, 27 May 2021 17:17:01 -0400 Message-Id: <20210527211715.394144-18-jsnow@redhat.com> In-Reply-To: <20210527211715.394144-1-jsnow@redhat.com> References: <20210527211715.394144-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, 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_H4=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Vladimir Sementsov-Ogievskiy , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" We are specifying >=3D pylint 2.8.x for several reasons: 1. For setup.cfg support, added in pylint 2.5.x 2. To specify a version that has incompatibly dropped bad-whitespace checks (2.6.x) 3. 2.7.x fixes "unsubscriptable" warnings in Python 3.9 4. 2.8.x adds a new, incompatible 'consider-using-with' warning that must be disabled in some cases. These pragmas cause warnings themselves in 2.7.x. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Cleber Rosa Tested-by: Cleber Rosa --- python/Pipfile | 1 + python/Pipfile.lock | 130 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 131 insertions(+) create mode 100644 python/Pipfile.lock diff --git a/python/Pipfile b/python/Pipfile index 9534830b5eb..285e2c8e671 100644 --- a/python/Pipfile +++ b/python/Pipfile @@ -4,6 +4,7 @@ url =3D "https://pypi.org/simple" verify_ssl =3D true =20 [dev-packages] +pylint =3D ">=3D2.8.0" =20 [packages] =20 diff --git a/python/Pipfile.lock b/python/Pipfile.lock new file mode 100644 index 00000000000..c9debd09503 --- /dev/null +++ b/python/Pipfile.lock @@ -0,0 +1,130 @@ +{ + "_meta": { + "hash": { + "sha256": "bd4fb76fcdd145bbf23c3a9dd7ad966113c5ce43ca51cc2d828= aa7e73d572901" + }, + "pipfile-spec": 6, + "requires": { + "python_version": "3.6" + }, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.org/simple", + "verify_ssl": true + } + ] + }, + "default": {}, + "develop": { + "astroid": { + "hashes": [ + "sha256:4db03ab5fc3340cf619dbc25e42c2cc3755154ce6009469766= d7143d1fc2ee4e", + "sha256:8a398dfce302c13f14bab13e2b14fe385d32b73f4e4853b9bd= fb64598baa1975" + ], + "markers": "python_version ~=3D '3.6'", + "version": "=3D=3D2.5.6" + }, + "isort": { + "hashes": [ + "sha256:0a943902919f65c5684ac4e0154b1ad4fac6dcaa5d9f3426b7= 32f1c8b5419be6", + "sha256:2bb1680aad211e3c9944dbce1d4ba09a989f04e238296c87fe= 2139faa26d655d" + ], + "markers": "python_version >=3D '3.6' and python_version < '4.= 0'", + "version": "=3D=3D5.8.0" + }, + "lazy-object-proxy": { + "hashes": [ + "sha256:17e0967ba374fc24141738c69736da90e94419338fd4c7c7be= f01ee26b339653", + "sha256:1fee665d2638491f4d6e55bd483e15ef21f6c8c2095f235fef= 72601021e64f61", + "sha256:22ddd618cefe54305df49e4c069fa65715be4ad0e78e8d252a= 33debf00f6ede2", + "sha256:24a5045889cc2729033b3e604d496c2b6f588c754f7a62027a= d4437a7ecc4837", + "sha256:410283732af311b51b837894fa2f24f2c0039aa7f220135192= b38fcc42bd43d3", + "sha256:4732c765372bd78a2d6b2150a6e99d00a78ec963375f236979= c0626b97ed8e43", + "sha256:489000d368377571c6f982fba6497f2aa13c6d1facc4066096= 3da62f5c379726", + "sha256:4f60460e9f1eb632584c9685bccea152f4ac2130e299784dba= f9fae9f49891b3", + "sha256:5743a5ab42ae40caa8421b320ebf3a998f89c85cdc8376d6b2= e00bd12bd1b587", + "sha256:85fb7608121fd5621cc4377a8961d0b32ccf84a7285b4f1d21= 988b2eae2868e8", + "sha256:9698110e36e2df951c7c36b6729e96429c9c32b3331989ef19= 976592c5f3c77a", + "sha256:9d397bf41caad3f489e10774667310d73cb9c4258e9aed94b9= ec734b34b495fd", + "sha256:b579f8acbf2bdd9ea200b1d5dea36abd93cabf56cf626ab9c7= 44a432e15c815f", + "sha256:b865b01a2e7f96db0c5d12cfea590f98d8c5ba64ad222300d9= 3ce6ff9138bcad", + "sha256:bf34e368e8dd976423396555078def5cfc3039ebc6fc06d1ae= 2c5a65eebbcde4", + "sha256:c6938967f8528b3668622a9ed3b31d145fab161a32f5891ea7= b84f6b790be05b", + "sha256:d1c2676e3d840852a2de7c7d5d76407c772927addff8d742b9= 808fe0afccebdf", + "sha256:d7124f52f3bd259f510651450e18e0fd081ed82f3c08541dff= c7b94b883aa981", + "sha256:d900d949b707778696fdf01036f58c9876a0d8bfe116e8d220= cfd4b15f14e741", + "sha256:ebfd274dcd5133e0afae738e6d9da4323c3eb021b3e13052d8= cbd0e457b1256e", + "sha256:ed361bb83436f117f9917d282a456f9e5009ea12fd6de8742d= 1a4752c3017e93", + "sha256:f5144c75445ae3ca2057faac03fda5a902eff196702b0a24da= f1d6ce0650514b" + ], + "markers": "python_version >=3D '2.7' and python_version not i= n '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'", + "version": "=3D=3D1.6.0" + }, + "mccabe": { + "hashes": [ + "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d= 64e79735b80d42", + "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb= 0f125271b8831f" + ], + "version": "=3D=3D0.6.1" + }, + "pylint": { + "hashes": [ + "sha256:586d8fa9b1891f4b725f587ef267abe2a1bad89d6b184520c7= f07a253dd6e217", + "sha256:f7e2072654a6b6afdf5e2fb38147d3e2d2d43c89f648637baa= b63e026481279b" + ], + "index": "pypi", + "version": "=3D=3D2.8.2" + }, + "toml": { + "hashes": [ + "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894= a5f779cabb4f9b", + "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bd= ed2f839ccbe68f" + ], + "markers": "python_version >=3D '2.6' and python_version not i= n '3.0, 3.1, 3.2'", + "version": "=3D=3D0.10.2" + }, + "typed-ast": { + "hashes": [ + "sha256:01ae5f73431d21eead5015997ab41afa53aa1fbe252f9da060= be5dad2c730ace", + "sha256:067a74454df670dcaa4e59349a2e5c81e567d8d65458d480a5= b3dfecec08c5ff", + "sha256:0fb71b8c643187d7492c1f8352f2c15b4c4af3f6338f21681d= 3681b3dc31a266", + "sha256:1b3ead4a96c9101bef08f9f7d1217c096f31667617b58de957= f690c92378b528", + "sha256:2068531575a125b87a41802130fa7e29f26c09a2833fea68d9= a40cf33902eba6", + "sha256:209596a4ec71d990d71d5e0d312ac935d86930e6eecff6ccc7= 007fe54d703808", + "sha256:2c726c276d09fc5c414693a2de063f521052d9ea7c240ce553= 316f70656c84d4", + "sha256:398e44cd480f4d2b7ee8d98385ca104e35c81525dd98c519ac= ff1b79bdaac363", + "sha256:52b1eb8c83f178ab787f3a4283f68258525f8d70f778a2f6dd= 54d3b5e5fb4341", + "sha256:5feca99c17af94057417d744607b82dd0a664fd5e4ca980614= 80fd8b14b18d04", + "sha256:7538e495704e2ccda9b234b82423a4038f324f3a10c43bc088= a1636180f11a41", + "sha256:760ad187b1041a154f0e4d0f6aae3e40fdb51d6de16e5c99ae= dadd9246450e9e", + "sha256:777a26c84bea6cd934422ac2e3b78863a37017618b6e5c08f9= 2ef69853e765d3", + "sha256:95431a26309a21874005845c21118c83991c63ea800dd44843= e42a916aec5899", + "sha256:9ad2c92ec681e02baf81fdfa056fe0d818645efa9af1f1cd5f= d6f1bd2bdfd805", + "sha256:9c6d1a54552b5330bc657b7ef0eae25d00ba7ffe85d9ea8ae6= 540d2197a3788c", + "sha256:aee0c1256be6c07bd3e1263ff920c325b59849dc95392a05f2= 58bb9b259cf39c", + "sha256:af3d4a73793725138d6b334d9d247ce7e5f084d96284ed23f2= 2ee626a7b88e39", + "sha256:b36b4f3920103a25e1d5d024d155c504080959582b928e91cb= 608a65c3a49e1a", + "sha256:b9574c6f03f685070d859e75c7f9eeca02d6933273b5e69572= e5ff9d5e3931c3", + "sha256:bff6ad71c81b3bba8fa35f0f1921fb24ff4476235a6e94a26a= da2e54370e6da7", + "sha256:c190f0899e9f9f8b6b7863debfb739abcb21a5c054f911ca35= 96d12b8a4c4c7f", + "sha256:c907f561b1e83e93fad565bac5ba9c22d96a54e7ea0267c708= bffe863cbe4075", + "sha256:cae53c389825d3b46fb37538441f75d6aecc4174f615d04832= 1b716df2757fb0", + "sha256:dd4a21253f42b8d2b48410cb31fe501d32f8b9fbeb1f55063a= d102fe9c425e40", + "sha256:dde816ca9dac1d9c01dd504ea5967821606f02e51043812009= 1b84e852367428", + "sha256:f2362f3cb0f3172c42938946dbc5b7843c2a28aec307c49100= c8b38764eb6927", + "sha256:f328adcfebed9f11301eaedfa48e15bdece9b519fb27e6a8c0= 1aa52a17ec31b3", + "sha256:f8afcf15cc511ada719a88e013cec87c11aff7b91f019295eb= 4530f96fe5ef2f", + "sha256:fb1bbeac803adea29cedd70781399c99138358c26d05fcbd23= c13016b7f5ec65" + ], + "markers": "implementation_name =3D=3D 'cpython' and python_ve= rsion < '3.8'", + "version": "=3D=3D1.4.3" + }, + "wrapt": { + "hashes": [ + "sha256:b62ffa81fb85f4332a4f609cab4ac40709470da05643a082ec= 1eb88e6d9b97d7" + ], + "version": "=3D=3D1.12.1" + } + } +} --=20 2.31.1 From nobody Thu Nov 14 07:08:09 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 ARC-Seal: i=1; a=rsa-sha256; t=1622150937; cv=none; d=zohomail.com; s=zohoarc; b=IHDQW1EMkJQDq+i/fNOGyLlYm7CR+xo/8U81pnMcAm5m3iQZMQdOxC2VLTHtQJ+VxtmrGePlptDW73IfbY9ZQyVLpjVuEAHFGqhyauPPZ1nPB4OzSANhhy9q/mBMNwnIiYbcfXaMhbsLj46EFoJ2lG55Udi2RZE3rQu4wKOfKsw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622150937; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=OclvukiY1H6sfo8th6djoXgx+CxhHpvNr8Ovm8pp4dI=; b=bCOF6+zE6olNjNXb2DNpbLxivLbdYksQfq3Jt7805SUhoPRJgoM00gCUyTz10Y3pXCKp5ISRGsKDWA+WZbkdVuMBCuP6gFS7UIXk7yRqp+xfnUcP3THtURh+imARh5hODgDhCBrdULZL38z+HKB7uDGGP72f8KsLCYdHSuChb5U= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16221509379771014.404522084327; Thu, 27 May 2021 14:28:57 -0700 (PDT) Received: from localhost ([::1]:46276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNYm-0000fn-PD for importer@patchew.org; Thu, 27 May 2021 17:28:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48128) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNPO-00042u-5Z for qemu-devel@nongnu.org; Thu, 27 May 2021 17:19:15 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:22231) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNPL-0000Va-5F for qemu-devel@nongnu.org; Thu, 27 May 2021 17:19:13 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-39-S2aJwE9JP-S1HfZmOhzQDQ-1; Thu, 27 May 2021 17:19:09 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D88AF1883520; Thu, 27 May 2021 21:19:07 +0000 (UTC) Received: from scv.redhat.com (ovpn-116-137.rdu2.redhat.com [10.10.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4B6E55D9CC; Thu, 27 May 2021 21:19:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622150350; 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=OclvukiY1H6sfo8th6djoXgx+CxhHpvNr8Ovm8pp4dI=; b=huIUZcC4pcxazOSbz5OD5vxkkn1+L5ViVpg6x/pfv0Qiw+urcSPZjN+aaDUgX/6bmEOVGh rv5DcA4GBoxrmcYcNBO4Hz8hkmXSFreF9seciH5U03T10VMpNK6z6ZCQm6ZSpWBFYkjRV0 VIjKcweo2H8OXLDa0c75+NIRO0UR6to= X-MC-Unique: S2aJwE9JP-S1HfZmOhzQDQ-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v8 18/31] python: move flake8 config to setup.cfg Date: Thu, 27 May 2021 17:17:02 -0400 Message-Id: <20210527211715.394144-19-jsnow@redhat.com> In-Reply-To: <20210527211715.394144-1-jsnow@redhat.com> References: <20210527211715.394144-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, 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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Update the comment concerning the flake8 exception to match commit 42c0dd12, whose commit message stated: A note on the flake8 exception: flake8 will warn on *any* bare except, but pylint's is context-aware and will suppress the warning if you re-raise the exception. Signed-off-by: John Snow Reviewed-by: Cleber Rosa --- python/qemu/machine/.flake8 | 2 -- python/setup.cfg | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) delete mode 100644 python/qemu/machine/.flake8 diff --git a/python/qemu/machine/.flake8 b/python/qemu/machine/.flake8 deleted file mode 100644 index 45d8146f3f5..00000000000 --- a/python/qemu/machine/.flake8 +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -extend-ignore =3D E722 # Pylint handles this, but smarter. \ No newline at end of file diff --git a/python/setup.cfg b/python/setup.cfg index 36b4253e939..52a89a0a290 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -22,6 +22,9 @@ packages =3D qemu.machine qemu.utils =20 +[flake8] +extend-ignore =3D E722 # Prefer pylint's bare-except checks to flake8's + [pylint.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 --=20 2.31.1 From nobody Thu Nov 14 07:08:09 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 ARC-Seal: i=1; a=rsa-sha256; t=1622151086; cv=none; d=zohomail.com; s=zohoarc; b=iBkTKncCSzks2dsDOC7OdXD5BDceGtVv0wDcH0l2MY+xZmtcsOajveDnsuRU7btiU01LbCZcexgtsGraNwtfiEX2bHHg8F+yU11481v08Vks1I17APdLe0QTeiQh8yk4mllOFP7fDWbsBdFA/pqP+4M95bXPDNPfeodGf6GyBKY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622151086; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=or/eh8JiyYYtY3icK91F33z0GcGlQ51zkDdlbmb5eGw=; b=Pfl4ci8WP9BwuXMDtWS+GYmWqzDA/gEOZh3Iwktepr+6zNMj5F/5i5vN9nH/jbnamP6/28a8qT8YC1+7OZuLlIdZmKzvAQifyHJtcrj2CE9KMPINUDpD4CjlQghE6ThCpyBuLiU1BXT6BmdLYhSl0o8JsQVF/+lwquVDKsk1A3s= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622151086063207.2867096804464; Thu, 27 May 2021 14:31:26 -0700 (PDT) Received: from localhost ([::1]:54660 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNbA-0006Rk-Vk for importer@patchew.org; Thu, 27 May 2021 17:31:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48180) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNPT-0004Et-7I for qemu-devel@nongnu.org; Thu, 27 May 2021 17:19:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:47702) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNPQ-0000Z7-EN for qemu-devel@nongnu.org; Thu, 27 May 2021 17:19:18 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-341-SDg_aURCMzCCK90Wjqhr5g-1; Thu, 27 May 2021 17:19:12 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3B3EBFC99; Thu, 27 May 2021 21:19:11 +0000 (UTC) Received: from scv.redhat.com (ovpn-116-137.rdu2.redhat.com [10.10.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 372CA5D9C6; Thu, 27 May 2021 21:19:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622150355; 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=or/eh8JiyYYtY3icK91F33z0GcGlQ51zkDdlbmb5eGw=; b=AH1ZaQoO0I8xA0Ce7qtgWWN+ypDERrMYJYuRfTQvjMMq6Zk1zUOpRH0VjCkb3I2q3g3Lcw /339RD0qXVX1T4g1n3mwr5MTvuiVKxhsIQhsddmIEiFfL56Q/5haUKuHXqsSDDzWrxq3wP YtrV5IBwQPKFZ7GFc3b2g6biCSHDNgM= X-MC-Unique: SDg_aURCMzCCK90Wjqhr5g-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v8 19/31] python: add excluded dirs to flake8 config Date: Thu, 27 May 2021 17:17:03 -0400 Message-Id: <20210527211715.394144-20-jsnow@redhat.com> In-Reply-To: <20210527211715.394144-1-jsnow@redhat.com> References: <20210527211715.394144-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, 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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Instruct flake8 to avoid certain well-known directories created by python tooling that it ought not check. Note that at-present, nothing actually creates a ".venv" directory; but it is in such widespread usage as a de-facto location for a developer's virtual environment that it should be excluded anyway. A forthcoming commit canonizes this with a "make venv" command. Signed-off-by: John Snow Reviewed-by: Cleber Rosa --- python/setup.cfg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/setup.cfg b/python/setup.cfg index 52a89a0a290..9aeab2bb0d3 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -24,6 +24,8 @@ packages =3D =20 [flake8] extend-ignore =3D E722 # Prefer pylint's bare-except checks to flake8's +exclude =3D __pycache__, + .venv, =20 [pylint.messages control] # Disable the message, report, category or checker with the given id(s). Y= ou --=20 2.31.1 From nobody Thu Nov 14 07:08:09 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 ARC-Seal: i=1; a=rsa-sha256; t=1622151339; cv=none; d=zohomail.com; s=zohoarc; b=TmRHbvrMF1Ez5Ik+k/zGrwTdSWna2gK6nOgzL+GkBwJcehwCfZrRk2lFTRl52M70+aJnXn/UgHpjWPpAIhcUDq5U6bYbKCD64gBfbzW0C2hW5J9KGhZWirNvjYLgV0YycJnicZH6vGiG8TE427u0PhUTT5nPyO9Iah8YST+b9+g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622151339; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=pjH3Bm/vicYfwY4fqAftLei86jM3W6ut8Y93d1ZWXlY=; b=H1AJuOhyhWXzaIiYZk5gOL+GorqeXAmAEvgdwP7X1Wi0STwdhemn4GdU5XnjNcGVAcq/x0fFN6KARDTSA9M75gv3o5flf6QOvQkoLKVtFGTBK8THGG+Vsx4hrd8H1H6aC/u4Yf6YEH0qQ+Xqk9HpFSUJmDKwzAG5NBsEWB0yJBA= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 162215133916821.77649115457939; Thu, 27 May 2021 14:35:39 -0700 (PDT) Received: from localhost ([::1]:41582 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNfG-0008F3-5k for importer@patchew.org; Thu, 27 May 2021 17:35:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48224) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNPV-0004Lw-4U for qemu-devel@nongnu.org; Thu, 27 May 2021 17:19:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:55933) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNPS-0000Zy-Cr for qemu-devel@nongnu.org; Thu, 27 May 2021 17:19:20 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-397-VjnMOSf1OoCrLCBGMJgiSA-1; Thu, 27 May 2021 17:19:16 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EACB2107ACCD; Thu, 27 May 2021 21:19:14 +0000 (UTC) Received: from scv.redhat.com (ovpn-116-137.rdu2.redhat.com [10.10.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 922A05D9C6; Thu, 27 May 2021 21:19:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622150357; 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=pjH3Bm/vicYfwY4fqAftLei86jM3W6ut8Y93d1ZWXlY=; b=crg5ca6T//5GlF1j+PlLJstaJJ+3mfUr5r+5t60489a2vTbGvoDYxOIxKrGQzwuqtYLkLC TkLOGJSwLcI2LJ4FFU0xF46P2rEpsrZBJlSY8DbtgrnXmBqwrUYjyMvaN6KaeSmNcEYLR1 KYU1zZTRZ5HoxErZZbEhIqHkb0gvJJ0= X-MC-Unique: VjnMOSf1OoCrLCBGMJgiSA-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v8 20/31] python: Add flake8 to pipenv Date: Thu, 27 May 2021 17:17:04 -0400 Message-Id: <20210527211715.394144-21-jsnow@redhat.com> In-Reply-To: <20210527211715.394144-1-jsnow@redhat.com> References: <20210527211715.394144-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, 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_H4=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" flake8 3.5.x does not support the --extend-ignore syntax used in the .flake8 file to gracefully extend default ignores, so 3.6.x is our minimum requirement. There is no known upper bound. flake8 can be run from the python/ directory with no arguments. Signed-off-by: John Snow Reviewed-by: Cleber Rosa Tested-by: Cleber Rosa --- python/Pipfile | 1 + python/Pipfile.lock | 51 ++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/python/Pipfile b/python/Pipfile index 285e2c8e671..053f344dcbe 100644 --- a/python/Pipfile +++ b/python/Pipfile @@ -4,6 +4,7 @@ url =3D "https://pypi.org/simple" verify_ssl =3D true =20 [dev-packages] +flake8 =3D ">=3D3.6.0" pylint =3D ">=3D2.8.0" =20 [packages] diff --git a/python/Pipfile.lock b/python/Pipfile.lock index c9debd09503..5c34019060a 100644 --- a/python/Pipfile.lock +++ b/python/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "bd4fb76fcdd145bbf23c3a9dd7ad966113c5ce43ca51cc2d828= aa7e73d572901" + "sha256": "3c842ab9c72c40d24d146349aa144e00e4dec1c358c812cfa96= 489411f5b3f87" }, "pipfile-spec": 6, "requires": { @@ -25,6 +25,22 @@ "markers": "python_version ~=3D '3.6'", "version": "=3D=3D2.5.6" }, + "flake8": { + "hashes": [ + "sha256:07528381786f2a6237b061f6e96610a4167b226cb926e2aa2b= 6b1d78057c576b", + "sha256:bf8fd333346d844f616e8d47905ef3a3384edae6b4e9beb0c5= 101e25e3110907" + ], + "index": "pypi", + "version": "=3D=3D3.9.2" + }, + "importlib-metadata": { + "hashes": [ + "sha256:8c501196e49fb9df5df43833bdb1e4328f64847763ec8a5070= 3148b73784d581", + "sha256:d7eb1dea6d6a6086f8be21784cc9e3bcfa55872b52309bc5fa= d53a8ea444465d" + ], + "markers": "python_version < '3.8'", + "version": "=3D=3D4.0.1" + }, "isort": { "hashes": [ "sha256:0a943902919f65c5684ac4e0154b1ad4fac6dcaa5d9f3426b7= 32f1c8b5419be6", @@ -68,6 +84,22 @@ ], "version": "=3D=3D0.6.1" }, + "pycodestyle": { + "hashes": [ + "sha256:514f76d918fcc0b55c6680472f0a37970994e07bbb80725808= c17089be302068", + "sha256:c389c1d06bf7904078ca03399a4816f974a1d590090fecea0c= 63ec26ebaf1cef" + ], + "markers": "python_version >=3D '2.7' and python_version not i= n '3.0, 3.1, 3.2, 3.3'", + "version": "=3D=3D2.7.0" + }, + "pyflakes": { + "hashes": [ + "sha256:7893783d01b8a89811dd72d7dfd4d84ff098e5eed95cfa8905= b22bbffe52efc3", + "sha256:f5bc8ecabc05bb9d291eb5203d6810b49040f6ff446a756326= 104746cc00c1db" + ], + "markers": "python_version >=3D '2.7' and python_version not i= n '3.0, 3.1, 3.2, 3.3'", + "version": "=3D=3D2.3.1" + }, "pylint": { "hashes": [ "sha256:586d8fa9b1891f4b725f587ef267abe2a1bad89d6b184520c7= f07a253dd6e217", @@ -120,11 +152,28 @@ "markers": "implementation_name =3D=3D 'cpython' and python_ve= rsion < '3.8'", "version": "=3D=3D1.4.3" }, + "typing-extensions": { + "hashes": [ + "sha256:0ac0f89795dd19de6b97debb0c6af1c70987fd80a2d62d1958= f7e56fcc31b497", + "sha256:50b6f157849174217d0656f99dc82fe932884fb250826c1835= 0e159ec6cdf342", + "sha256:779383f6086d90c99ae41cf0ff39aac8a7937a9283ce0a414e= 5dd782f4c94a84" + ], + "markers": "python_version < '3.8'", + "version": "=3D=3D3.10.0.0" + }, "wrapt": { "hashes": [ "sha256:b62ffa81fb85f4332a4f609cab4ac40709470da05643a082ec= 1eb88e6d9b97d7" ], "version": "=3D=3D1.12.1" + }, + "zipp": { + "hashes": [ + "sha256:3607921face881ba3e026887d8150cca609d517579abe052ac= 81fc5aeffdbd76", + "sha256:51cb66cc54621609dd593d1787f286ee42a5c0adbb4b29abea= 5a63edc3e03098" + ], + "markers": "python_version >=3D '3.6'", + "version": "=3D=3D3.4.1" } } } --=20 2.31.1 From nobody Thu Nov 14 07:08:09 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 ARC-Seal: i=1; a=rsa-sha256; t=1622151255; cv=none; d=zohomail.com; s=zohoarc; b=GDT3PoFu3R4hTIlHdAGkAe3BuUeZo2eTbeyTJByFHAuOJaGo3hbg8VY3QL/VO3gATP8LIR8mf2XfE0A5mMCXf7KfDgCMp4HCs0FZqOMwnRkNMv4vkL5yXltt+GP+o6i6MRU2Cv8NSQ1B2BNuLdR1/w3cOEPSU9dY190EKeqQWxo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622151255; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=z+ITUXaJfgH5zRhNwlSNXIMeJ1Qa3cu2XCS6PvhmGJk=; b=gebyp8lgszERoWAAREDS/Hw/t36hP5rPHBftS6vN2hdiQOeMGAflJdczAQ7yGqoNKnjhRDSBrhuBxfMCR8rru8VaPQvo1+r1uirWE3C6MPZ3ByBXbXdN17qyqitDilOOP5DobqC+9yWsRHXkWyIN/PXfvOj5LALzI9y2iF7jv9I= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16221512557931.556392077437863; Thu, 27 May 2021 14:34:15 -0700 (PDT) Received: from localhost ([::1]:35454 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNdu-0004Bc-BH for importer@patchew.org; Thu, 27 May 2021 17:34:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48270) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNPc-0004aV-PN for qemu-devel@nongnu.org; Thu, 27 May 2021 17:19:28 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:47456) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNPb-0000dm-48 for qemu-devel@nongnu.org; Thu, 27 May 2021 17:19:28 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-16-thPXT_z5Nq2k9AXdnCG-6Q-1; Thu, 27 May 2021 17:19:23 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3296C801B19; Thu, 27 May 2021 21:19:22 +0000 (UTC) Received: from scv.redhat.com (ovpn-116-137.rdu2.redhat.com [10.10.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6AAA85D9C6; Thu, 27 May 2021 21:19:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622150366; 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=z+ITUXaJfgH5zRhNwlSNXIMeJ1Qa3cu2XCS6PvhmGJk=; b=V145r3oMfm8qTUkbNSSkxKH/luCHndYBvqnOQrbFpdwBc43Ds21LxCGNXDaDFnJHR/FG9H wntNYSEc/mz9jw5BMOWmC1KaDZerQtk8S/o8UXSn4+gKW6ezYbgzOulnKFFsKm/0fcEe3H EwLqZlvGM8YzVUMrzJIXjZmd2XOtsR4= X-MC-Unique: thPXT_z5Nq2k9AXdnCG-6Q-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v8 21/31] python: move mypy.ini into setup.cfg Date: Thu, 27 May 2021 17:17:05 -0400 Message-Id: <20210527211715.394144-22-jsnow@redhat.com> In-Reply-To: <20210527211715.394144-1-jsnow@redhat.com> References: <20210527211715.394144-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, 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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" mypy supports reading its configuration values from a central project configuration file; do so. Signed-off-by: John Snow Reviewed-by: Cleber Rosa --- python/mypy.ini | 4 ---- python/setup.cfg | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) delete mode 100644 python/mypy.ini diff --git a/python/mypy.ini b/python/mypy.ini deleted file mode 100644 index 1a581c5f1ea..00000000000 --- a/python/mypy.ini +++ /dev/null @@ -1,4 +0,0 @@ -[mypy] -strict =3D True -python_version =3D 3.6 -warn_unused_configs =3D True diff --git a/python/setup.cfg b/python/setup.cfg index 9aeab2bb0d3..bd88b44ad80 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -27,6 +27,11 @@ extend-ignore =3D E722 # Prefer pylint's bare-except ch= ecks to flake8's exclude =3D __pycache__, .venv, =20 +[mypy] +strict =3D True +python_version =3D 3.6 +warn_unused_configs =3D True + [pylint.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 --=20 2.31.1 From nobody Thu Nov 14 07:08:09 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 ARC-Seal: i=1; a=rsa-sha256; t=1622151506; cv=none; d=zohomail.com; s=zohoarc; b=ZOsZ5Ms3uwDSAMsx/kOOvr7nwcbtf+AgGVrp50ctLNzzDqFRIeRGcbCoJhckG2RbfAdn671YgMs3Kk50Uatp3kcsL0oNPLdQa8z3UnTQS7eGwPt+LIUQx9I4draYHsTEBqFoIhWRyHS24QGCMVV3ID+39Vz9tpcApb74+ntIGh8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622151506; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ymJdrBa/TqwXWhVLTk9DyCV/mO8y2xrFXhzo79oKoc0=; b=frVax4GZosdk/ituAFn9Yw/2fkAhd1KlaWSE7Kwnc1pjatrlTEYnhoBJ5Gt4aoBWyxSOsgNrEN0DEHYAjiyyQpnSO9rjiuYJZzSfvtQXrPeb1vx6oW67v0sP9fWpOyT5h0z73sSmtiXerl3P3PIPxY5gOElB5e3E8UINs7+7TmM= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622151506428350.18323236734125; Thu, 27 May 2021 14:38:26 -0700 (PDT) Received: from localhost ([::1]:50276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNhx-0005fu-C0 for importer@patchew.org; Thu, 27 May 2021 17:38:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48310) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNPn-00050i-4m for qemu-devel@nongnu.org; Thu, 27 May 2021 17:19:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:48302) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNPi-0000j7-Tr for qemu-devel@nongnu.org; Thu, 27 May 2021 17:19:38 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-254-wGLvKBthPUKjH2-WCZ41Lw-1; Thu, 27 May 2021 17:19:29 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6D8F91883522; Thu, 27 May 2021 21:19:28 +0000 (UTC) Received: from scv.redhat.com (ovpn-116-137.rdu2.redhat.com [10.10.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7F0EC5D9C6; Thu, 27 May 2021 21:19:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622150373; 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=ymJdrBa/TqwXWhVLTk9DyCV/mO8y2xrFXhzo79oKoc0=; b=GBMAntAmJfYAclFyaM23xWJSzM541O3HJu8y1O12jvOaw1kFFtyAx8GG9KFbLWERE/qdou d0uh05iy5a9K7KSECZSZ+nIjG9MiQ4OH031m/Cd9klLNINoKV/RRV2KklSuRvpkFMpiVi1 F2cb7hOGI23NtI9gbJWylWM1qjdHUNs= X-MC-Unique: wGLvKBthPUKjH2-WCZ41Lw-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v8 22/31] python: add mypy to pipenv Date: Thu, 27 May 2021 17:17:06 -0400 Message-Id: <20210527211715.394144-23-jsnow@redhat.com> In-Reply-To: <20210527211715.394144-1-jsnow@redhat.com> References: <20210527211715.394144-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, 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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 0.730 appears to be about the oldest version that works with the features we want, including nice human readable output (to make sure iotest 297 passes), and type-parameterized Popen generics. 0.770, however, supports adding 'strict' to the config file, so require at least 0.770. Now that we are checking a namespace package, we need to tell mypy to allow PEP420 namespaces, so modify the mypy config as part of the move. mypy can now be run from the python root by typing 'mypy -p qemu'. A note on mypy invocation: Running it as "mypy qemu/" changes the import path detection mechanisms in mypy slightly, and it will fail. See https://github.com/python/mypy/issues/8584 for a decent entry point with more breadcrumbs on the various behaviors that contribute to this subtle difference. Signed-off-by: John Snow Reviewed-by: Cleber Rosa Tested-by: Cleber Rosa --- python/Pipfile | 1 + python/Pipfile.lock | 37 ++++++++++++++++++++++++++++++++++++- python/setup.cfg | 1 + 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/python/Pipfile b/python/Pipfile index 053f344dcbe..796c6282e17 100644 --- a/python/Pipfile +++ b/python/Pipfile @@ -5,6 +5,7 @@ verify_ssl =3D true =20 [dev-packages] flake8 =3D ">=3D3.6.0" +mypy =3D ">=3D0.770" pylint =3D ">=3D2.8.0" =20 [packages] diff --git a/python/Pipfile.lock b/python/Pipfile.lock index 5c34019060a..626e68403f7 100644 --- a/python/Pipfile.lock +++ b/python/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "3c842ab9c72c40d24d146349aa144e00e4dec1c358c812cfa96= 489411f5b3f87" + "sha256": "14d171b3d86759e1fdfb9e55f66be4a696b6afa8f627d6c4778= f8398c6a66b98" }, "pipfile-spec": 6, "requires": { @@ -84,6 +84,41 @@ ], "version": "=3D=3D0.6.1" }, + "mypy": { + "hashes": [ + "sha256:0d0a87c0e7e3a9becdfbe936c981d32e5ee0ccda3e0f07e1ef= 2c3d1a817cf73e", + "sha256:25adde9b862f8f9aac9d2d11971f226bd4c8fbaa89fb76bdad= b267ef22d10064", + "sha256:28fb5479c494b1bab244620685e2eb3c3f988d71fd5d64cc75= 3195e8ed53df7c", + "sha256:2f9b3407c58347a452fc0736861593e105139b905cca7d097e= 413453a1d650b4", + "sha256:33f159443db0829d16f0a8d83d94df3109bb6dd801975fe86b= acb9bf71628e97", + "sha256:3f2aca7f68580dc2508289c729bd49ee929a436208d2b2b6aa= b15745a70a57df", + "sha256:499c798053cdebcaa916eef8cd733e5584b5909f789de856b4= 82cd7d069bdad8", + "sha256:4eec37370483331d13514c3f55f446fc5248d6373e7029a29e= cb7b7494851e7a", + "sha256:552a815579aa1e995f39fd05dde6cd378e191b063f031f2acf= e73ce9fb7f9e56", + "sha256:5873888fff1c7cf5b71efbe80e0e73153fe9212fafdf8e44ad= fe4c20ec9f82d7", + "sha256:61a3d5b97955422964be6b3baf05ff2ce7f26f52c85dd88db1= 1d5e03e146a3a6", + "sha256:674e822aa665b9fd75130c6c5f5ed9564a38c6cea6a6432ce4= 7eafb68ee578c5", + "sha256:7ce3175801d0ae5fdfa79b4f0cfed08807af4d075b402b7e29= 4e6aa72af9aa2a", + "sha256:9743c91088d396c1a5a3c9978354b61b0382b4e3c440ce83cf= 77994a43e8c521", + "sha256:9f94aac67a2045ec719ffe6111df543bac7874cee01f41928f= 6969756e030564", + "sha256:a26f8ec704e5a7423c8824d425086705e381b4f1dfdef6e3a1= edab7ba174ec49", + "sha256:abf7e0c3cf117c44d9285cc6128856106183938c68fd494476= 3003decdcfeb66", + "sha256:b09669bcda124e83708f34a94606e01b614fa71931d356c1f1= a5297ba11f110a", + "sha256:cd07039aa5df222037005b08fbbfd69b3ab0b0bd7a07d7906d= e75ae52c4e3119", + "sha256:d23e0ea196702d918b60c8288561e722bf437d82cb7ef2edcd= 98cfa38905d506", + "sha256:d65cc1df038ef55a99e617431f0553cd77763869eebdf90424= 03e16089fe746c", + "sha256:d7da2e1d5f558c37d6e8c1246f1aec1e7349e4913d8fb3cb28= 9a35de573fe2eb" + ], + "index": "pypi", + "version": "=3D=3D0.812" + }, + "mypy-extensions": { + "hashes": [ + "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a= 299250a846f15d", + "sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5= 343488a6c604a8" + ], + "version": "=3D=3D0.4.3" + }, "pycodestyle": { "hashes": [ "sha256:514f76d918fcc0b55c6680472f0a37970994e07bbb80725808= c17089be302068", diff --git a/python/setup.cfg b/python/setup.cfg index bd88b44ad80..b485d6161d5 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -31,6 +31,7 @@ exclude =3D __pycache__, strict =3D True python_version =3D 3.6 warn_unused_configs =3D True +namespace_packages =3D True =20 [pylint.messages control] # Disable the message, report, category or checker with the given id(s). Y= ou --=20 2.31.1 From nobody Thu Nov 14 07:08:09 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 ARC-Seal: i=1; a=rsa-sha256; t=1622151379; cv=none; d=zohomail.com; s=zohoarc; b=X0eAcJ/8GpodqSFdrki4jnLc5WMBOcvuMsSEKEtXSRxkhj3XObc18YZ/olD28E/IEQUG2CmDiP/OzZr/qZv5jeW2qheo0EDyXkYGZHGRmO1wd4cxUSWd9c9fRJE78yhlIs2fz36iCCAMLiQeewRwf7AOLA1uhbTv/CbB5aYRXKs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622151379; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZSZkyaIfg+owNYzDVBGmzqkPY0IZHdustND/oPCsHhA=; b=hqASBtViJF6ddiAJLCLzEhMWRn5ov/KnMAJyMI99Fjyb7wLT1pK+ohXoYmbEuxYQ5sk+In5lVxPJ9hzI2U1F9IFDWUllt+TY5p3ezwGXNr2ZH9CgBO27AAIFhSalzfDGDOsKiaPhd3QfrIkrh1F5OH57y9PArYV/sNFrDZEFEQk= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 162215137909365.37163421330865; Thu, 27 May 2021 14:36:19 -0700 (PDT) Received: from localhost ([::1]:44028 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNft-0001Q6-VU for importer@patchew.org; Thu, 27 May 2021 17:36:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48350) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNPt-00053j-Bo for qemu-devel@nongnu.org; Thu, 27 May 2021 17:19:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:56496) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNPl-0000kO-8V for qemu-devel@nongnu.org; Thu, 27 May 2021 17:19:45 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-290-bP9LVXQMNs64WJFV_fpX7g-1; Thu, 27 May 2021 17:19:33 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9F4EF800D55; Thu, 27 May 2021 21:19:32 +0000 (UTC) Received: from scv.redhat.com (ovpn-116-137.rdu2.redhat.com [10.10.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id BF3025D9C6; Thu, 27 May 2021 21:19:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622150375; 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=ZSZkyaIfg+owNYzDVBGmzqkPY0IZHdustND/oPCsHhA=; b=e7rYxXWwb49Ue44F0LbVW6vqISwhJqIu7GIt1B/d/S30R/ItwxlBMBJz8gBc6n4MBN/NxX ++qoSUWGofHztxm48goHeMUt0NF0tcU5DLqslYQ8+QkhG6snColgv9I264AirqVRA8RN4u ocOvUTOw5d4EZVrc3yTVrn/WB7GuwQg= X-MC-Unique: bP9LVXQMNs64WJFV_fpX7g-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v8 23/31] python: move .isort.cfg into setup.cfg Date: Thu, 27 May 2021 17:17:07 -0400 Message-Id: <20210527211715.394144-24-jsnow@redhat.com> In-Reply-To: <20210527211715.394144-1-jsnow@redhat.com> References: <20210527211715.394144-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, 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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Signed-off-by: John Snow Reviewed-by: Cleber Rosa --- python/.isort.cfg | 7 ------- python/setup.cfg | 8 ++++++++ 2 files changed, 8 insertions(+), 7 deletions(-) delete mode 100644 python/.isort.cfg diff --git a/python/.isort.cfg b/python/.isort.cfg deleted file mode 100644 index 6d0fd6cc0d3..00000000000 --- a/python/.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 \ No newline at end of file diff --git a/python/setup.cfg b/python/setup.cfg index b485d6161d5..3f07bd2752d 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -61,3 +61,11 @@ good-names=3Di, [pylint.similarities] # Ignore imports when computing similarities. ignore-imports=3Dyes + +[isort] +force_grid_wrap=3D4 +force_sort_within_sections=3DTrue +include_trailing_comma=3DTrue +line_length=3D72 +lines_after_imports=3D2 +multi_line_output=3D3 --=20 2.31.1 From nobody Thu Nov 14 07:08:09 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 ARC-Seal: i=1; a=rsa-sha256; t=1622151588; cv=none; d=zohomail.com; s=zohoarc; b=XejgTsSXgMGyxUGysRqhoLeaxEr5iH/Gkro1EkmQ2MMvCpuQVaEnYQhkn5QF0N2TWM3+U/D4QdZ83My9Bc5R+4hRaSXeH7Uz0WKZ7c1nf0e8FaOMGkgk736VRElD/aqRKCQwsAc2cLu0JM5hHEe5RpI2uTSeJv3+yixqn/ckr+0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622151588; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=VMM4zsokxayNHrvGvB1/6QODbH68WwAV6q7/6X3N/uU=; b=BziEeFOlfCf5aAsOcz+pe2/Qt8+66BMBQuyGLP/tqtTKLNqTKxi1wIqokJVHF/afkWsjqVjxb0gHNrIv2wRpVSSoK+XBiJdzYH/A7C/pigLN1rZSnto81MRW414c4wEPToqnZx46fshmfzqJcofE2Rj6AZO262Z/il54xh6EFyI= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622151588498845.1120809875488; Thu, 27 May 2021 14:39:48 -0700 (PDT) Received: from localhost ([::1]:55688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNjH-0000ql-28 for importer@patchew.org; Thu, 27 May 2021 17:39:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48394) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNPw-0005DQ-HS for qemu-devel@nongnu.org; Thu, 27 May 2021 17:19:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:30529) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNPn-0000nr-MX for qemu-devel@nongnu.org; Thu, 27 May 2021 17:19:48 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-18-TzdVK856OReXMskQHwJK0A-1; Thu, 27 May 2021 17:19:37 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 86441801B12; Thu, 27 May 2021 21:19:36 +0000 (UTC) Received: from scv.redhat.com (ovpn-116-137.rdu2.redhat.com [10.10.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 00CE65D9C6; Thu, 27 May 2021 21:19:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622150379; 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=VMM4zsokxayNHrvGvB1/6QODbH68WwAV6q7/6X3N/uU=; b=azqnT2niX+i2S7zV34aUAyH2RtJlglJDdlFw4PWG2unPFX2uh9v6iO4pKZ3YpwI9IhVJK3 kpJL8wt1BtYLJe0FZu6ftfMKt6YOjH49BwBLZnm6nw8RaFcF2ITDJrsHzwlhVLuaVG3k3k HywMYnH7p2GzCmsE/CXfn05qzCmZkTg= X-MC-Unique: TzdVK856OReXMskQHwJK0A-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v8 24/31] python/qemu: add isort to pipenv Date: Thu, 27 May 2021 17:17:08 -0400 Message-Id: <20210527211715.394144-25-jsnow@redhat.com> In-Reply-To: <20210527211715.394144-1-jsnow@redhat.com> References: <20210527211715.394144-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, 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_H4=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" isort 5.0.0 through 5.0.4 has a bug that causes it to misinterpret certain "from ..." clauses that are not related to imports. isort < 5.1.1 has a bug where it does not handle comments near import statements correctly. Require 5.1.2 or greater. isort can be run (in "check" mode) with 'isort -c qemu' from the python root. isort can also be used to fix/rewrite import order automatically by using 'isort qemu'. Signed-off-by: John Snow Reviewed-by: Cleber Rosa --- python/Pipfile | 1 + python/Pipfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/python/Pipfile b/python/Pipfile index 796c6282e17..79c74dd8db4 100644 --- a/python/Pipfile +++ b/python/Pipfile @@ -5,6 +5,7 @@ verify_ssl =3D true =20 [dev-packages] flake8 =3D ">=3D3.6.0" +isort =3D ">=3D5.1.2" mypy =3D ">=3D0.770" pylint =3D ">=3D2.8.0" =20 diff --git a/python/Pipfile.lock b/python/Pipfile.lock index 626e68403f7..57a5befb104 100644 --- a/python/Pipfile.lock +++ b/python/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "14d171b3d86759e1fdfb9e55f66be4a696b6afa8f627d6c4778= f8398c6a66b98" + "sha256": "8173290ad57aab0b722c9b4f109519de4e0dd7cd1bad1e16806= b78bb169bce08" }, "pipfile-spec": 6, "requires": { @@ -46,7 +46,7 @@ "sha256:0a943902919f65c5684ac4e0154b1ad4fac6dcaa5d9f3426b7= 32f1c8b5419be6", "sha256:2bb1680aad211e3c9944dbce1d4ba09a989f04e238296c87fe= 2139faa26d655d" ], - "markers": "python_version >=3D '3.6' and python_version < '4.= 0'", + "index": "pypi", "version": "=3D=3D5.8.0" }, "lazy-object-proxy": { --=20 2.31.1 From nobody Thu Nov 14 07:08:09 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 ARC-Seal: i=1; a=rsa-sha256; t=1622151315; cv=none; d=zohomail.com; s=zohoarc; b=HNnrUiGVV3ivYkJYT1JWexfIzAoy1uWhc1r1Fq9owN0fLehZA7w2ups3BAB3fkbMDAj6/ZzGl4rU99KKFbaOfklRfCRXtJxAAgNhuUEVxJ6zGeIDIy5tet7GHU06VmAUVmDVklSM1W6o8CiIfpJpTwSedMt8F00gbhMThAsjOpA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622151315; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vP2VKqjp4c9V9DK38PD7pZIWB1mo2HRszZC3KA25sGA=; b=NQH+MEZ7Mmgc3C1peff7hERmK6wHKmfJuwDKxGZBn2dqTPxX3lOMPSpp5HOQNJPmTJ/Nc1vbIZsoHuw2nNwjAReaYqXjt/OxVuX4hSiMR+fZUaRoMRIMk6LQfHhImrCpXsI7koNFdgd2Q5Hs2l4TGGe1STompAbgkUSOu8V5eKA= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622151315763773.4353828736408; Thu, 27 May 2021 14:35:15 -0700 (PDT) Received: from localhost ([::1]:40264 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNes-0007ML-Ko for importer@patchew.org; Thu, 27 May 2021 17:35:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48390) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNPw-0005CS-BT for qemu-devel@nongnu.org; Thu, 27 May 2021 17:19:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:52469) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNPu-0000qM-82 for qemu-devel@nongnu.org; Thu, 27 May 2021 17:19:47 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-82-N0cyNR-sMhWDclw0K4WESg-1; Thu, 27 May 2021 17:19:43 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ED6CC106BB2A; Thu, 27 May 2021 21:19:42 +0000 (UTC) Received: from scv.redhat.com (ovpn-116-137.rdu2.redhat.com [10.10.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id E62F55D9C6; Thu, 27 May 2021 21:19:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622150385; 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=vP2VKqjp4c9V9DK38PD7pZIWB1mo2HRszZC3KA25sGA=; b=X8Cyla64xsXuPoDvHWKDxYPCCNNDIHD9Bn3hh+IKb045fBhon2sNtCdWU+npThySyl5ZLi 1dijprt2XovYExOA091VAyZ0UzN1NxlPz/mLb48A2scSvYE2v7TEBa0zSjjN+M9fDHsgs/ uHGW7JYZsVYJprFl8brSguL7y7uklGM= X-MC-Unique: N0cyNR-sMhWDclw0K4WESg-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v8 25/31] python/qemu: add qemu package itself to pipenv Date: Thu, 27 May 2021 17:17:09 -0400 Message-Id: <20210527211715.394144-26-jsnow@redhat.com> In-Reply-To: <20210527211715.394144-1-jsnow@redhat.com> References: <20210527211715.394144-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, 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_H4=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This adds the python qemu packages themselves to the pipenv manifest. 'pipenv sync' will create a virtual environment sufficient to use the SDK. 'pipenv sync --dev' will create a virtual environment sufficient to use and test the SDK (with pylint, mypy, isort, flake8, etc.) The qemu packages are installed in 'editable' mode; all changes made to the python package inside the git tree will be reflected in the installed package without reinstallation. This includes changes made via git pull and so on. Signed-off-by: John Snow Reviewed-by: Cleber Rosa Tested-by: Cleber Rosa --- python/Pipfile | 1 + python/Pipfile.lock | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/python/Pipfile b/python/Pipfile index 79c74dd8db4..dbe96f71c48 100644 --- a/python/Pipfile +++ b/python/Pipfile @@ -10,6 +10,7 @@ mypy =3D ">=3D0.770" pylint =3D ">=3D2.8.0" =20 [packages] +qemu =3D {editable =3D true,path =3D "."} =20 [requires] python_version =3D "3.6" diff --git a/python/Pipfile.lock b/python/Pipfile.lock index 57a5befb104..f0bf576c31e 100644 --- a/python/Pipfile.lock +++ b/python/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "8173290ad57aab0b722c9b4f109519de4e0dd7cd1bad1e16806= b78bb169bce08" + "sha256": "7c74cc4c2db3a75c954a6686411cda6fd60e464620bb6d5f1ed= 9a54be61db4cc" }, "pipfile-spec": 6, "requires": { @@ -15,7 +15,12 @@ } ] }, - "default": {}, + "default": { + "qemu": { + "editable": true, + "path": "." + } + }, "develop": { "astroid": { "hashes": [ --=20 2.31.1 From nobody Thu Nov 14 07:08:09 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 ARC-Seal: i=1; a=rsa-sha256; t=1622151708; cv=none; d=zohomail.com; s=zohoarc; b=YSBwf5kBnLt3uyoilnLvPHCrgtyDWz9+c2PBTtsOuM0u1pX8Z+AUZMePFdkf9hHpvWgnK9lyIKR2KMbY5Zys12G4rvH9i0VnuAcoaJlPGp13ov9GPh3jJsBhHyg32Q+itVKN3oA6Ntv8PdUcAExK3T+E03ReHCHq6GVtm8UY5rY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622151708; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=XxK27A8uGJHXHRr5a0MJcH6qpSAC07DUgdR0j1cQcKA=; b=mOJs1z/xrge3T78c9rkma1VyTwODY+GhXxKLCkX5eLFNH9OEVJPr8zxp5jtb9L2WXRblmVBMJmDLK3Qn8th+nMznghqFaiVziJM+XgPuOeRP4WdLW+kOah8niKcnF5pfibE/uEVYMdk280peCtsWeHYh0JKsDWBziqCI+TtybXA= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622151708647119.50211471335649; Thu, 27 May 2021 14:41:48 -0700 (PDT) Received: from localhost ([::1]:60712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNlD-0004DW-NG for importer@patchew.org; Thu, 27 May 2021 17:41:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48452) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNQ9-0005SJ-JE for qemu-devel@nongnu.org; Thu, 27 May 2021 17:20:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:56464) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNQ5-0000vP-U2 for qemu-devel@nongnu.org; Thu, 27 May 2021 17:20:01 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-3-yEG0cVsMNaumGG4xihc0jg-1; Thu, 27 May 2021 17:19:50 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7E0691883520; Thu, 27 May 2021 21:19:49 +0000 (UTC) Received: from scv.redhat.com (ovpn-116-137.rdu2.redhat.com [10.10.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4BE3D5D9C6; Thu, 27 May 2021 21:19:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622150392; 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=XxK27A8uGJHXHRr5a0MJcH6qpSAC07DUgdR0j1cQcKA=; b=HnAJWvi1INCTwgbZ30PjFWIgGFqv2wiwHJ+EhLLGdB/1Po5ZUNpX3T7yjjUljO6v5heRv0 goiF6zdl3Hqwh/tAeNuXLLSOwaQ0E0jVDzj0pfKodZZStXIuSySedSp48w7LR/RS0U0U7a E2Dg8gqxbTQYFCW578g14tdoeNkz2S8= X-MC-Unique: yEG0cVsMNaumGG4xihc0jg-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v8 26/31] python: add devel package requirements to setuptools Date: Thu, 27 May 2021 17:17:10 -0400 Message-Id: <20210527211715.394144-27-jsnow@redhat.com> In-Reply-To: <20210527211715.394144-1-jsnow@redhat.com> References: <20210527211715.394144-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, 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_H4=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" setuptools doesn't have a formal understanding of development requires, but it has an optional feataures section. Fine; add a "devel" feature and add the requirements to it. To avoid duplication, we can modify pipenv to install qemu[devel] instead. This enables us to run invocations like "pip install -e .[devel]" and test the package on bleeding-edge packages beyond those specified in Pipfile.lock. Importantly, this also allows us to install the qemu development packages in a non-networked mode: `pip3 install --no-index -e .[devel]` will now fail if the proper development dependencies are not already met. This can be useful for automated build scripts where fetching network packages may be undesirable. Signed-off-by: John Snow Reviewed-by: Cleber Rosa --- python/PACKAGE.rst | 4 ++++ python/README.rst | 4 ++++ python/Pipfile | 5 +---- python/Pipfile.lock | 14 +++++++++----- python/setup.cfg | 9 +++++++++ 5 files changed, 27 insertions(+), 9 deletions(-) diff --git a/python/PACKAGE.rst b/python/PACKAGE.rst index 1bbfe1b58e2..05ea7789fc1 100644 --- a/python/PACKAGE.rst +++ b/python/PACKAGE.rst @@ -31,3 +31,7 @@ official `GitLab mirror `_. Please report bugs on the `QEMU issue tracker `_ and tag ``@jsnow`` in the report. + +Optional packages necessary for running code quality analysis for this +package can be installed with the optional dependency group "devel": +``pip install qemu[devel]``. diff --git a/python/README.rst b/python/README.rst index bf9bbca979a..954870973d0 100644 --- a/python/README.rst +++ b/python/README.rst @@ -24,6 +24,10 @@ which installs a version of the package that installs a = forwarder pointing to these files, such that the package always reflects the latest version in your git tree. =20 +Installing ".[devel]" instead of "." will additionally pull in required +packages for testing this package. They are not runtime requirements, +and are not needed to simply use these libraries. + See `Installing packages using pip and virtual environments `_ for more information. diff --git a/python/Pipfile b/python/Pipfile index dbe96f71c48..e7acb8cefa4 100644 --- a/python/Pipfile +++ b/python/Pipfile @@ -4,10 +4,7 @@ url =3D "https://pypi.org/simple" verify_ssl =3D true =20 [dev-packages] -flake8 =3D ">=3D3.6.0" -isort =3D ">=3D5.1.2" -mypy =3D ">=3D0.770" -pylint =3D ">=3D2.8.0" +qemu =3D {editable =3D true, extras =3D ["devel"], path =3D "."} =20 [packages] qemu =3D {editable =3D true,path =3D "."} diff --git a/python/Pipfile.lock b/python/Pipfile.lock index f0bf576c31e..a2cdc1c50ea 100644 --- a/python/Pipfile.lock +++ b/python/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "7c74cc4c2db3a75c954a6686411cda6fd60e464620bb6d5f1ed= 9a54be61db4cc" + "sha256": "eff562a688ebc6f3ffe67494dbb804b883e2159ad81c4d55d96= da9f7aec13e91" }, "pipfile-spec": 6, "requires": { @@ -35,7 +35,7 @@ "sha256:07528381786f2a6237b061f6e96610a4167b226cb926e2aa2b= 6b1d78057c576b", "sha256:bf8fd333346d844f616e8d47905ef3a3384edae6b4e9beb0c5= 101e25e3110907" ], - "index": "pypi", + "markers": "python_version >=3D '2.7' and python_version not i= n '3.0, 3.1, 3.2, 3.3, 3.4'", "version": "=3D=3D3.9.2" }, "importlib-metadata": { @@ -51,7 +51,7 @@ "sha256:0a943902919f65c5684ac4e0154b1ad4fac6dcaa5d9f3426b7= 32f1c8b5419be6", "sha256:2bb1680aad211e3c9944dbce1d4ba09a989f04e238296c87fe= 2139faa26d655d" ], - "index": "pypi", + "markers": "python_version >=3D '3.6' and python_version < '4.= 0'", "version": "=3D=3D5.8.0" }, "lazy-object-proxy": { @@ -114,7 +114,7 @@ "sha256:d65cc1df038ef55a99e617431f0553cd77763869eebdf90424= 03e16089fe746c", "sha256:d7da2e1d5f558c37d6e8c1246f1aec1e7349e4913d8fb3cb28= 9a35de573fe2eb" ], - "index": "pypi", + "markers": "python_version >=3D '3.5'", "version": "=3D=3D0.812" }, "mypy-extensions": { @@ -145,9 +145,13 @@ "sha256:586d8fa9b1891f4b725f587ef267abe2a1bad89d6b184520c7= f07a253dd6e217", "sha256:f7e2072654a6b6afdf5e2fb38147d3e2d2d43c89f648637baa= b63e026481279b" ], - "index": "pypi", + "markers": "python_version ~=3D '3.6'", "version": "=3D=3D2.8.2" }, + "qemu": { + "editable": true, + "path": "." + }, "toml": { "hashes": [ "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894= a5f779cabb4f9b", diff --git a/python/setup.cfg b/python/setup.cfg index 3f07bd2752d..39dc135e601 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -22,6 +22,15 @@ packages =3D qemu.machine qemu.utils =20 +[options.extras_require] +# Run `pipenv lock --dev` when changing these requirements. +devel =3D + flake8 >=3D 3.6.0 + isort >=3D 5.1.2 + mypy >=3D 0.770 + pylint >=3D 2.8.0 + + [flake8] extend-ignore =3D E722 # Prefer pylint's bare-except checks to flake8's exclude =3D __pycache__, --=20 2.31.1 From nobody Thu Nov 14 07:08:09 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 ARC-Seal: i=1; a=rsa-sha256; t=1622151049; cv=none; d=zohomail.com; s=zohoarc; b=m6gJB8Ph7B/VhHPq7mYECFVBUESxETi8nCInp8ZHLv+ebuaDbUhC+TQV1aUMDN8Fo1FJ74DeuPWxx1QfMnNJCSofri1xGjSUsjrgVE/mOXQ+hUQ7UnJ1XzTNDhcofADJI6LaiwSBj37arettkWKKk+v3trbX5JM5jR6tE8LSyTQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622151049; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cRCyYETljKvt6FPVb1sv2T3S3cerBA1fznZQ5FwYjEk=; b=Ndv7MKbN+ChsAkY4h6AcmBRiISf46HegK7/zOvwYPNJj+QKyLSc7naxMVuCBYidOry6Idhd/WDEjvpkkNeE5lwU+KDuZZ6w4ozTgy4E3Vk7bLHngT5aTscMo84hDi70DYd6sxlS/sIldLziq8NG4PAjNgzn0OEclq0yihAhiF+Y= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622151049478941.132509041047; Thu, 27 May 2021 14:30:49 -0700 (PDT) Received: from localhost ([::1]:52880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNaa-0005AY-8e for importer@patchew.org; Thu, 27 May 2021 17:30:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48492) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNQB-0005Uz-Cn for qemu-devel@nongnu.org; Thu, 27 May 2021 17:20:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:52786) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNQ6-0000wg-9E for qemu-devel@nongnu.org; Thu, 27 May 2021 17:20:03 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-444-kWPwhFKSNHa57OirU_Fbhg-1; Thu, 27 May 2021 17:19:53 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9407D801B13; Thu, 27 May 2021 21:19:52 +0000 (UTC) Received: from scv.redhat.com (ovpn-116-137.rdu2.redhat.com [10.10.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id CF6B65D9C6; Thu, 27 May 2021 21:19:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622150395; 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=cRCyYETljKvt6FPVb1sv2T3S3cerBA1fznZQ5FwYjEk=; b=M66C272KDcmrzpCFmuFZ4o4UYAlVwdZWOgfW0AMM3stn04xPJEJhB2/thaDrLj1NnUbOIH boL0qBlOxkTLamr9w5DAlgG/T76yrtrGP6DGLU1DkofO+Qs8fmY9D8YlPlIwKcMX/jGpAj VIKoAbfqWzuULy4wuOJs0i23s0gn2cM= X-MC-Unique: kWPwhFKSNHa57OirU_Fbhg-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v8 27/31] python: add avocado-framework and tests Date: Thu, 27 May 2021 17:17:11 -0400 Message-Id: <20210527211715.394144-28-jsnow@redhat.com> In-Reply-To: <20210527211715.394144-1-jsnow@redhat.com> References: <20210527211715.394144-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, 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_H4=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Try using avocado to manage our various tests; even though right now they're only invoking shell scripts and not really running any python-native code. Create tests/, and add shell scripts which call out to mypy, flake8, pylint and isort to enforce the standards in this directory. Add avocado-framework to the setup.cfg development dependencies, and add avocado.cfg to store some preferences for how we'd like the test output to look. Finally, add avocado-framework to the Pipfile environment and lock the new dependencies. We are using avocado >=3D 87.0 here to take advantage of some features that Cleber has helpfully added to make the test output here *very* friendly and easy to read for developers that might chance upon the output in Gitlab CI. [Note: ALL of the dependencies get updated to the most modern versions that exist at the time of this writing. No way around it that I have seen. Not ideal, but so it goes.] Provided you have the right development dependencies (mypy, flake8, isort, pylint, and now avocado-framework) You should be able to run "avocado --config avocado.cfg run tests/" from the python folder to run all of these linters with the correct arguments. (A forthcoming commit adds the much easier 'make check'.) Signed-off-by: John Snow Reviewed-by: Cleber Rosa Tested-by: Cleber Rosa --- python/README.rst | 2 ++ python/Pipfile.lock | 8 ++++++++ python/avocado.cfg | 10 ++++++++++ python/setup.cfg | 1 + python/tests/flake8.sh | 2 ++ python/tests/isort.sh | 2 ++ python/tests/mypy.sh | 2 ++ python/tests/pylint.sh | 2 ++ 8 files changed, 29 insertions(+) create mode 100644 python/avocado.cfg create mode 100755 python/tests/flake8.sh create mode 100755 python/tests/isort.sh create mode 100755 python/tests/mypy.sh create mode 100755 python/tests/pylint.sh diff --git a/python/README.rst b/python/README.rst index 954870973d0..6bd2c6b3547 100644 --- a/python/README.rst +++ b/python/README.rst @@ -37,6 +37,8 @@ Files in this directory ----------------------- =20 - ``qemu/`` Python package source directory. +- ``tests/`` Python package tests directory. +- ``avocado.cfg`` Configuration for the Avocado test-runner. - ``MANIFEST.in`` is read by python setuptools, it specifies additional fi= les that should be included by a source distribution. - ``PACKAGE.rst`` is used as the README file that is visible on PyPI.org. diff --git a/python/Pipfile.lock b/python/Pipfile.lock index a2cdc1c50ea..6e344f5fadf 100644 --- a/python/Pipfile.lock +++ b/python/Pipfile.lock @@ -30,6 +30,14 @@ "markers": "python_version ~=3D '3.6'", "version": "=3D=3D2.5.6" }, + "avocado-framework": { + "hashes": [ + "sha256:42aa7962df98d6b78d4efd9afa2177226dc630f3d83a2a7d5b= af7a0a7da7fa1b", + "sha256:d96ae343abf890e1ef3b3a6af5ce49e35f6bded0715770c4ac= b325bca555c515" + ], + "markers": "python_version >=3D '3.6'", + "version": "=3D=3D88.1" + }, "flake8": { "hashes": [ "sha256:07528381786f2a6237b061f6e96610a4167b226cb926e2aa2b= 6b1d78057c576b", diff --git a/python/avocado.cfg b/python/avocado.cfg new file mode 100644 index 00000000000..10dc6fb6054 --- /dev/null +++ b/python/avocado.cfg @@ -0,0 +1,10 @@ +[simpletests] +# Don't show stdout/stderr in the test *summary* +status.failure_fields =3D ['status'] + +[job] +# Don't show the full debug.log output; only select stdout/stderr. +output.testlogs.logfiles =3D ['stdout', 'stderr'] + +# Show full stdout/stderr only on tests that FAIL +output.testlogs.statuses =3D ['FAIL'] diff --git a/python/setup.cfg b/python/setup.cfg index 39dc135e601..fd325194901 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -25,6 +25,7 @@ packages =3D [options.extras_require] # Run `pipenv lock --dev` when changing these requirements. devel =3D + avocado-framework >=3D 87.0 flake8 >=3D 3.6.0 isort >=3D 5.1.2 mypy >=3D 0.770 diff --git a/python/tests/flake8.sh b/python/tests/flake8.sh new file mode 100755 index 00000000000..51e0788462b --- /dev/null +++ b/python/tests/flake8.sh @@ -0,0 +1,2 @@ +#!/bin/sh -e +python3 -m flake8 diff --git a/python/tests/isort.sh b/python/tests/isort.sh new file mode 100755 index 00000000000..4480405bfb0 --- /dev/null +++ b/python/tests/isort.sh @@ -0,0 +1,2 @@ +#!/bin/sh -e +python3 -m isort -c qemu/ diff --git a/python/tests/mypy.sh b/python/tests/mypy.sh new file mode 100755 index 00000000000..5f980f563bb --- /dev/null +++ b/python/tests/mypy.sh @@ -0,0 +1,2 @@ +#!/bin/sh -e +python3 -m mypy -p qemu diff --git a/python/tests/pylint.sh b/python/tests/pylint.sh new file mode 100755 index 00000000000..4b10b34db7c --- /dev/null +++ b/python/tests/pylint.sh @@ -0,0 +1,2 @@ +#!/bin/sh -e +python3 -m pylint qemu/ --=20 2.31.1 From nobody Thu Nov 14 07:08: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 ARC-Seal: i=1; a=rsa-sha256; t=1622151223; cv=none; d=zohomail.com; s=zohoarc; b=nQ5KUP4HARcJcYYu2G0gXcYpptj+3Cmg9Q2xKGKm2igYP0dyHbro6i/PODn+so+5UuSe9BgbXmCDrmGZ210qJUwAoruIONNd3HzXer9omUvPYZ9J5vvCXfxGdZnULJAq4yDGwM+r0hqw4fpaHTAbP76Sf/SNtsHY7gtUoIorSUo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622151223; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=WQS1f8vvqFGWSyLNNu8yrUY0pHzJjMlAp9ZKGROTfpQ=; b=Uju1V4Zb0i6pEoyFbBtIZRXysAhzsOi5fGzy5QMtuQPjIVkcrgTWOGeCgoX0hC0mUBz8m2xse9MLz+g4qiB9Mrr1/O5n+Ah9NZFL6LRhANFDYJtbkBLIntP8GJrb3LB9r5BvhYgLq4BGm2+Y7qmFUxuJ8FEhX5BmNuaJLk1tPNQ= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16221512239501023.2760715565671; Thu, 27 May 2021 14:33:43 -0700 (PDT) Received: from localhost ([::1]:33062 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNdO-0002YG-Pd for importer@patchew.org; Thu, 27 May 2021 17:33:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48506) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNQD-0005XH-A3 for qemu-devel@nongnu.org; Thu, 27 May 2021 17:20:05 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:40036) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNQ9-0000zD-S4 for qemu-devel@nongnu.org; Thu, 27 May 2021 17:20:04 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-479-mnOU7payOzar37WTM5J7yw-1; Thu, 27 May 2021 17:19:57 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7C693801B12; Thu, 27 May 2021 21:19:56 +0000 (UTC) Received: from scv.redhat.com (ovpn-116-137.rdu2.redhat.com [10.10.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2870D5D9C6; Thu, 27 May 2021 21:19:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622150401; 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=WQS1f8vvqFGWSyLNNu8yrUY0pHzJjMlAp9ZKGROTfpQ=; b=HK+jGQl4nnmqCvLVM12a3T2nQ6Bly/XhxK4sbjT7jFpm9Lg2qFFDp3uCi4Y6zMGs2ccngL HC1SdK39dTUYkiPfO8jyoi7jok8qikZo+/f5z68mzZaFJtljHbBtyKvTqhwsKjQnKg2DpI hjYkZPtVZMHz/8iRRi+OE0J7K1UG0Hc= X-MC-Unique: mnOU7payOzar37WTM5J7yw-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v8 28/31] python: add Makefile for some common tasks Date: Thu, 27 May 2021 17:17:12 -0400 Message-Id: <20210527211715.394144-29-jsnow@redhat.com> In-Reply-To: <20210527211715.394144-1-jsnow@redhat.com> References: <20210527211715.394144-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, 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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Add "make venv" to create the pipenv-managed virtual environment that contains our explicitly pinned dependencies. Add "make check" to run the python linters [in the host execution environment]. Add "make venv-check" which combines the above two: create/update the venv, then run the linters in that explicitly managed environment. Add "make develop" which canonizes the runes needed to get both the linting pre-requisites (the "[devel]" part), and the editable live-install (the "-e" part) of these python libraries. make clean: delete miscellaneous python packaging output possibly created by pipenv, pip, or other python packaging utilities make distclean: delete the above, the .venv, and the editable "qemu" package forwarder (qemu.egg-info) if there is one. Signed-off-by: John Snow Reviewed-by: Cleber Rosa Tested-by: Cleber Rosa --- python/PACKAGE.rst | 6 ++++++ python/README.rst | 6 ++++++ python/Makefile | 43 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 python/Makefile diff --git a/python/PACKAGE.rst b/python/PACKAGE.rst index 05ea7789fc1..b0b86cc4c31 100644 --- a/python/PACKAGE.rst +++ b/python/PACKAGE.rst @@ -35,3 +35,9 @@ the report. Optional packages necessary for running code quality analysis for this package can be installed with the optional dependency group "devel": ``pip install qemu[devel]``. + +``make develop`` can be used to install this package in editable mode +(to the current environment) *and* bring in testing dependencies in one +command. + +``make check`` can be used to run the available tests. diff --git a/python/README.rst b/python/README.rst index 6bd2c6b3547..dcf993819db 100644 --- a/python/README.rst +++ b/python/README.rst @@ -28,6 +28,9 @@ Installing ".[devel]" instead of "." will additionally pu= ll in required packages for testing this package. They are not runtime requirements, and are not needed to simply use these libraries. =20 +Running ``make develop`` will pull in all testing dependencies and +install QEMU in editable mode to the current environment. + See `Installing packages using pip and virtual environments `_ for more information. @@ -39,6 +42,9 @@ Files in this directory - ``qemu/`` Python package source directory. - ``tests/`` Python package tests directory. - ``avocado.cfg`` Configuration for the Avocado test-runner. + Used by ``make check`` et al. +- ``Makefile`` provides some common testing/installation invocations. + Try ``make help`` to see available targets. - ``MANIFEST.in`` is read by python setuptools, it specifies additional fi= les that should be included by a source distribution. - ``PACKAGE.rst`` is used as the README file that is visible on PyPI.org. diff --git a/python/Makefile b/python/Makefile new file mode 100644 index 00000000000..a9da1689558 --- /dev/null +++ b/python/Makefile @@ -0,0 +1,43 @@ +.PHONY: help venv venv-check check clean distclean develop + +help: + @echo "python packaging help:" + @echo "" + @echo "make venv: Create pipenv's virtual environment." + @echo " NOTE: Requires Python 3.6 and pipenv." + @echo " Will download packages from PyPI." + @echo " Hint: (On Fedora): 'sudo dnf install python36 pipenv'" + @echo "" + @echo "make venv-check: run linters using pipenv's virtual environment." + @echo " Hint: If you don't know which test to run, run this one!" + @echo "" + @echo "make develop: Install deps for 'make check', and" + @echo " the qemu libs in editable/development mode." + @echo "" + @echo "make check: run linters using the current environment." + @echo "" + @echo "make clean: remove package build output." + @echo "" + @echo "make distclean: remove venv files, qemu package forwarder," + @echo " built distribution files, and everything" + @echo " from 'make clean'." + +venv: .venv +.venv: Pipfile.lock + @PIPENV_VENV_IN_PROJECT=3D1 pipenv sync --dev --keep-outdated + @touch .venv + +venv-check: venv + @pipenv run make check + +develop: + pip3 install -e .[devel] + +check: + @avocado --config avocado.cfg run tests/ + +clean: + python3 setup.py clean --all + +distclean: clean + rm -rf qemu.egg-info/ .venv/ dist/ --=20 2.31.1 From nobody Thu Nov 14 07:08: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 ARC-Seal: i=1; a=rsa-sha256; t=1622151657; cv=none; d=zohomail.com; s=zohoarc; b=mcRVPhXMRevrzLT19NGPpfRtWOg693jhq8zzhglUoZ13LJeX5SLZIzn5ENOVqEQl8aWDQn4svzB5tvnYaG0tGfbc8D1JutYkAKm0Bb9r1o1yczKiY9OgesYd6m6BUXzz51+kj7LG23jSrsZ05FJgelwqepZJPVa0iRQ/hgTNafU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622151657; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=bI16kpYzCkIRrpe8n5MoUlu4mNW5WVyeyiVMy4p2JFo=; b=KNj2uQKR4h3imOlw1WXv8Aux6nextXXRNjpuJVGl3lw0vtHylKVGd3P4irWu8+NHLyTizJJSkv+79nehiy5zlkq9LVab5u/tRP0/4jwVNHbEgY3RDVhjE6pGCiSFpcHsPaxjkFJ1J91H3tTkaWIpywjrPgv56NnfwVYIl1cVdl4= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622151657273825.7187929580206; Thu, 27 May 2021 14:40:57 -0700 (PDT) Received: from localhost ([::1]:58652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNkM-0002ps-9O for importer@patchew.org; Thu, 27 May 2021 17:40:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48538) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNQM-0005fj-Ib for qemu-devel@nongnu.org; Thu, 27 May 2021 17:20:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:26194) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNQJ-00013l-RV for qemu-devel@nongnu.org; Thu, 27 May 2021 17:20:13 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-189-VYZOGPu4OlSqa04rU-8t8w-1; Thu, 27 May 2021 17:20:04 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 15950106BB2D; Thu, 27 May 2021 21:20:03 +0000 (UTC) Received: from scv.redhat.com (ovpn-116-137.rdu2.redhat.com [10.10.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id D0D115D9C6; Thu, 27 May 2021 21:19:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622150407; 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=bI16kpYzCkIRrpe8n5MoUlu4mNW5WVyeyiVMy4p2JFo=; b=dOcBlxSaqPHUOzshpRkk+3DrrJEK7dX/ML4nyA1bspIWU1Ry9LKJcidaFnPmYTf54eOn4s KpqhClPrJBEQ+xIKXeLg5EJmPflCHXlQ0/cdd9oGFeNY7o7FGfQulntFpAztpeLn5hlnQv i4r+/DTC43NjAeBTdkP0/yzVzjbQj8g= X-MC-Unique: VYZOGPu4OlSqa04rU-8t8w-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v8 29/31] python: add .gitignore Date: Thu, 27 May 2021 17:17:13 -0400 Message-Id: <20210527211715.394144-30-jsnow@redhat.com> In-Reply-To: <20210527211715.394144-1-jsnow@redhat.com> References: <20210527211715.394144-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, 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_H4=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Vladimir Sementsov-Ogievskiy , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Ignore *Python* build and package output (build, dist, qemu.egg-info); these files are not created as part of a QEMU build. They are created by running the commands 'python3 setup.py ' when preparing tarballs to upload to e.g. PyPI. Ignore miscellaneous cached python confetti (mypy, pylint, et al) Ignore .idea (pycharm) .vscode, and .venv (pipenv et al). Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Cleber Rosa --- python/.gitignore | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 python/.gitignore diff --git a/python/.gitignore b/python/.gitignore new file mode 100644 index 00000000000..4ed144ceac3 --- /dev/null +++ b/python/.gitignore @@ -0,0 +1,15 @@ +# linter/tooling cache +.mypy_cache/ +.cache/ + +# python packaging +build/ +dist/ +qemu.egg-info/ + +# editor config +.idea/ +.vscode/ + +# virtual environments (pipenv et al) +.venv/ --=20 2.31.1 From nobody Thu Nov 14 07:08: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 ARC-Seal: i=1; a=rsa-sha256; t=1622151347; cv=none; d=zohomail.com; s=zohoarc; b=dwk69jyCEPb+0in0B1hXGGdJlGCaJsd0ltmaJRRjmQEAPPRsgwccHduwUwIdJ7D78zBue+XEQXSofEKgPUUHnuDAWfueEiWXc0wMCP8cNI+w/e3bA/P/rZ9CJvQOEHaseef2vZN6LHr1Enyw4T8Jw6JNlVDAvy5GO62ChoGRhBI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622151347; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=AfFmyeLeM0TUaPo7AI5ao6xW+rcFYJ0vZxGBClnhOmc=; b=PHMJZlOxcAIkxc503kkyRyv8rQptQVNIfJrJdiEPklfCbPEWUy9kaZcGyIbs6kigkHUQv7N0S9yA6lPVRPeNUWtuPOwxOYZHPNTJfC65nME0qAatKVMAKJuhtBcinxYnQeaAkbVOBsKIIjl7L4c2uxs69fFp8UIl0cbKnMyuNuk= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 162215134726257.8965948720612; Thu, 27 May 2021 14:35:47 -0700 (PDT) Received: from localhost ([::1]:42398 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNfO-0000LB-7a for importer@patchew.org; Thu, 27 May 2021 17:35:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48596) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNQR-0005t8-CA for qemu-devel@nongnu.org; Thu, 27 May 2021 17:20:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:56241) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNQO-00016c-Lz for qemu-devel@nongnu.org; Thu, 27 May 2021 17:20:19 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-168-guZkDvbfP4KxGFOuiJMyxw-1; Thu, 27 May 2021 17:20:13 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3A7C8106BB2D; Thu, 27 May 2021 21:20:12 +0000 (UTC) Received: from scv.redhat.com (ovpn-116-137.rdu2.redhat.com [10.10.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id D6EFB5D9C6; Thu, 27 May 2021 21:20:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622150416; 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=AfFmyeLeM0TUaPo7AI5ao6xW+rcFYJ0vZxGBClnhOmc=; b=IH9oUOmHV1G1CCcMzXolYk/tMC44vhBNrm4F1fzFFTe6ZSfDfZuUegzWwRZwChz8njp666 ROZb5cBuSQGKBlwaK8IGYU1vnrZKB5Idci0ryh2iEf502CKrywfUYuuRlhLSfJsGFH9svJ J3qy1UQ+tSChp/dXnR8hN0Ee+xocjhY= X-MC-Unique: guZkDvbfP4KxGFOuiJMyxw-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v8 30/31] python: add tox support Date: Thu, 27 May 2021 17:17:14 -0400 Message-Id: <20210527211715.394144-31-jsnow@redhat.com> In-Reply-To: <20210527211715.394144-1-jsnow@redhat.com> References: <20210527211715.394144-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, 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_H4=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This is intended to be a manually run, non-CI script. Use tox to test the linters against all python versions from 3.6 to 3.10. This will only work if you actually have those versions installed locally, but Fedora makes this easy: > sudo dnf install python3.6 python3.7 python3.8 python3.9 python3.10 Unlike the pipenv tests (make venv-check), this pulls "whichever" versions of the python packages, so they are unpinned and may break as time goes on. In the case that breakages are found, setup.cfg should be amended accordingly to avoid the bad dependant versions, or the code should be amended to work around the issue. With confidence that the tests pass on 3.6 through 3.10 inclusive, add the appropriate classifiers to setup.cfg to indicate which versions we claim to support. Tox 3.18.0 or above is required to use the 'allowlist_externals' option. Signed-off-by: John Snow Reviewed-by: Cleber Rosa Tested-by: Cleber Rosa --- python/.gitignore | 1 + python/Makefile | 7 ++++++- python/setup.cfg | 23 ++++++++++++++++++++++- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/python/.gitignore b/python/.gitignore index 4ed144ceac3..272ed223a84 100644 --- a/python/.gitignore +++ b/python/.gitignore @@ -13,3 +13,4 @@ qemu.egg-info/ =20 # virtual environments (pipenv et al) .venv/ +.tox/ diff --git a/python/Makefile b/python/Makefile index a9da1689558..b5621b0d540 100644 --- a/python/Makefile +++ b/python/Makefile @@ -16,6 +16,8 @@ help: @echo "" @echo "make check: run linters using the current environment." @echo "" + @echo "make check-tox: run linters using multiple python versions." + @echo "" @echo "make clean: remove package build output." @echo "" @echo "make distclean: remove venv files, qemu package forwarder," @@ -36,8 +38,11 @@ develop: check: @avocado --config avocado.cfg run tests/ =20 +check-tox: + @tox + clean: python3 setup.py clean --all =20 distclean: clean - rm -rf qemu.egg-info/ .venv/ dist/ + rm -rf qemu.egg-info/ .venv/ .tox/ dist/ diff --git a/python/setup.cfg b/python/setup.cfg index fd325194901..0fcdec6f322 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -14,6 +14,11 @@ classifiers =3D Natural Language :: English Operating System :: OS Independent Programming Language :: Python :: 3 :: Only + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 =20 [options] python_requires =3D >=3D 3.6 @@ -30,12 +35,13 @@ devel =3D isort >=3D 5.1.2 mypy >=3D 0.770 pylint >=3D 2.8.0 - + tox >=3D 3.18.0 =20 [flake8] extend-ignore =3D E722 # Prefer pylint's bare-except checks to flake8's exclude =3D __pycache__, .venv, + .tox, =20 [mypy] strict =3D True @@ -79,3 +85,18 @@ include_trailing_comma=3DTrue line_length=3D72 lines_after_imports=3D2 multi_line_output=3D3 + +# tox (https://tox.readthedocs.io/) is a tool for running tests in +# multiple virtualenvs. This configuration file will run the test suite +# on all supported python versions. To use it, "pip install tox" and +# then run "tox" from this directory. You will need all of these versions +# of python available on your system to run this test. + +[tox:tox] +envlist =3D py36, py37, py38, py39, py310 + +[testenv] +allowlist_externals =3D make +deps =3D .[devel] +commands =3D + make check --=20 2.31.1 From nobody Thu Nov 14 07:08: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 ARC-Seal: i=1; a=rsa-sha256; t=1622151750; cv=none; d=zohomail.com; s=zohoarc; b=BzIfvSXZ1MAaLKgdLasLO1UqjJUrobWmB0oytJI1/h4R0PMc4x6tyq8WKIcFEj5S8HkJ7NozVbDc6C3Dawn3Lcr4AQr3lW8myQSDClaFomaNMdX60ayO7zZnZ+sfFHOmAXjEMhV8+ZqF3dHMSGfAKb+lg490gVDXGLmo0YtaZlI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622151750; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=8n+7hBt6DzE9xcUGaZ2t3VuVrZBPc53llEEpBBvRzaM=; b=ayKI3Q9pvvYzfk6PSeOJHChKgf+Hnr6eFOtV6tvsuNk16oj8PHJaEJY63n1RwZxWKrdT8dQ4sHk+Keq/2KF6QIJsR9WUCCd47+Biub6x+2058UbdyAqqtqqqB6VDAgr0zS0HjAoNMRqnLRxksyCziEgPZa5bVzidYzXm+gtyiuQ= ARC-Authentication-Results: i=1; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622151750144396.5573341122141; Thu, 27 May 2021 14:42:30 -0700 (PDT) Received: from localhost ([::1]:34712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNlt-0005mE-6T for importer@patchew.org; Thu, 27 May 2021 17:42:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48678) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNQb-000654-KQ for qemu-devel@nongnu.org; Thu, 27 May 2021 17:20:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:58631) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNQS-00018j-EK for qemu-devel@nongnu.org; Thu, 27 May 2021 17:20:27 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-48-6g7N6PzDPyG3PKKOCJTDDQ-1; Thu, 27 May 2021 17:20:16 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 575E5801B1F; Thu, 27 May 2021 21:20:15 +0000 (UTC) Received: from scv.redhat.com (ovpn-116-137.rdu2.redhat.com [10.10.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 845465D9C6; Thu, 27 May 2021 21:20:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622150419; 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=8n+7hBt6DzE9xcUGaZ2t3VuVrZBPc53llEEpBBvRzaM=; b=A+S4kb0kFDftQ94C0Aet1H20pWZqhxXf/6e9gWHAPf7musmNLtwMXFxLCgGmrn93YOrJYN gKo3/vU9j8avWFRKR5qRv/Jg+V07lKoNn5AxaDEv+2BRILqE1qzQ2K1SO2vgnbypEvhA0S 2uTjuRlecO2UrSyNSDtww6pBscfxma0= X-MC-Unique: 6g7N6PzDPyG3PKKOCJTDDQ-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v8 31/31] gitlab: add python linters to CI Date: Thu, 27 May 2021 17:17:15 -0400 Message-Id: <20210527211715.394144-32-jsnow@redhat.com> In-Reply-To: <20210527211715.394144-1-jsnow@redhat.com> References: <20210527211715.394144-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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-Type: text/plain; charset="utf-8" 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: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, 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_H4=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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Vladimir Sementsov-Ogievskiy , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Add a Python container that has just enough juice for us to run the Python code quality analysis tools. Base this container on Fedora, because Fedora has very convenient packaging for testing multiple Python versions. We need python3, pip (for pulling packages), pipenv and virtualenv for creating virtual environments, and tox for running tests. make is needed for running 'make check-tox' and 'make venv-check' targets. Python3.10 is needed explicitly because the tox package only pulls in 3.6-3.9, but we wish to test the forthcoming release of Python as well to help predict any problems. Lastly, we need gcc to compile PyPI packages that may not have a binary distribution available. Add two tests: check-python-pipenv uses pipenv to test a frozen, very explicit set of packages against our minimum supported python version, Python 3.6. This test is not allowed to fail. The dependencies this test uses do not change unless python/Pipfile.lock is changed. check-python-tox uses tox to install the latest versions of required python dependencies against a wide array of Python versions from 3.6 to 3.9, even including the yet-to-be-released Python 3.10. This test is allowed to fail with a warning. Signed-off-by: John Snow Reviewed-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Alex Benn=C3=A9e Reviewed-by: Cleber Rosa --- .gitlab-ci.d/containers.yml | 5 +++++ .gitlab-ci.yml | 24 ++++++++++++++++++++++++ tests/docker/dockerfiles/python.docker | 18 ++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 tests/docker/dockerfiles/python.docker diff --git a/.gitlab-ci.d/containers.yml b/.gitlab-ci.d/containers.yml index 7b7ca3790df..9247613030d 100644 --- a/.gitlab-ci.d/containers.yml +++ b/.gitlab-ci.d/containers.yml @@ -269,3 +269,8 @@ amd64-opensuse-leap-container: extends: .container_job_template variables: NAME: opensuse-leap + +python-container: + extends: .container_job_template + variables: + NAME: python diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6a0d311cf40..181a55c84ed 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -792,6 +792,30 @@ check-patch: GIT_DEPTH: 1000 allow_failure: true =20 + +check-python-pipenv: + stage: test + image: $CI_REGISTRY_IMAGE/qemu/python:latest + script: + - make -C python venv-check + variables: + GIT_DEPTH: 1 + needs: + job: python-container + + +check-python-tox: + stage: test + image: $CI_REGISTRY_IMAGE/qemu/python:latest + script: + - make -C python check-tox + variables: + GIT_DEPTH: 1 + needs: + job: python-container + allow_failure: true + + check-dco: stage: build image: $CI_REGISTRY_IMAGE/qemu/centos8:latest diff --git a/tests/docker/dockerfiles/python.docker b/tests/docker/dockerfi= les/python.docker new file mode 100644 index 00000000000..56d88417df4 --- /dev/null +++ b/tests/docker/dockerfiles/python.docker @@ -0,0 +1,18 @@ +# Python library testing environment + +FROM fedora:latest +MAINTAINER John Snow + +# Please keep this list sorted alphabetically +ENV PACKAGES \ + gcc \ + make \ + pipenv \ + python3 \ + python3-pip \ + python3-tox \ + python3-virtualenv \ + python3.10 + +RUN dnf install -y $PACKAGES +RUN rpm -q $PACKAGES | sort > /packages.txt --=20 2.31.1