qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	qemu-block@nongnu.org, Markus Armbruster <armbru@redhat.com>,
	Max Reitz <mreitz@redhat.com>, Cleber Rosa <crosa@redhat.com>,
	John Snow <jsnow@redhat.com>
Subject: [PATCH RFC 1/3] python: expose typing information via PEP 561
Date: Fri,  4 Jun 2021 12:39:05 -0400	[thread overview]
Message-ID: <20210604163907.1511224-2-jsnow@redhat.com> (raw)
In-Reply-To: <20210604163907.1511224-1-jsnow@redhat.com>

Create 'py.typed' files in each subpackage that indicate to mypy that
this is a typed module, so that users of any of these packages can use
mypy to check their code as well.

(Note: theoretically it's possible to ditch MANIFEST.in in favor of
using package_data, but I genuinely could not figure out how to get it
to include things from the source root into the package root. I
tried!...)

https: //www.python.org/dev/peps/pep-0561/#specification
Signed-off-by: John Snow <jsnow@redhat.com>
---
 python/qemu/machine/py.typed | 0
 python/qemu/qmp/py.typed     | 0
 python/qemu/utils/py.typed   | 0
 python/setup.cfg             | 3 +++
 4 files changed, 3 insertions(+)
 create mode 100644 python/qemu/machine/py.typed
 create mode 100644 python/qemu/qmp/py.typed
 create mode 100644 python/qemu/utils/py.typed

diff --git a/python/qemu/machine/py.typed b/python/qemu/machine/py.typed
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/python/qemu/qmp/py.typed b/python/qemu/qmp/py.typed
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/python/qemu/utils/py.typed b/python/qemu/utils/py.typed
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/python/setup.cfg b/python/setup.cfg
index 0fcdec6f32..a1f9e9d76d 100644
--- a/python/setup.cfg
+++ b/python/setup.cfg
@@ -37,6 +37,9 @@ devel =
     pylint >= 2.8.0
     tox >= 3.18.0
 
+[options.package_data]
+* = py.typed
+
 [flake8]
 extend-ignore = E722  # Prefer pylint's bare-except checks to flake8's
 exclude = __pycache__,
-- 
2.31.1



  reply	other threads:[~2021-06-04 17:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-04 16:39 [PATCH RFC 0/3] python/iotests: Run iotest linters during Python CI John Snow
2021-06-04 16:39 ` John Snow [this message]
2021-06-04 16:39 ` [PATCH RFC 2/3] iotests: split 'linters.py' off from 297 John Snow
2021-06-05 14:27   ` Vladimir Sementsov-Ogievskiy
2021-06-07 15:40     ` John Snow
2021-06-04 16:39 ` [PATCH RFC 3/3] python: Add iotest linters to test suite John Snow
2021-06-05 14:08 ` [PATCH RFC 0/3] python/iotests: Run iotest linters during Python CI Vladimir Sementsov-Ogievskiy
2021-06-07 15:51   ` John Snow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210604163907.1511224-2-jsnow@redhat.com \
    --to=jsnow@redhat.com \
    --cc=armbru@redhat.com \
    --cc=crosa@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).