Skip to content

Commit 993f529

Browse files
authored
Merge pull request #232 from pycompression/modernpackaging
Switch to setuptools-scm, include tests in source tarball.
2 parents d08488b + fc7d5a5 commit 993f529

File tree

6 files changed

+74
-62
lines changed

6 files changed

+74
-62
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
- uses: actions/checkout@v4
1717
with:
1818
submodules: recursive
19-
- name: Set up Python 3.8
19+
- name: Set up Python 3.9
2020
uses: actions/setup-python@v5
2121
with:
22-
python-version: 3.8
22+
python-version: "3.9"
2323
- name: Install tox
2424
run: pip install tox
2525
- name: Lint
@@ -36,10 +36,10 @@ jobs:
3636
- uses: actions/checkout@v4
3737
with:
3838
submodules: recursive
39-
- name: Set up Python 3.8
39+
- name: Set up Python 3.9
4040
uses: actions/setup-python@v5
4141
with:
42-
python-version: 3.8
42+
python-version: "3.9"
4343
- name: Install isal
4444
run: sudo apt-get install libisal-dev
4545
- name: Install tox and upgrade setuptools and pip
@@ -54,7 +54,6 @@ jobs:
5454
strategy:
5555
matrix:
5656
python-version:
57-
- "3.8"
5857
- "3.9"
5958
- "3.10"
6059
- "3.11"
@@ -65,11 +64,11 @@ jobs:
6564
os: ["ubuntu-latest"]
6665
include:
6766
- os: "macos-13"
68-
python-version: "3.8"
67+
python-version: "3.9"
6968
- os: "macos-14"
7069
python-version: "3.10"
7170
- os: "windows-latest"
72-
python-version: "3.8"
71+
python-version: "3.9"
7372
steps:
7473
- uses: actions/checkout@v4
7574
with:
@@ -105,7 +104,7 @@ jobs:
105104
strategy:
106105
matrix:
107106
python_version:
108-
- "3.8"
107+
- "3.9"
109108
steps:
110109
- uses: actions/checkout@v4
111110
with:
@@ -243,14 +242,14 @@ jobs:
243242
CIBW_ENVIRONMENT_LINUX: >-
244243
PYTHON_ISAL_BUILD_CACHE=True
245244
PYTHON_ISAL_BUILD_CACHE_FILE=/tmp/build_cache
246-
CFLAGS="-g0 -DNDEBUG"
245+
CFLAGS="-O3 -DNDEBUG"
247246
CIBW_ENVIRONMENT_WINDOWS: >-
248247
PYTHON_ISAL_BUILD_CACHE=True
249248
PYTHON_ISAL_BUILD_CACHE_FILE=${{ runner.temp }}\build_cache
250249
CIBW_ENVIRONMENT_MACOS: >-
251250
PYTHON_ISAL_BUILD_CACHE=True
252251
PYTHON_ISAL_BUILD_CACHE_FILE=${{ runner.temp }}/build_cache
253-
CFLAGS="-g0 -DNDEBUG"
252+
CFLAGS="-O3 -DNDEBUG"
254253
- name: Build sdist
255254
if: ${{runner.os == 'Linux' && matrix.cibw_archs_linux == 'x86_64'}}
256255
run: |

CHANGELOG.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ Changelog
1010
1111
version 1.8.0-dev
1212
-----------------
13+
+ Python 3.8 is no longer supported.
14+
+ Change build backend to setuptools-scm which is more commonly used and
15+
supported.
16+
+ Include test packages in the source distribution, so source distribution
17+
installations can be verified.
1318
+ Fix an issue where some tests failed because they ignored PYTHONPATH.
1419

1520
version 1.7.2

MANIFEST.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
graft src/isal/isa-l
22
include src/isal/*.h
3-
prune tests
43
prune docs
4+
prune .github
5+
exclude .git*
56
prune benchmark_scripts
67
exclude requirements-docs.txt
78
exclude codecov.yml

pyproject.toml

Lines changed: 57 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,61 @@
11
[build-system]
2-
requires = ["setuptools>=64", "versioningit>=1.1.0"]
2+
requires = ["setuptools>=77", "setuptools-scm>=8"]
33
build-backend = "setuptools.build_meta"
44

5-
[tool.versioningit.vcs]
6-
method="git"
7-
default-tag = "v0.0.0"
5+
[project]
6+
name = "isal"
7+
dynamic = ["version"]
8+
description = """
9+
Faster zlib and gzip compatible compression and decompression by providing \
10+
python bindings for the ISA-L ibrary."""
11+
license="PSF-2.0"
12+
keywords=["isal", "isa-l", "compression", "deflate", "gzip", "igzip"]
13+
authors = [{name = "Leiden University Medical Center"},
14+
{email = "r.h.p.vorderman@lumc.nl"}]
15+
readme = "README.rst"
16+
requires-python = ">=3.9" # Because of setuptools version
17+
classifiers = [
18+
"Programming Language :: Python :: 3 :: Only",
19+
"Programming Language :: Python :: 3",
20+
"Programming Language :: Python :: 3.9",
21+
"Programming Language :: Python :: 3.10",
22+
"Programming Language :: Python :: 3.11",
23+
"Programming Language :: Python :: 3.12",
24+
"Programming Language :: Python :: 3.13",
25+
"Programming Language :: Python :: Implementation :: CPython",
26+
"Programming Language :: Python :: Implementation :: PyPy",
27+
"Programming Language :: C",
28+
"Development Status :: 5 - Production/Stable",
29+
"Topic :: System :: Archiving :: Compression",
30+
"Operating System :: POSIX :: Linux",
31+
"Operating System :: MacOS",
32+
"Operating System :: Microsoft :: Windows",
33+
]
34+
urls.homepage = "https://github.com/pycompression/python-isal"
35+
urls.documentation = "python-isal.readthedocs.io"
836

9-
[tool.versioningit.write]
10-
file = "src/isal/_version.py"
37+
[tool.setuptools_scm]
38+
version_file = "src/isal/_version.py"
39+
40+
[tool.setuptools.packages.find]
41+
where = ["src"]
42+
include = ["isal"]
43+
44+
[tool.setuptools.package-data]
45+
isal = ['*.pyi', 'py.typed', 'isa-l/LICENSE', 'isa-l/README.md', 'isa-l/Release_notes.txt']
46+
[tool.setuptools.exclude-package-data]
47+
isal = [
48+
"*.c",
49+
"*.h",
50+
"isa-l/*/*",
51+
"isa-l/Mak*",
52+
"isa-l/.*",
53+
"isa-l/autogen.sh",
54+
"isa-l/Doxyfile",
55+
"isa-l/CONTRIBUTING.md",
56+
"isa-l/SECURITY.md",
57+
"isa-l/configure.ac",
58+
"isa-l/isa-l.*",
59+
"isa-l/libisal.pc.in",
60+
"isa-l/make.inc",
61+
]

setup.cfg

Lines changed: 0 additions & 2 deletions
This file was deleted.

setup.py

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,9 @@
1515
import tempfile
1616
from pathlib import Path
1717

18-
from setuptools import Extension, find_packages, setup
18+
from setuptools import Extension, setup
1919
from setuptools.command.build_ext import build_ext
2020

21-
import versioningit
22-
2321
ISA_L_SOURCE = os.path.join("src", "isal", "isa-l")
2422

2523
SYSTEM_IS_BSD = (sys.platform.startswith("freebsd") or
@@ -138,46 +136,6 @@ def build_isa_l():
138136

139137

140138
setup(
141-
name="isal",
142-
version=versioningit.get_version(),
143-
description="Faster zlib and gzip compatible compression and "
144-
"decompression by providing python bindings for the ISA-L "
145-
"library.",
146-
author="Leiden University Medical Center",
147-
author_email="r.h.p.vorderman@lumc.nl", # A placeholder for now
148-
long_description=Path("README.rst").read_text(),
149-
long_description_content_type="text/x-rst",
150139
cmdclass={"build_ext": BuildIsalExt},
151-
license="PSF-2.0",
152-
keywords="isal isa-l compression deflate gzip igzip threads",
153-
zip_safe=False,
154-
packages=find_packages('src'),
155-
package_dir={'': 'src'},
156-
package_data={'isal': ['*.pyi', 'py.typed',
157-
# Include isa-l LICENSE and other relevant files
158-
# with the binary distribution.
159-
'isa-l/LICENSE', 'isa-l/README.md',
160-
'isa-l/Release_notes.txt']},
161-
url="https://github.com/pycompression/python-isal",
162-
classifiers=[
163-
"Programming Language :: Python :: 3 :: Only",
164-
"Programming Language :: Python :: 3",
165-
"Programming Language :: Python :: 3.8",
166-
"Programming Language :: Python :: 3.9",
167-
"Programming Language :: Python :: 3.10",
168-
"Programming Language :: Python :: 3.11",
169-
"Programming Language :: Python :: 3.12",
170-
"Programming Language :: Python :: 3.13",
171-
"Programming Language :: Python :: Implementation :: CPython",
172-
"Programming Language :: Python :: Implementation :: PyPy",
173-
"Programming Language :: C",
174-
"Development Status :: 5 - Production/Stable",
175-
"Topic :: System :: Archiving :: Compression",
176-
"License :: OSI Approved :: Python Software Foundation License",
177-
"Operating System :: POSIX :: Linux",
178-
"Operating System :: MacOS",
179-
"Operating System :: Microsoft :: Windows",
180-
],
181-
python_requires=">=3.8", # BadGzipFile imported
182140
ext_modules=EXTENSIONS
183141
)

0 commit comments

Comments
 (0)