From nobody Thu May 9 00:37:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622150569; cv=none; d=zohomail.com; s=zohoarc; b=f31gE1S6iqfx+Q/5KEA2uAvZoHXCXTq+HsLHNK9B7tpIZYGutjV70xYgxfTYzwYbVhx2h1uMZGWahvf4NjGl7wdWct3+1w9RY5j8VUCDvzQCOYTFU2/E6lgFKnqTtAe4Vo2B2cMHHnyeLEVyxCR9yHRE4NciLOrugucvUQ1SobY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622150569; 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=KeHEhMKWBxyAo6cWlIw9+MQvz8Vo648xNtyIfuGaEnvycg2F+OrotXLrbsksip7iPi7zx0xBodCh9yRAQpcwzWVd4MW1bf58EgHIs4utrSx4+ff0gNWE5ppZ64sYipyZ4kB/bFdz3o6s/c0t6tCbivcdvv08YhkRC6xUEe3h0Dc= 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+importer2=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 1622150569732485.44197561869976; Thu, 27 May 2021 14:22:49 -0700 (PDT) Received: from localhost ([::1]:51156 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNSq-0001hF-HU for importer2@patchew.org; Thu, 27 May 2021 17:22:48 -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+importer2=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+importer2=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 May 9 00:37:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622150433; cv=none; d=zohomail.com; s=zohoarc; b=U9iLa01Jgo6Bnd2Radw1vSkCfqNSYuc3EyKS33Ps651uwCOlCTfnoGnzLGe2b+qXi04i8y3NZ+CM3DGAbTQv/nVvg7Jd25SSHzyV56K/imWRHtl02EUXKJ60f0B4Vs1obNTuNablgfGzys6q/NxVASzj0hFKEMpfzY7GGIsOksk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622150433; 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=TXP5NgTb58UdnjNEvbze7i6gHzPjrEnywjNnVwe5nK2XENTja7nhNDz95SsdNDepZ7NSg9mR5d6R3uOo65N7EhkYhLZcJQvIEoPGYBjj8SfCyjcM9wy2PPmhlqlaF4stmfb87qyIbLQo++a3i+6UZm33u7NufKxoxG+L14xT2D0= 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+importer2=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 1622150433814980.8975375726924; Thu, 27 May 2021 14:20:33 -0700 (PDT) Received: from localhost ([::1]:42604 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNQe-0004GR-Sh for importer2@patchew.org; Thu, 27 May 2021 17:20:32 -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+importer2=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+importer2=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 May 9 00:37:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622150441; cv=none; d=zohomail.com; s=zohoarc; b=ZU2FzFCv5sct8rOYIAH43dVvGBIrkkBbcseCecROQdoikVvYmv8p8kklov8jfmmT0tUhrIwCVJVfy0qf1FGxAYoUQHpWmzWCtenlhWCKmYzc/XfcBmvN7NEzBz6KVltHjIkXS98y7u8nYUOfH+h2Xc2KZwNe8EiZccUbbggFDxQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622150441; 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=g+94T5ZfZ4jC74iBesksZSOgD7pONk4/Q86hJfxQxl/FEN2lwpBABIiyizI0L6zAUVdkMjxpyFp6hl1iCLpezlNfeYijVOzYKQesaY84PVnFEGhGqiXRRjE4sGNyAnVOcT78ljn0F0APKe3mi9E7y+6HXIykt9JK2HyDORcdDcQ= 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+importer2=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 1622150441942169.71806575889377; Thu, 27 May 2021 14:20:41 -0700 (PDT) Received: from localhost ([::1]:43018 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNQm-0004Y4-TH for importer2@patchew.org; Thu, 27 May 2021 17:20:40 -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+importer2=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+importer2=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 May 9 00:37:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622150691; cv=none; d=zohomail.com; s=zohoarc; b=a/XCcva8rtFqX7i2w9IFcISH1644q958i0/Xhd8y9YZOqBAmwfWaUHpKomh9TlXpzLk7nGAg5M4CkmgI1ps4W239/GsMtkxWZTPh6cpLDiS96s/t/q9LW752ActVI+YTF/01FHH6icdKxghivUtvFhLqAc1jZkdki86eguCOvb4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622150691; 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=ZkkYzhOerBVo+xAr+0DqQQYA5+H6iaAv2Qrh+BwaqwUWIbrUkcuKZtxMuf/QfWg/qpIr9Y70btsE/F27KJ5aXZIzIrYXcblJVIYFqLR7D26Yw2Ks+zUPktCcUigOuhjeQQv+iuTlLXQevZdfeGCjQefdMSJ6+j5jUqh3YruN8vs= 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+importer2=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 1622150691579718.2414832894472; Thu, 27 May 2021 14:24:51 -0700 (PDT) Received: from localhost ([::1]:59718 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNUo-0007OP-Er for importer2@patchew.org; Thu, 27 May 2021 17:24:50 -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+importer2=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+importer2=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 May 9 00:37:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622150848; cv=none; d=zohomail.com; s=zohoarc; b=nx0WM7xkFMHQ0tn8Fgvjyfl2Kit2xkwI6TbQcinxdEtZthyzPxypdIjhou9E6YdLXC5YBMceNNIgHVd96Z2sB194JdNTRKeoqIC5+rQGUH24HX65Ouw2jtUemvIuqXy6PFw/yF22DVNWw9aT13LCFNSeimDQWhoMF0Rlh8LEXRI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622150848; 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=WJ55ow1hqc5XGvybGwhribe5O3qNk+JL6sfe7k3rf8tZe54UXSIi4AuX1iwlQZwyBXCL7QBge2GB6bJ4oQOcZDudbEf09a1LUYSgpbIvwpG33PS9FV7NcqlnASdPEdTSGPW4K2c9tSn8Jbb6QO0tkTtIv4TIrJyPvDCaM8yAJDk= 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+importer2=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 1622150848359844.7598410034745; Thu, 27 May 2021 14:27:28 -0700 (PDT) Received: from localhost ([::1]:40500 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNXL-0005AY-7v for importer2@patchew.org; Thu, 27 May 2021 17:27:27 -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+importer2=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+importer2=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 May 9 00:37:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622150584; cv=none; d=zohomail.com; s=zohoarc; b=bINyy/lO7i65Dx1xlMMq1edxq00MpuFAwHxUYQbcpdhVS4Ja1r6gVZnzSIKxwlsM3BILSSbXUTbbub2LcEeNwxaH/uTiBAz8SszdDWH4d+4lxyYZFTt8Lt0OLkukZiuilTE9QnxuPpVK9NCwCbQJ9JCwmuPjxz7KMI/0yCz5Qxo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622150584; 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=LJXhikiU1PjfDP3+uhh2ijqjqTDifY76lPvdzxmhUf2jLIKidYAiUTBB6l/8jEygwjNTtWD6u7Dbs1BgUgGQo+BXAAEl5Z1SxvYM7rYQhtfxxEUNAh81P8UsfZyxvKo86IFL+1zlx70z8b9DG740pBnOyAPZh+Gj0HiQAgMRx1g= 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+importer2=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 1622150584736609.9394387573545; Thu, 27 May 2021 14:23:04 -0700 (PDT) Received: from localhost ([::1]:52626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNT5-0002ei-Ot for importer2@patchew.org; Thu, 27 May 2021 17:23:03 -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+importer2=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+importer2=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 May 9 00:37:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622150706; cv=none; d=zohomail.com; s=zohoarc; b=gbQs5srJiweJ0gAcrfXgwc1/QPHSgTu7tH52ekkQGkWUaVkrJTMBo682Bs70B4Xw6PHZCJ3Grhsx+bX/A/6WFPbc4o1B/l33abv3z7RQlyvPAhc8ASHNzBs5kwbymxHYKhZr2vzzrBwU2XIuNBP5EdkGBUN00QBvg31+22nHAFU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622150706; 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=FVldZUBMhpQfnkaGlwqgl1xP6+Ml4cxrsnnWCUks+7U3Epll3TdgBfuV8JNXqncrB7Ck2WXxy/7+xIgXYiOPOqxoebJ6qgem/H0iB07Gd1iwewhAyyUr0ZU+NsapS3NTX5G9sSeLy2dxIR1sTwlQSSgaZ/TvHrG/gn9mPt/xplc= 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+importer2=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 1622150706223780.2728381866467; Thu, 27 May 2021 14:25:06 -0700 (PDT) Received: from localhost ([::1]:32954 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNV3-0008NJ-5Z for importer2@patchew.org; Thu, 27 May 2021 17:25:05 -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+importer2=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+importer2=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 May 9 00:37:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622150581; cv=none; d=zohomail.com; s=zohoarc; b=YfkU+Xy/yP1yFnDjYfK79JLNSVlODdnhB6WBb9jFZ8cU5+lRBsEeVmV470mJsgv+sbPga8V8Vk/XcCaeQZDqBgzfEqmZHj1ujCkvYfV0L97EnivaGyrfLkmTTi0W94HqUWIRrTDphTLpqDYdeBKH3OANqyn5KeeY2OXn+Suz5w0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622150581; 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=fBOHqx5FvW+wqtmwoy55UOfofkjppreX7Dopyb5D015nHzSnNqXRX1HvX3edMZ1ZVfJ0krh7P5HOOW56kr1SYpBGo5wOgSOzth/ISA+uguWT5V4tT3R+A9xjj/OTQjbr9GLgiAzbHGnj7n8sLemVb5EUVurrBlGlCa26ilzcNeo= 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+importer2=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 1622150581769130.00332910024565; Thu, 27 May 2021 14:23:01 -0700 (PDT) Received: from localhost ([::1]:52348 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNT2-0002Tn-NZ for importer2@patchew.org; Thu, 27 May 2021 17:23:00 -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+importer2=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+importer2=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 May 9 00:37:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622150858; cv=none; d=zohomail.com; s=zohoarc; b=Xvoq1jchf/cHcQ4xNc9t/Y08raXDDf22qdb1KPklf6cL4Q0+SOX//HQ9K3thSpTNmZVulFT4byR9p6fQqfUVv6PMM+4Xie2oQak/v7t24nT4Mq9KKiQ6m/rZ7rI4sBlaRjLD23cnjVTmRiYar0yYxPr0anwmyRAvK+7zBMDDd0U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622150858; 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=bZHKnkliL25SkJfFG6RTOoAhoJn/dWYa4P8oYvbBZ68IuabaNzIBeqF3c+coJJcofXt7bzpD+VnL/sCkZhUCJ+W09DHmkjRXO37INgXEJU3k644HE8gNYlwSNSBVWjQZ1N1fYOzXN4pthjwmY0ok2FEHo5wonflZQfGYlzgLfIs= 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+importer2=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 1622150858813239.69407314047555; Thu, 27 May 2021 14:27:38 -0700 (PDT) Received: from localhost ([::1]:41520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNXV-0005qt-J8 for importer2@patchew.org; Thu, 27 May 2021 17:27:37 -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+importer2=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+importer2=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 May 9 00:37:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622150516; cv=none; d=zohomail.com; s=zohoarc; b=kD8URz9yGQWgpm51tYa5eGCeeupVcY+dGU7A9BGZbeAN4Tt/bVR7v82W0SnEiza8irnaLo9QSK2TJh4U1BKeq326KavrbojSrDgv/hEOKoUqQgEWyTfJaQSUrf8TQb9+Vs914Sb8DksbKQbXrX3b8/T1TUtvhcg4PYxO5fguJo0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622150516; 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=dIQXI/n+i5FbV/KI68AtT8n8oFQQ3d1ZcF/Fku8ESrW+Mzgua53Q+WkT3+HmcbsWd/sepKfTJsvF8tfiMcKp4w2nda8HfFZN1xDR3scu479FZFz2nV+ZwnQDJAwdONDN5VJIdb+Vcum5MQHsPVJp94cR+SlWqpArnWa6Qg2jEns= 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+importer2=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 1622150516790252.88130050461803; Thu, 27 May 2021 14:21:56 -0700 (PDT) Received: from localhost ([::1]:47758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNRy-0007sX-OC for importer2@patchew.org; Thu, 27 May 2021 17:21:54 -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+importer2=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+importer2=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 May 9 00:37:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622150648; cv=none; d=zohomail.com; s=zohoarc; b=ewYMDeOn4i+e9Gt8V6m9W7QnQJ+lIwPK4nJoxbzmAMCba6YsUhCuvcPpQgqNmtwoGBiRlhfwv4yoY4RmVKBtbHUJOIMOEXYFJVpSJqiGMZm72mPTfwPhEaUcBChDnN1tc6m7/oWacVOfILGaeqGMeEPa990EXpRG/N0DYsBOEtQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622150648; 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=VCT9mUvtj5CGFA8ZWRGlNPDxlDaJF6VxSyfWKMb5V9rMVYars2LE71epkEw5SrwkoDHjj0ogdpOI0M/+teEwmzvRrUdFXA3fwHXqQMYiwonFko7xeTi0MPkbDImocrv4+CO33Sh8ya+cY6ejeS2PoathmDAudHjBCsygfAYvz1o= 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+importer2=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 1622150648903562.8389274161182; Thu, 27 May 2021 14:24:08 -0700 (PDT) Received: from localhost ([::1]:56398 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNU7-0005Ac-Ik for importer2@patchew.org; Thu, 27 May 2021 17:24:07 -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+importer2=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+importer2=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 May 9 00:37:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622150782; cv=none; d=zohomail.com; s=zohoarc; b=FLckEz/mqkeMfWW0wr2bfA44Pylj6nELcf3w6IMAtTSkFGdw/qWlF1bGxTscE9YybODWiw2cktuRuSbT+7YlvSCVvfyX92z2B1RGz6VlvJaYU2hLYbUBcktFovQIt4ne6mUaUtYPjH6bL4o149hxEb19nZCbdWIy161zYjjqfYk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622150782; 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=mtYt3xyweAJianz8aGZM2WLJPa1kTM97h4ke1GjWloHubgoI8rejcATOJ1DlFkeowwDScUQQFE0ZkOq42kNFv5apNj9Y2zb+3gzkFlkuRAKNct0UMHw57w3R5corwc5Ih6U9VKFvpfw3gZZF8PguawQibj3M/wyUIlmL1Lxmh8c= 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+importer2=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 1622150782033553.4908708621393; Thu, 27 May 2021 14:26:22 -0700 (PDT) Received: from localhost ([::1]:36578 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNWG-0002PT-Vx for importer2@patchew.org; Thu, 27 May 2021 17:26:21 -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+importer2=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+importer2=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 May 9 00:37:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622151009; cv=none; d=zohomail.com; s=zohoarc; b=jPQOkNJWH9tqPHRd9YEQF0nKOsa+y+YF9Xh7rYERsvMidzPWl6Wc3/UVTKE4pMhhqRrhziVLlYD3DRXyG5AFROzOpS2ZoJLUOglvv4m0BRcIZiy+SJyg9qnDWQRBqVhGlLJSPRWc8ND9uXq8869V1NC8QnEPHZKaNiHZtjVd4bI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622151009; 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=k+V14fGat9sNt7m23xNiM63Iq4AEAiPaBvBtff0PCm1h/rXEQhB4pv/JRLwd8kAirXjJVzXM6qYJDR/GRc22Vh1KR6ymIpO6dWkS/Lu+dVoBJbtEF1hDyKZHPoqKuLrfqJgiIHb12CvCrziz8XeaQvo9/AmHYmMQtoHkz9so7mo= 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+importer2=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 1622151009550217.673547687858; Thu, 27 May 2021 14:30:09 -0700 (PDT) Received: from localhost ([::1]:49656 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNZw-0002yD-CX for importer2@patchew.org; Thu, 27 May 2021 17:30:08 -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+importer2=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+importer2=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 May 9 00:37:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622151033; cv=none; d=zohomail.com; s=zohoarc; b=K5t9dcSDzeF/yj6G6iNBugEmJLqlazYF8bgEx1VQ+GmWi027k8KR7zMdavfIWfbSeoSgNg10BMRFpLIFDTjrQRibTjbMhf0gjUakjCl+1I4uSQc3GCyvYYq6cK8O2/TXOWnANPWz1kSPdjv5NozoBgsGY1SFF9lHqhwAjodOjE8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622151033; 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=G3DKrbb6U/eE4/9HL+MqI9ph0uwYODxNc+01iCIWGiPKSwKDfToubfP5mRCzvFGULSB0An9jrZTHFe+J+AAG5NoMTVhvW+md/kSsbAjf1wY1jxH6TQmnsjvyp4PvmmSssYTh7P5d7248UVJFFScepRaTr6Q4WtwZsQc+37ZBGaQ= 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+importer2=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 1622151033378295.53874502257645; Thu, 27 May 2021 14:30:33 -0700 (PDT) Received: from localhost ([::1]:51388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNaK-00049W-67 for importer2@patchew.org; Thu, 27 May 2021 17:30:32 -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+importer2=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+importer2=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 May 9 00:37:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622150740; cv=none; d=zohomail.com; s=zohoarc; b=lBRF8P7xqPCV2Ar4OE16xeJI5qZUB6DVKnLucOLBPGhQnFJxp6pjL7oDaUfj/egEfWnWITTM5MiX8VaFovYv8NisOFMjLG0mWKMJJB4ccBhMSn5/nS82D/0dZH8vm1r7bWZ5Xb5Fe8elBKRIjZLBoUJ+4UovtCDnbvSXNhDq6qI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622150740; 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=HVDLZYKdYMuqLRQQdyGNxF41OUjf2c/IPpBE2fhg6IXEPjHoKVTlpJWwa9u12rw8bJj59wZsKE10xcH99bu5nDdvVGMc+3Vph3AZKvELA9rm24Z76fc9i8QTkfCtqhc6dehiwDsQ3szAsrXC19dv3edL4t3ZVI1DPwoqDnLUJf0= 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+importer2=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 162215074058186.25215545567653; Thu, 27 May 2021 14:25:40 -0700 (PDT) Received: from localhost ([::1]:34692 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNVb-000173-C1 for importer2@patchew.org; Thu, 27 May 2021 17:25:39 -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+importer2=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+importer2=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 May 9 00:37:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622150885; cv=none; d=zohomail.com; s=zohoarc; b=YMZYvSo6zWHQULavp7ALmnw4vY4LC/uJJ6ZNX6HWPzoHyYHinbgUE8qUG8R7lqVAv4kKR37I8hEa4EUuW9F2IQ2jJGPzV5U0ziUsHRcLqhjelEp1B9IcxfoSkUjRVJcgDyIh+ViSEDWYcTlr+inOc7ltp+vspntseCEYto2Pen4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622150885; 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=KJMrL0Dpa7gpMOID/gb8FX6SHewU2ZXgQcj2BQA0WDlLhWCupjTQ3n9Nsp8V550paZtzC2rvbAx5piATWcrXkz0qrlCt/JctLdvT8BcRYqR9tfCIO3PFf1EuYKLd94zgLntfeY+xXURQmKMS7YIGSAoYAYCORV/5RvBdXJWznww= 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+importer2=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 1622150885547830.7606065215575; Thu, 27 May 2021 14:28:05 -0700 (PDT) Received: from localhost ([::1]:43024 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNXw-0006sT-A9 for importer2@patchew.org; Thu, 27 May 2021 17:28:04 -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+importer2=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+importer2=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 May 9 00:37:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622151230; cv=none; d=zohomail.com; s=zohoarc; b=RPJ72P2ZBwHXXM0MM8DJV4Qcc7V3S/xV0LL/G7bvNOGTb6azED2Q8gHl+lxe4qzHbifIRtpYiTY+l/x6lzyvpRkdyi85aeFKEv5dvaNymdG/IOnEckEI5DetVdxlQcJZGP7Mh5yesc00Z36v845G+/13myY0u1eqS2UC+o/1hlY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622151230; 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=Q+4DqB6rmAZd5DI06ZFiTPRVlZCaw+9Yw+Qa0TjT0wV71bz/0Os0PfFeruwhNR/0duMjDSABIBrdZrd+g3o4ASLjmCXDiUV5EW4gZxNes4Ot0JWTSyw3MHLQjBixW0pq0Ykv74Du0eNvxx6FyGGXuI725JfhF2j6d8rmE2tZvTo= 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+importer2=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 1622151230216251.4414917274131; Thu, 27 May 2021 14:33:50 -0700 (PDT) Received: from localhost ([::1]:60486 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNdQ-00020S-D1 for importer2@patchew.org; Thu, 27 May 2021 17:33:44 -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+importer2=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+importer2=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 May 9 00:37:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622150953; cv=none; d=zohomail.com; s=zohoarc; b=YvPpF1F5bDJT7/gz1NXB4NfV+TxhxVopvPkG+ExwiPgTzDIGWUAzhKvR8VY9AyC0Xquz5mkzNfUmH0T7Y9b+SKapcRDS3a2gsl3VIbR+2+fRX/CqV6D1IYPLI2lyGvc+GLLiVDaq35UE850IOSgwljQDeUUMkWSUCF8tsH7zU3g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622150953; 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=jc8E8Afftvcc2tS/JaS50ba1pHJjTnid4GhAtp05bU1N9Nxt/9n1mkQalMsiNRiyjVla7m2WG+H1vDSxUv4CA51jyOohMGkNuB9gRcHQ8Jqgg/OLX5wDoQ0UADymqMMbJbtaeVfIPE03jG1VypLFNolNr4Etde+GgWxUw8iOA3A= 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+importer2=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 1622150953164198.4448440990867; Thu, 27 May 2021 14:29:13 -0700 (PDT) Received: from localhost ([::1]:46276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNZ1-0000fn-4z for importer2@patchew.org; Thu, 27 May 2021 17:29:11 -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+importer2=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+importer2=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 May 9 00:37:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622151097; cv=none; d=zohomail.com; s=zohoarc; b=FvAs/vfT+iZ9MKIkDcgtnUouGwOdLJSh5O//HYhDguDSKSq3bWHA0oYGtCDGnxwIQ6gjHY194F9sldev1TTKq4PPUitZusR4VvytRlzd+9Ukmg07ONDZ60qbLjPq17RidO56CGnaV/IJy+k9kIdg8LjHGvR3K7haWwn3OpKNQAM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622151097; 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=SKx+eRrzPso0Hw/qholwC06gp+2GJncpucQpmEpbo9S17DmtYAE3nejt1uTzTLbMc0HgssNIc1uPb156V8Rpq/GcYqqtJpKyv0YBZegowSMHdpxRnt/JTvA4p9My7MFnSga5XH78eu8lL0Pt+CKT7sFjTtvY/chIUdAoErUTKIU= 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+importer2=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 1622151097581632.897320422892; Thu, 27 May 2021 14:31:37 -0700 (PDT) Received: from localhost ([::1]:54660 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNbM-0006Rk-DR for importer2@patchew.org; Thu, 27 May 2021 17:31:36 -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+importer2=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+importer2=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 May 9 00:37:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622151349; cv=none; d=zohomail.com; s=zohoarc; b=FnXMsQUCn7upgCOLLvKmGzFjtitLRNjedALWazbxNwlkG8Xpcg69HBxooCBakUt1rZxmqDRzuq/ugkcSiO33cH0P/pqinCIHIpyQdWlLr+rnY8YKDT/OP4hZSZy64VdOMYjo3RiwEWJYJ4MI3C8+1s8dvAWdlsiMQokyrkr54ZY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622151349; 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=mpjNVKsIkq27onCEBUrXwQ68T6+JhfIMpP0Q6yQWdsAVW+Zk9NXnSDZbuWNqls0fcn5Eq8E4aY2YTTaSD8aEKfDyQ7pObJ+2HGS+GjlJcH2K4TQxQ+qHyNZA3FOMSzQDlMCItmp3NMOhxWX/MJEgiw/60ytkYghXgN/9w01WbBQ= 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+importer2=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 1622151349009474.8843929884798; Thu, 27 May 2021 14:35:49 -0700 (PDT) Received: from localhost ([::1]:41582 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNfP-0008F3-U6 for importer2@patchew.org; Thu, 27 May 2021 17:35:48 -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+importer2=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+importer2=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 May 9 00:37:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622151278; cv=none; d=zohomail.com; s=zohoarc; b=A9znIZ1vHzh3bhg9o7eLCEHjtK9SI1OQCYN/juyrRxmduFQCmqe94Ynw2werkpvCIWLEnxmjNlnRGyFsPC+u53Tfkbfg/+lVLnIHQOmZvSEl4uY1G4PnCfetpGFMieM4OY5Tpdmb61KSxwTDViH+HTcZOgwZ9M7rIo7R5m7z4Co= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622151278; 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=Zts7ABzGOfONg4+//iOqNUbRjJkrn13RKN3yqk+P/YXLpxHdRdQRaiPmgVWYtbXFeK/Th9iIjD9XLTc5ArOICxPTIP8XnMRoUcsiw7fL6OcyVBxxmZZeXKcqajdALH/qj50hwblBEnEWXS+Aeon+e8AOSWAQMHLOG6/pxtVNKZw= 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+importer2=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 1622151278526270.15282383065414; Thu, 27 May 2021 14:34:38 -0700 (PDT) Received: from localhost ([::1]:35454 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNeH-0004Bc-EN for importer2@patchew.org; Thu, 27 May 2021 17:34:37 -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+importer2=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+importer2=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 May 9 00:37:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622151520; cv=none; d=zohomail.com; s=zohoarc; b=RFeUsI4XGv31mUPHsML4pV+t653h5dxlnrx9YMroTlLiBRPVBNNdSw1NZ4lGu1qvO/R8DBVUOcFfWZ3NRmGFaBjnCvhmPqqa7xdr4Ico8ebVCG6KxaeWKu2fw8n2ni5v/q3VsjSYdC3Zt5bSojz5o36bVp3Zp1xhjqcXOhprNFk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622151520; 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=WAsVTQ/Ni++c1e2ujwBc5EwthmZgzU856s6SW3VgmskVo9RGeA45FWjooFSZdg/Va4crA65tDeCgmtmoAKihqu6t14MvWNqL3uCti2RsbNf3Mb5NegyKB4TOA9uxFMewWmXLK88Yut/GmIO69mrLCu8n+LCW3CuLKkWRSft8+SU= 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+importer2=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 1622151520122947.6281224409227; Thu, 27 May 2021 14:38:40 -0700 (PDT) Received: from localhost ([::1]:50276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNiB-0005fu-3D for importer2@patchew.org; Thu, 27 May 2021 17:38:39 -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+importer2=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+importer2=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 May 9 00:37:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622151408; cv=none; d=zohomail.com; s=zohoarc; b=Dohk0J2XJeSJDCU9JOpr8mbo1c+Ci5dGZFXzVw0t11i1M0wVXDYBl1UyKp3+6TIZIGXfJ6aD3J9+Rn3LO0YuSEslDgFNyzFwfmjt/VS8yGIV/Rh/Nh+TlKeOFXV2XLPHY2enNdPnXpeQOmv6IpoR5dl9NypTYzrjlshpHVR5g+0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622151408; 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=itU6ixgv6azDtVxkyIdh6jTb2YFzYlET2tCCbJa8hkaIi/yYFhlTO4mRf+Fdh2BiauB1QsDLiy/LpXyykqVpq1WhWspHuiT2sbuK+BX5cDktoFXuvPyTA5yrO/bVsr6tYIBoIElqlitcR6KIKdmIz6k15vtaT+bg5rOASLzRE+M= 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+importer2=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 1622151408185504.53592598434034; Thu, 27 May 2021 14:36:48 -0700 (PDT) Received: from localhost ([::1]:44028 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNgN-0001Q6-5P for importer2@patchew.org; Thu, 27 May 2021 17:36:47 -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+importer2=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+importer2=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 May 9 00:37:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622151617; cv=none; d=zohomail.com; s=zohoarc; b=RpcYmiP318bmbblbbxpH+BOuYDzYvDU8DjiUh7zmmWOYtVYA00Tnkj54hPxG12jHYgdJ/BvA4msj8FqKVSDzdJNoZH/+NehbAxVho8TM/T9XN6EboxAIOezW0DGjfT1U6H7rUiIT07ZxWoS1Zm30lxeVmnraKKGvx40UBx0TrvY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622151617; 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=Vv3ADwW4EkqKdLqYH0zcnnVWUWRV3uwe28LVo3ZgvNjpbawAa/B+CBf0Agb++PMWfkeEINZrCWGx4xzWMdoBqCxcnKxCNA2Bqi5lQ/Pfu9ebs7r/MnKmD3TgwzySAHTaPfO8yKgtEp6eNZ026ewdQV2rUe6HkYj3nnnuMNbKmkc= 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+importer2=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 1622151617430469.6477826528138; Thu, 27 May 2021 14:40:17 -0700 (PDT) Received: from localhost ([::1]:55688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNji-0000ql-Sr for importer2@patchew.org; Thu, 27 May 2021 17:40:14 -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+importer2=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+importer2=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 May 9 00:37:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622151334; cv=none; d=zohomail.com; s=zohoarc; b=X/Xjn/Z1oNIjKD0InRAVfzJhjhpHq9uFT8ifLYEYqLtqOauxuAhi78hmphbqY1PrwV6bvuFEAeTQrZlA01E/sO7mukShT6CnEAgaBgcig1P0GxZaewX4ZJII7/QipwsZ/HCdjW39ZmJvwfZxpw9zZbWB5ylJdSr47zkJ+5JWF6E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622151334; 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=A2TvSYRdlJgTpPeDEnVJfF0RRwB+m7wUraY84URtXzo7gpxYBpm/70+mdVCcNOKSnUA1ggLxlRTgiIO+Ij1zCM4NxelVv5cpZXbsmSKvr0/5FDZyEHQWc2ImjscJoXeDv1UVI0UXjpKpUXM/R/+Q8KfQmGFCYJVDx/PdoIhGjMg= 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+importer2=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 1622151334377711.2104500325612; Thu, 27 May 2021 14:35:34 -0700 (PDT) Received: from localhost ([::1]:40264 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNfB-0007ML-3C for importer2@patchew.org; Thu, 27 May 2021 17:35:33 -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+importer2=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+importer2=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 May 9 00:37:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622151716; cv=none; d=zohomail.com; s=zohoarc; b=RWcnkOqk/Uvqx33oVT24BD2nNQQgC4EFda1+x3Qe/87r7HpC2HkzoOerJxeehTAX6sCT+tUmMtGJjiNmtdhViWbHg0ctymnL04k2jyGG5VvO+lTZYkTHi0z/6wPM+HwIzJoWq46g1UryIdczA9DZSz3w1UKuaBt+z943QbfSB/0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622151716; 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=dB8U11yiAixB+0JWS2cKa7qZx1vfCiYGoO2TZsqgqGvO893FX733uItSg4g/4jwwsyusRxw800rau6AEX6AB9ueFlc/b3yldOC1t4MT31HQyxT4x+amO4PUH31y1h8Yx9nDd3zx5ua8ex/PxZ88MQF5HqJSd4iB2YWNEOekw1A4= 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+importer2=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 162215171644575.06883442236517; Thu, 27 May 2021 14:41:56 -0700 (PDT) Received: from localhost ([::1]:60712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNlL-0004DW-7r for importer2@patchew.org; Thu, 27 May 2021 17:41:55 -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+importer2=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+importer2=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 May 9 00:37:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622151076; cv=none; d=zohomail.com; s=zohoarc; b=hTv+rLPRPDzyYGoA01wlmX12p8MhGpTxDZ/WcIhyMmXJkyo9s+lfcATL59uPmaklT/ysNULtcYMNr/cXD6j/9EInF4jmFi/shqAAOkjrNh52wkMY6m2qRNo9arY/egQp5J0W8gn5N3TYAFVxGkZNOZmuyGt4A/J/QawWSCvCDwc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622151076; 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=dOg+50Ml/mx+bYYkRp3xJLOVpgNIbRddrTvmfawwyKsm6wZPinh+8lOHDc3WbkEP+G6yWXFdCp+yp/lhFnjxVU1smLost6E62cgy6/GrPj/6c1GLQeoiIVfcgNynOMxmivAKz0ePBMeAiTARY/N2JwdzlAMOJ8oW5jrvTk/mMDE= 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+importer2=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 1622151076595499.32085291620183; Thu, 27 May 2021 14:31:16 -0700 (PDT) Received: from localhost ([::1]:52880 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNb1-0005AY-H8 for importer2@patchew.org; Thu, 27 May 2021 17:31:15 -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+importer2=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+importer2=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 May 9 00:37:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622151239; cv=none; d=zohomail.com; s=zohoarc; b=a5ETFBpFgD4oEzRKH3jIkmg8AITe8mmdlYjRWnvgHt9lR0IC49+5B2y4bouSBVhTkN7NkOLGRzIfneOZa8e1ihDHkx8An0Uc5922m2u7Xf5yU7kjF3Rvr5/0+9HdirJtIVRJJOx4SuMI5kVZV4Tbva8XPrfBRe49abnqBG7vv9I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622151239; 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=FyaSaNFVczUWbzOeYP6tX0AIgwbIacmXtuQ3nuPCNtR2ZsM3Va25Q8kvNCq2hyy96HTgppvKiWY6uORN28uIGlT9ZU0nAqV5vJetBsY5pZc+QChBJU/UTyROTCBY0Wu8SuGA/TC0WL79kXPqT7uoi132bnxBOBBRLeqfXapl5SE= 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+importer2=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 1622151239953969.4924521843639; Thu, 27 May 2021 14:33:59 -0700 (PDT) Received: from localhost ([::1]:33062 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNde-0002YG-T9 for importer2@patchew.org; Thu, 27 May 2021 17:33:59 -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+importer2=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+importer2=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 May 9 00:37:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622151666; cv=none; d=zohomail.com; s=zohoarc; b=f9XjFR2i/yre53ieNC5OX/xNYr3aivlOw598yNBiXf4OR1NJeBEdEyKMd6UIlQ1Y7muNdhjMjtHpYk5XPHyUoSqBicFsMpZ3wCmAyVeG3YYL+4Bq0Mv9L6iUWCXsmErb7g4jugiXQT/7VZXK+XIdfECGC3GP62Ur/7qftqZii4M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622151666; 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=MXYdlvKBKvn5jnrQq8ilUwxHyXkYcnjFwdc0EeX5itdkUia/XNXW3wc4c7u0SEW2XJmOix/LwozW4ywx8LupTyk/SxOIOg5LvwCR2dMg2stbrAO9gg7j4T+ZiRqrFTrLJgHFSJt38FKWpT7k3k2MhKqc+mgm1ssSAZ+YKLG3f6k= 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+importer2=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 1622151666749945.7016305962014; Thu, 27 May 2021 14:41:06 -0700 (PDT) Received: from localhost ([::1]:58652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNkX-0002ps-KV for importer2@patchew.org; Thu, 27 May 2021 17:41:05 -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+importer2=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+importer2=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 May 9 00:37:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622151372; cv=none; d=zohomail.com; s=zohoarc; b=U62NdknfBJCoPbis9HyVZpztnOH36KjW966JtlsPVTtaQbYP732cXIWoji3Is8sVLuOI74w/zfxoPZFNFomakCwv8+MW/nPBtr+OsKp59Am3ct8NIzzQTiCrlxW6oKXrYtTRNWWV/x5wiRwu45WdObknk1Lk8zhe0kXbN4e808M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622151372; 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=dNC8TKBh93AY9MZDqAh57QtuCujAiLvIL721uquGag8l/S5S+zgKQs4BV8z8+Tdie+iVb/uKmGVyq/obdIYBd/F8pMMm3az4tfLGvnN09ENEjaFK6Czzwdls/XJoFL4/0m57yzue7WffOLw/CdIMg4ufR9BKWnrBXo+VB+dWeTI= 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+importer2=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 1622151372584797.5742205445565; Thu, 27 May 2021 14:36:12 -0700 (PDT) Received: from localhost ([::1]:42398 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNfn-0000LB-GP for importer2@patchew.org; Thu, 27 May 2021 17:36:11 -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+importer2=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+importer2=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 May 9 00:37:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622151761; cv=none; d=zohomail.com; s=zohoarc; b=StrEI1CkZpgOpm3sHfqiOZemfFox6xXM6M5/O1QYaOXi+BWPJvYCTdvqhVP+wXocMxI7k6lo0iZ+x59fn3XHoD9LIdWkxiaLQQU30e2HRnD49K9zUHwnWek8ZYXa3jZLXRk1jN/VR6chmZUFK8cY7jouZ6cFCD7b8jYqebDV3xg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622151761; 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=buobCjk07xhIgWGyxlgwUgA5HMLE7bm/eSI+WUyKIX3RDQQp0MwA8njBGdk809Ff/pi0t3rpQuZzDzbbVfXJ52ksRktfRZOxcFhYXxwa1olWHvY5PBZUjx0p4oIUKHQVQdHxXhocZsf2oFEfnBDa1qupMFyjOwH4As7cqjDbj4M= 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+importer2=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 1622151761782578.2661010091999; Thu, 27 May 2021 14:42:41 -0700 (PDT) Received: from localhost ([::1]:34712 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNm4-0005mE-QD for importer2@patchew.org; Thu, 27 May 2021 17:42:40 -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+importer2=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+importer2=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