diff --git a/python/pyproject.toml b/python/pyproject.toml index 3ec1bd411..9ff0c63e6 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -1,7 +1,41 @@ [build-system] -requires = ["setuptools>=45", "wheel", "setuptools_scm>=6.2", "cffi>=1.0.0", "pkgconfig"] +requires = ["setuptools>=45", "wheel", "setuptools_scm[toml]>=6.2", "cffi>=1.0.0", "pkgconfig"] build-backend = "setuptools.build_meta" +[project] +name = "deltachat" +description = "Python bindings for the Delta Chat Core library using CFFI against the Rust-implemented libdeltachat" +readme = "README.rst" +requires-python = ">=3.7" +authors = [ + { name = "holger krekel, Floris Bruynooghe, Bjoern Petersen and contributors" }, +] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)", + "Programming Language :: Python :: 3", + "Topic :: Communications :: Email", + "Topic :: Software Development :: Libraries", +] +dependencies = [ + "cffi>=1.0.0", + "imap-tools", + "pluggy", + "requests", +] +dynamic = [ + "version" +] + +[project.urls] +"Home" = "https://github.com/deltachat/deltachat-core-rust/" +"Bug Tracker" = "https://github.com/deltachat/deltachat-core-rust/issues" +"Documentation" = "https://py.delta.chat/" + +[project.entry-points.pytest11] +"deltachat.testplugin" = "deltachat.testplugin" + [tool.setuptools_scm] root = ".." tag_regex = '^(?Ppy-)?(?P[^\+]+)(?P.*)?$' diff --git a/python/setup.py b/python/setup.py index 9363812c0..3f1dc6937 100644 --- a/python/setup.py +++ b/python/setup.py @@ -1,40 +1,4 @@ -import os -import re - -import setuptools - - -def main(): - with open("README.rst") as f: - long_description = f.read() - setuptools.setup( - name="deltachat", - description="Python bindings for the Delta Chat Core library using CFFI against the Rust-implemented libdeltachat", - long_description=long_description, - author="holger krekel, Floris Bruynooghe, Bjoern Petersen and contributors", - install_requires=["cffi>=1.0.0", "pluggy", "imap-tools", "requests"], - setup_requires=[ - "setuptools_scm", # required for compatibility with `python3 setup.py sdist` - "pkgconfig", - ], - packages=setuptools.find_packages("src"), - package_dir={"": "src"}, - cffi_modules=["src/deltachat/_build.py:ffibuilder"], - entry_points={ - "pytest11": [ - "deltachat.testplugin = deltachat.testplugin", - ], - }, - classifiers=[ - "Development Status :: 4 - Beta", - "Intended Audience :: Developers", - "License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)", - "Programming Language :: Python :: 3", - "Topic :: Communications :: Email", - "Topic :: Software Development :: Libraries", - ], - ) - +from setuptools import setup if __name__ == "__main__": - main() + setup(cffi_modules=["src/deltachat/_build.py:ffibuilder"]) diff --git a/python/tests/package_wheels.py b/python/tests/package_wheels.py deleted file mode 100644 index 421843944..000000000 --- a/python/tests/package_wheels.py +++ /dev/null @@ -1,13 +0,0 @@ -import os -import subprocess -import sys - -if __name__ == "__main__": - assert len(sys.argv) == 2 - wheelhousedir = sys.argv[1] - # pip wheel will build in an isolated tmp dir that does not have git - # history so setuptools_scm can not automatically determine a - # version there. So pass in the version through an env var. - version = subprocess.check_output(["python", "setup.py", "--version"]).strip().split(b"\n")[-1] - os.environ["SETUPTOOLS_SCM_PRETEND_VERSION"] = version.decode("ascii") - subprocess.check_call(("pip wheel . -w %s" % wheelhousedir).split()) diff --git a/python/tox.ini b/python/tox.ini index 866585208..e3bbaa43b 100644 --- a/python/tox.ini +++ b/python/tox.ini @@ -9,7 +9,7 @@ envlist = [testenv] commands = pytest -n6 --extra-info --reruns 2 --reruns-delay 5 -v -rsXx --ignored --strict-tls {posargs: tests examples} - python tests/package_wheels.py {toxworkdir}/wheelhouse + pip wheel . -w {toxworkdir}/wheelhouse passenv = DCC_RS_DEV DCC_RS_TARGET