From 032da4fb1a50261ffb5960bacd479f13e1762d41 Mon Sep 17 00:00:00 2001 From: link2xt Date: Wed, 15 Feb 2023 16:03:23 +0000 Subject: [PATCH] python: add py.typed file It marks the package as supporting typing according to PEP 561 Also remove zip-safe option from setuptools configuration for deltachat-rpc-client. It is deprecated in setuptools and not used for wheel package format according to --- CHANGELOG.md | 1 + deltachat-rpc-client/pyproject.toml | 7 ------- python/pyproject.toml | 5 +++++ python/src/deltachat/py.typed | 0 4 files changed, 6 insertions(+), 7 deletions(-) create mode 100644 python/src/deltachat/py.typed diff --git a/CHANGELOG.md b/CHANGELOG.md index a0a2169ce..3cfd88c21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### Changes - deltachat-rpc-client: use `dataclass` for `Account`, `Chat`, `Contact` and `Message` #4042 +- python: mark bindings as supporting typing according to PEP 561 #4045 ### Fixes - deltachat-rpc-server: do not block stdin while processing the request. #4041 diff --git a/deltachat-rpc-client/pyproject.toml b/deltachat-rpc-client/pyproject.toml index 7797ac903..ef76fa82b 100644 --- a/deltachat-rpc-client/pyproject.toml +++ b/deltachat-rpc-client/pyproject.toml @@ -13,13 +13,6 @@ dynamic = [ "version" ] -[tool.setuptools] -# We declare the package not-zip-safe so that our type hints are also available -# when checking client code that uses our (installed) package. -# Ref: -# https://mypy.readthedocs.io/en/stable/installed_packages.html?highlight=zip#using-installed-packages-with-mypy-pep-561 -zip-safe = false - [tool.setuptools.package-data] deltachat_rpc_client = [ "py.typed" diff --git a/python/pyproject.toml b/python/pyproject.toml index e1ed72bea..4aa6666db 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -36,6 +36,11 @@ dynamic = [ [project.entry-points.pytest11] "deltachat.testplugin" = "deltachat.testplugin" +[tool.setuptools.package-data] +deltachat = [ + "py.typed" +] + [tool.setuptools_scm] root = ".." tag_regex = '^(?Ppy-)?(?P[^\+]+)(?P.*)?$' diff --git a/python/src/deltachat/py.typed b/python/src/deltachat/py.typed new file mode 100644 index 000000000..e69de29bb