]> git.proxmox.com Git - mirror_qemu.git/commitdiff
python: expose typing information via PEP 561
authorJohn Snow <jsnow@redhat.com>
Tue, 29 Jun 2021 21:43:10 +0000 (17:43 -0400)
committerJohn Snow <jsnow@redhat.com>
Thu, 1 Jul 2021 01:54:04 +0000 (21:54 -0400)
https://www.python.org/dev/peps/pep-0561/#specification

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 in setup.cfg, but I genuinely could not figure out how to
get it to include things from the *source root* into the *package root*;
only how to include things from each subpackage. I tried!

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Message-id: 20210629214323.1329806-3-jsnow@redhat.com
Signed-off-by: John Snow <jsnow@redhat.com>
python/qemu/machine/py.typed [new file with mode: 0644]
python/qemu/qmp/py.typed [new file with mode: 0644]
python/qemu/utils/py.typed [new file with mode: 0644]
python/setup.cfg

diff --git a/python/qemu/machine/py.typed b/python/qemu/machine/py.typed
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/python/qemu/qmp/py.typed b/python/qemu/qmp/py.typed
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/python/qemu/utils/py.typed b/python/qemu/utils/py.typed
new file mode 100644 (file)
index 0000000..e69de29
index 85cecbb41bcabc430ce6923fd7b1bff3e63cd6b0..db1639c1f24f0d737e12301788107d2e5a17029f 100644 (file)
@@ -19,6 +19,7 @@ classifiers =
     Programming Language :: Python :: 3.8
     Programming Language :: Python :: 3.9
     Programming Language :: Python :: 3.10
+    Typing :: Typed
 
 [options]
 python_requires = >= 3.6
@@ -27,6 +28,9 @@ packages =
     qemu.machine
     qemu.utils
 
+[options.package_data]
+* = py.typed
+
 [options.extras_require]
 # Run `pipenv lock --dev` when changing these requirements.
 devel =