From c9a634302786896d4ade5d388e0e23bf38f2fc00 Mon Sep 17 00:00:00 2001 From: KOLANICH Date: Tue, 25 Oct 2022 12:09:54 +0300 Subject: [PATCH] Changed the build backend to `hatchling`. Ones who want to use `setuptools` can change `build-system` section of `pyproject.toml`, the specific config for it was kept. --- ci.sh | 2 +- pyproject.toml | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ci.sh b/ci.sh index 7ea015d77c..ba54df80ca 100755 --- a/ci.sh +++ b/ci.sh @@ -66,7 +66,7 @@ fi python -c "import sys, struct, ssl; print('#' * 70); print('python:', sys.version); print('version_info:', sys.version_info); print('bits:', struct.calcsize('P') * 8); print('openssl:', ssl.OPENSSL_VERSION, ssl.OPENSSL_VERSION_INFO); print('#' * 70)" -python -m pip install -U pip setuptools setuptools_scm wheel build +python -m pip install -U pip hatchling build python -m pip --version python -m build -nsx . diff --git a/pyproject.toml b/pyproject.toml index c29b8ac8ac..be345ee9f1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,11 @@ [build-system] -requires = ["setuptools>=61.2"] -build-backend = "setuptools.build_meta" +requires = ["hatchling>=1.8.0"] +build-backend = "hatchling.build" +#requires = ["setuptools>=61.2", "setuptools_scm[toml]>=3.4.3"] +#build-backend = "setuptools.build_meta" [project] name = "trio" -version = "0.22.0" authors = [{name = "Nathaniel J. Smith", email = "njs@pobox.com"}] license = {text = "MIT OR Apache-2.0"} description = "A friendly Python library for async concurrency and I/O" @@ -45,6 +46,10 @@ dependencies = [ "cffi>=1.14; os_name == 'nt' and implementation_name != 'pypy'", "exceptiongroup >= 1.0.0rc9; python_version < '3.11'", ] +dynamic = ["version"] + +[tool.hatch.version] +path = "trio/_version.py" [tool.setuptools] include-package-data = true @@ -52,6 +57,10 @@ include-package-data = true [tool.setuptools.packages] find = {namespaces = false} +[tool.setuptools_scm] +write_to = "trio/_version.py" +write_to_template = "__version__ = \"{version}\"\n" + [tool.black] target-version = ['py37']