From nobody Sat Sep 21 05:34:38 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1622151506; cv=none; d=zohomail.com; s=zohoarc; b=ZOsZ5Ms3uwDSAMsx/kOOvr7nwcbtf+AgGVrp50ctLNzzDqFRIeRGcbCoJhckG2RbfAdn671YgMs3Kk50Uatp3kcsL0oNPLdQa8z3UnTQS7eGwPt+LIUQx9I4draYHsTEBqFoIhWRyHS24QGCMVV3ID+39Vz9tpcApb74+ntIGh8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1622151506; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ymJdrBa/TqwXWhVLTk9DyCV/mO8y2xrFXhzo79oKoc0=; b=frVax4GZosdk/ituAFn9Yw/2fkAhd1KlaWSE7Kwnc1pjatrlTEYnhoBJ5Gt4aoBWyxSOsgNrEN0DEHYAjiyyQpnSO9rjiuYJZzSfvtQXrPeb1vx6oW67v0sP9fWpOyT5h0z73sSmtiXerl3P3PIPxY5gOElB5e3E8UINs7+7TmM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1622151506428350.18323236734125; Thu, 27 May 2021 14:38:26 -0700 (PDT) Received: from localhost ([::1]:50276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmNhx-0005fu-C0 for importer@patchew.org; Thu, 27 May 2021 17:38:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48310) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNPn-00050i-4m for qemu-devel@nongnu.org; Thu, 27 May 2021 17:19:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:48302) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmNPi-0000j7-Tr for qemu-devel@nongnu.org; Thu, 27 May 2021 17:19:38 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-254-wGLvKBthPUKjH2-WCZ41Lw-1; Thu, 27 May 2021 17:19:29 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6D8F91883522; Thu, 27 May 2021 21:19:28 +0000 (UTC) Received: from scv.redhat.com (ovpn-116-137.rdu2.redhat.com [10.10.116.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7F0EC5D9C6; Thu, 27 May 2021 21:19:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622150373; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ymJdrBa/TqwXWhVLTk9DyCV/mO8y2xrFXhzo79oKoc0=; b=GBMAntAmJfYAclFyaM23xWJSzM541O3HJu8y1O12jvOaw1kFFtyAx8GG9KFbLWERE/qdou d0uh05iy5a9K7KSECZSZ+nIjG9MiQ4OH031m/Cd9klLNINoKV/RRV2KklSuRvpkFMpiVi1 F2cb7hOGI23NtI9gbJWylWM1qjdHUNs= X-MC-Unique: wGLvKBthPUKjH2-WCZ41Lw-1 From: John Snow To: qemu-devel@nongnu.org Subject: [PATCH v8 22/31] python: add mypy to pipenv Date: Thu, 27 May 2021 17:17:06 -0400 Message-Id: <20210527211715.394144-23-jsnow@redhat.com> In-Reply-To: <20210527211715.394144-1-jsnow@redhat.com> References: <20210527211715.394144-1-jsnow@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.374, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , Thomas Huth , Eduardo Habkost , qemu-block@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , Max Reitz , Willian Rampazzo , Cleber Rosa , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 0.730 appears to be about the oldest version that works with the features we want, including nice human readable output (to make sure iotest 297 passes), and type-parameterized Popen generics. 0.770, however, supports adding 'strict' to the config file, so require at least 0.770. Now that we are checking a namespace package, we need to tell mypy to allow PEP420 namespaces, so modify the mypy config as part of the move. mypy can now be run from the python root by typing 'mypy -p qemu'. A note on mypy invocation: Running it as "mypy qemu/" changes the import path detection mechanisms in mypy slightly, and it will fail. See https://github.com/python/mypy/issues/8584 for a decent entry point with more breadcrumbs on the various behaviors that contribute to this subtle difference. Signed-off-by: John Snow Reviewed-by: Cleber Rosa Tested-by: Cleber Rosa --- python/Pipfile | 1 + python/Pipfile.lock | 37 ++++++++++++++++++++++++++++++++++++- python/setup.cfg | 1 + 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/python/Pipfile b/python/Pipfile index 053f344dcbe..796c6282e17 100644 --- a/python/Pipfile +++ b/python/Pipfile @@ -5,6 +5,7 @@ verify_ssl =3D true =20 [dev-packages] flake8 =3D ">=3D3.6.0" +mypy =3D ">=3D0.770" pylint =3D ">=3D2.8.0" =20 [packages] diff --git a/python/Pipfile.lock b/python/Pipfile.lock index 5c34019060a..626e68403f7 100644 --- a/python/Pipfile.lock +++ b/python/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "3c842ab9c72c40d24d146349aa144e00e4dec1c358c812cfa96= 489411f5b3f87" + "sha256": "14d171b3d86759e1fdfb9e55f66be4a696b6afa8f627d6c4778= f8398c6a66b98" }, "pipfile-spec": 6, "requires": { @@ -84,6 +84,41 @@ ], "version": "=3D=3D0.6.1" }, + "mypy": { + "hashes": [ + "sha256:0d0a87c0e7e3a9becdfbe936c981d32e5ee0ccda3e0f07e1ef= 2c3d1a817cf73e", + "sha256:25adde9b862f8f9aac9d2d11971f226bd4c8fbaa89fb76bdad= b267ef22d10064", + "sha256:28fb5479c494b1bab244620685e2eb3c3f988d71fd5d64cc75= 3195e8ed53df7c", + "sha256:2f9b3407c58347a452fc0736861593e105139b905cca7d097e= 413453a1d650b4", + "sha256:33f159443db0829d16f0a8d83d94df3109bb6dd801975fe86b= acb9bf71628e97", + "sha256:3f2aca7f68580dc2508289c729bd49ee929a436208d2b2b6aa= b15745a70a57df", + "sha256:499c798053cdebcaa916eef8cd733e5584b5909f789de856b4= 82cd7d069bdad8", + "sha256:4eec37370483331d13514c3f55f446fc5248d6373e7029a29e= cb7b7494851e7a", + "sha256:552a815579aa1e995f39fd05dde6cd378e191b063f031f2acf= e73ce9fb7f9e56", + "sha256:5873888fff1c7cf5b71efbe80e0e73153fe9212fafdf8e44ad= fe4c20ec9f82d7", + "sha256:61a3d5b97955422964be6b3baf05ff2ce7f26f52c85dd88db1= 1d5e03e146a3a6", + "sha256:674e822aa665b9fd75130c6c5f5ed9564a38c6cea6a6432ce4= 7eafb68ee578c5", + "sha256:7ce3175801d0ae5fdfa79b4f0cfed08807af4d075b402b7e29= 4e6aa72af9aa2a", + "sha256:9743c91088d396c1a5a3c9978354b61b0382b4e3c440ce83cf= 77994a43e8c521", + "sha256:9f94aac67a2045ec719ffe6111df543bac7874cee01f41928f= 6969756e030564", + "sha256:a26f8ec704e5a7423c8824d425086705e381b4f1dfdef6e3a1= edab7ba174ec49", + "sha256:abf7e0c3cf117c44d9285cc6128856106183938c68fd494476= 3003decdcfeb66", + "sha256:b09669bcda124e83708f34a94606e01b614fa71931d356c1f1= a5297ba11f110a", + "sha256:cd07039aa5df222037005b08fbbfd69b3ab0b0bd7a07d7906d= e75ae52c4e3119", + "sha256:d23e0ea196702d918b60c8288561e722bf437d82cb7ef2edcd= 98cfa38905d506", + "sha256:d65cc1df038ef55a99e617431f0553cd77763869eebdf90424= 03e16089fe746c", + "sha256:d7da2e1d5f558c37d6e8c1246f1aec1e7349e4913d8fb3cb28= 9a35de573fe2eb" + ], + "index": "pypi", + "version": "=3D=3D0.812" + }, + "mypy-extensions": { + "hashes": [ + "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a= 299250a846f15d", + "sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5= 343488a6c604a8" + ], + "version": "=3D=3D0.4.3" + }, "pycodestyle": { "hashes": [ "sha256:514f76d918fcc0b55c6680472f0a37970994e07bbb80725808= c17089be302068", diff --git a/python/setup.cfg b/python/setup.cfg index bd88b44ad80..b485d6161d5 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -31,6 +31,7 @@ exclude =3D __pycache__, strict =3D True python_version =3D 3.6 warn_unused_configs =3D True +namespace_packages =3D True =20 [pylint.messages control] # Disable the message, report, category or checker with the given id(s). Y= ou --=20 2.31.1