From 67d9f915bc15f0ff0e60270814294750a48aadd2 Mon Sep 17 00:00:00 2001 From: Onuralp SEZER Date: Sun, 22 Sep 2024 02:09:55 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9E=20dynamic=20version=20syste?= =?UTF-8?q?m=20for=20older=20python=20and=20setuptools?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Onuralp SEZER --- pyacl/__init__.py | 8 +------- pyacl/__version__.py | 1 + pyproject.toml | 10 +++++++--- 3 files changed, 9 insertions(+), 10 deletions(-) create mode 100644 pyacl/__version__.py diff --git a/pyacl/__init__.py b/pyacl/__init__.py index 02a1682..d7ef4ef 100644 --- a/pyacl/__init__.py +++ b/pyacl/__init__.py @@ -8,10 +8,4 @@ An English copy of the Licence is shipped in a file called LICENSE along with th You may obtain copies of the Licence in any of the official languages at https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12. """ -import importlib.metadata as importlib_metadata - -try: - # This will read version from pyproject.toml - __version__ = importlib_metadata.version(__package__ or __name__) -except importlib_metadata.PackageNotFoundError: - __version__ = "development" +from .__version__ import __version__ \ No newline at end of file diff --git a/pyacl/__version__.py b/pyacl/__version__.py new file mode 100644 index 0000000..0058b93 --- /dev/null +++ b/pyacl/__version__.py @@ -0,0 +1 @@ +__version__ = "1.0.1" \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 21ff649..8fc042e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,12 +1,12 @@ [build-system] -requires = ["setuptools", "setuptools-scm", "wheel"] +requires = ["setuptools", "wheel"] build-backend = "setuptools.build_meta" + [project] name = 'pyacl' description = 'High level abstractions over pylibacl' -version = '1.0.1' -readme = "README.md" +dynamic = ["version", "readme"] authors = [ { name='Georg Pfuetzenreuter', email='georg+python@lysergic.dev' }, ] @@ -44,6 +44,10 @@ dev = [ [tool.setuptools] include-package-data = true # include non-python files in the package (default) +[tool.setuptools.dynamic] +version = {attr = "pyacl.__version__"} +readme = {file = ["README.md"]} + [tool.setuptools.packages.find] where = ["."] exclude = ["scripts", "scripts.*", "docs.*", "tests", "tests.*", "ruff.toml"]