From a73adb1859fd89df67abfaa48f9c7f48a2d41748 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 25 Sep 2024 08:16:24 -0400 Subject: [PATCH] EPEL10: Work around versioningit unavailability We can eventually have python-versioningit in EPEL10, but it requires python-pydantic v2, which needs rust-pyo3 and maturin in order to build pythn-pydantic-core. Since we already worked around not having python-versioningit in EPEL9 (where we have python-pydantic v1 and will not have v2 in the future), we might as well use the same workaround in EPEL10 to avoid having to wait on Pydantic v2. Instead of using versioningit, this patch provides @VERSION@ templates in setup.py and src/zlib_ng/_version.py, which should be replaced with the actual version number using sed. --- .gitignore | 2 -- pyproject.toml | 9 +-------- setup.py | 4 +--- src/zlib_ng/_version.py | 1 + 4 files changed, 3 insertions(+), 13 deletions(-) create mode 100644 src/zlib_ng/_version.py diff --git a/.gitignore b/.gitignore index 671f3ec..b6e4761 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ -src/zlib_ng/_version.py - # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] diff --git a/pyproject.toml b/pyproject.toml index 28ae41d..b2fcc25 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,3 @@ [build-system] -requires = ["setuptools>=64", "versioningit>=1.1.0"] +requires = ["setuptools>=64"] build-backend = "setuptools.build_meta" - -[tool.versioningit.vcs] -method="git" -default-tag = "v0.0.0" - -[tool.versioningit.write] -file = "src/zlib_ng/_version.py" diff --git a/setup.py b/setup.py index 8959b04..600a84f 100644 --- a/setup.py +++ b/setup.py @@ -16,8 +16,6 @@ from pathlib import Path from setuptools import Extension, find_packages, setup from setuptools.command.build_ext import build_ext -import versioningit - ZLIB_NG_SOURCE = os.path.join("src", "zlib_ng", "zlib-ng") SYSTEM_IS_UNIX = (sys.platform.startswith("linux") or @@ -126,7 +124,7 @@ def build_zlib_ng(): setup( name="zlib-ng", - version=versioningit.get_version(), + version="@VERSION@", description="Drop-in replacement for zlib and gzip modules using zlib-ng", author="Leiden University Medical Center", author_email="r.h.p.vorderman@lumc.nl", # A placeholder for now diff --git a/src/zlib_ng/_version.py b/src/zlib_ng/_version.py new file mode 100644 index 0000000..b238b3b --- /dev/null +++ b/src/zlib_ng/_version.py @@ -0,0 +1 @@ +__version__ = "@VERSION@" -- 2.46.1