File modern-packaging.patch of Package python-isal

From 0215519b557f574352620a06255921d8025ecef1 Mon Sep 17 00:00:00 2001
From: Ruben Vorderman <r.h.p.vorderman@lumc.nl>
Date: Tue, 27 May 2025 13:08:28 +0200
Subject: [PATCH 1/5] Move to setuptools-scm

---
 MANIFEST.in    |  2 ++
 pyproject.toml | 62 +++++++++++++++++++++++++++++++++++++++++++++-----
 setup.cfg      |  2 --
 setup.py       | 44 +----------------------------------
 4 files changed, 59 insertions(+), 51 deletions(-)
 delete mode 100644 setup.cfg

diff --git a/MANIFEST.in b/MANIFEST.in
index 8cc2b029..23ea5299 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -2,6 +2,8 @@ graft src/isal/isa-l
 include src/isal/*.h
 prune tests
 prune docs
+prune .github
+exclude .git*
 prune benchmark_scripts
 exclude requirements-docs.txt
 exclude codecov.yml
diff --git a/pyproject.toml b/pyproject.toml
index bf5fe99c..425f0f9d 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,10 +1,60 @@
 [build-system]
-requires = ["setuptools>=64", "versioningit>=1.1.0"]
+requires = ["setuptools>=77", "setuptools-scm>=8"]
 build-backend = "setuptools.build_meta"
 
-[tool.versioningit.vcs]
-method="git"
-default-tag = "v0.0.0"
+[project]
+name = "isal"
+dynamic = ["version"]
+description = """
+Faster zlib and gzip compatible compression and decompression by providing \
+python bindings for the ISA-L ibrary."""
+license="PSF-2.0"
+keywords=["isal", "isa-l", "compression", "deflate", "gzip", "igzip"]
+authors = [{name = "Leiden University Medical Center"},
+           {email = "r.h.p.vorderman@lumc.nl"}]
+readme = "README.rst"
+requires-python = ">=3.8"  # BadGzipFile imported
+classifiers = [
+        "Programming Language :: Python :: 3 :: Only",
+        "Programming Language :: Python :: 3",
+        "Programming Language :: Python :: 3.7",
+        "Programming Language :: Python :: 3.8",
+        "Programming Language :: Python :: 3.9",
+        "Programming Language :: Python :: 3.10",
+        "Programming Language :: Python :: Implementation :: CPython",
+        "Programming Language :: Python :: Implementation :: PyPy",
+        "Programming Language :: C",
+        "Development Status :: 5 - Production/Stable",
+        "Topic :: System :: Archiving :: Compression",
+        "Operating System :: POSIX :: Linux",
+        "Operating System :: MacOS",
+        "Operating System :: Microsoft :: Windows",
+]
+urls.homepage = "https://github.com/pycompression/python-isal"
+urls.documentation = "python-isal.readthedocs.io"
 
-[tool.versioningit.write]
-file = "src/isal/_version.py"
+[tool.setuptools_scm]
+version_file = "src/isal/_version.py"
+
+[tool.setuptools.packages.find]
+where = ["src"]
+include = ["isal"]
+
+[tool.setuptools.package-data]
+isal = ['*.pyi', 'py.typed', 'isa-l/LICENSE', 'isa-l/README.md', 'isa-l/Release_notes.txt']
+[tool.setuptools.exclude-package-data]
+isal = [
+        "*.c",
+        "*.h",
+        "isa-l/*/*",
+        "isa-l/Mak*",
+        "isa-l/.*",
+        "isa-l/autogen.sh",
+        "isa-l/Doxyfile",
+        "isa-l/CONTRIBUTING.md",
+        "isa-l/SECURITY.md",
+        "isa-l/configure.ac",
+        "isa-l/isa-l.*",
+        "isa-l/libisal.pc.in",
+        "isa-l/make.inc",
+]
diff --git a/setup.cfg b/setup.cfg
deleted file mode 100644
index 256134e1..00000000
--- a/setup.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-[metadata]
-license_files=LICENSE
\ No newline at end of file
diff --git a/setup.py b/setup.py
index 55c89496..1ed64c2d 100644
--- a/setup.py
+++ b/setup.py
@@ -15,11 +15,9 @@
 import tempfile
 from pathlib import Path
 
-from setuptools import Extension, find_packages, setup
+from setuptools import Extension, setup
 from setuptools.command.build_ext import build_ext
 
-import versioningit
-
 ISA_L_SOURCE = os.path.join("src", "isal", "isa-l")
 
 SYSTEM_IS_BSD = (sys.platform.startswith("freebsd") or
@@ -138,46 +136,6 @@ def build_isa_l():
 
 
 setup(
-    name="isal",
-    version=versioningit.get_version(),
-    description="Faster zlib and gzip compatible compression and "
-                "decompression by providing python bindings for the ISA-L "
-                "library.",
-    author="Leiden University Medical Center",
-    author_email="r.h.p.vorderman@lumc.nl",  # A placeholder for now
-    long_description=Path("README.rst").read_text(),
-    long_description_content_type="text/x-rst",
     cmdclass={"build_ext": BuildIsalExt},
-    license="PSF-2.0",
-    keywords="isal isa-l compression deflate gzip igzip threads",
-    zip_safe=False,
-    packages=find_packages('src'),
-    package_dir={'': 'src'},
-    package_data={'isal': ['*.pyi', 'py.typed',
-                           # Include isa-l LICENSE and other relevant files
-                           # with the binary distribution.
-                           'isa-l/LICENSE', 'isa-l/README.md',
-                           'isa-l/Release_notes.txt']},
-    url="https://github.com/pycompression/python-isal",
-    classifiers=[
-        "Programming Language :: Python :: 3 :: Only",
-        "Programming Language :: Python :: 3",
-        "Programming Language :: Python :: 3.8",
-        "Programming Language :: Python :: 3.9",
-        "Programming Language :: Python :: 3.10",
-        "Programming Language :: Python :: 3.11",
-        "Programming Language :: Python :: 3.12",
-        "Programming Language :: Python :: 3.13",
-        "Programming Language :: Python :: Implementation :: CPython",
-        "Programming Language :: Python :: Implementation :: PyPy",
-        "Programming Language :: C",
-        "Development Status :: 5 - Production/Stable",
-        "Topic :: System :: Archiving :: Compression",
-        "License :: OSI Approved :: Python Software Foundation License",
-        "Operating System :: POSIX :: Linux",
-        "Operating System :: MacOS",
-        "Operating System :: Microsoft :: Windows",
-    ],
-    python_requires=">=3.8",  # BadGzipFile imported
     ext_modules=EXTENSIONS
 )

From 1da70a5bb2c4c3e7853064afe91b79098428bc35 Mon Sep 17 00:00:00 2001
From: Ruben Vorderman <r.h.p.vorderman@lumc.nl>
Date: Tue, 27 May 2025 13:08:44 +0200
Subject: [PATCH 2/5] Include tests in source distribution

---
 MANIFEST.in | 1 -
 1 file changed, 1 deletion(-)

diff --git a/MANIFEST.in b/MANIFEST.in
index 23ea5299..4a48e873 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,6 +1,5 @@
 graft src/isal/isa-l
 include src/isal/*.h
-prune tests
 prune docs
 prune .github
 exclude .git*
openSUSE Build Service is sponsored by