python: add py.typed file

It marks the package as supporting typing according to PEP 561 <https://peps.python.org/pep-0561/>

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 <https://setuptools.pypa.io/en/latest/deprecated/zip_safe.html>
This commit is contained in:
link2xt
2023-02-15 16:03:23 +00:00
parent 0de5125de8
commit 032da4fb1a
4 changed files with 6 additions and 7 deletions

View File

@@ -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

View File

@@ -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"

View File

@@ -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 = '^(?P<prefix>py-)?(?P<version>[^\+]+)(?P<suffix>.*)?$'

View File