Skip to content

Switch to setuptools-scm, include tests in source tarball. #232

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: "3.9"
- name: Install tox
run: pip install tox
- name: Lint
Expand All @@ -36,10 +36,10 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Python 3.8
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: "3.9"
- name: Install isal
run: sudo apt-get install libisal-dev
- name: Install tox and upgrade setuptools and pip
Expand All @@ -54,7 +54,6 @@ jobs:
strategy:
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
Expand All @@ -65,11 +64,11 @@ jobs:
os: ["ubuntu-latest"]
include:
- os: "macos-13"
python-version: "3.8"
python-version: "3.9"
- os: "macos-14"
python-version: "3.10"
- os: "windows-latest"
python-version: "3.8"
python-version: "3.9"
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -105,7 +104,7 @@ jobs:
strategy:
matrix:
python_version:
- "3.8"
- "3.9"
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -243,14 +242,14 @@ jobs:
CIBW_ENVIRONMENT_LINUX: >-
PYTHON_ISAL_BUILD_CACHE=True
PYTHON_ISAL_BUILD_CACHE_FILE=/tmp/build_cache
CFLAGS="-g0 -DNDEBUG"
CFLAGS="-O3 -DNDEBUG"
CIBW_ENVIRONMENT_WINDOWS: >-
PYTHON_ISAL_BUILD_CACHE=True
PYTHON_ISAL_BUILD_CACHE_FILE=${{ runner.temp }}\build_cache
CIBW_ENVIRONMENT_MACOS: >-
PYTHON_ISAL_BUILD_CACHE=True
PYTHON_ISAL_BUILD_CACHE_FILE=${{ runner.temp }}/build_cache
CFLAGS="-g0 -DNDEBUG"
CFLAGS="-O3 -DNDEBUG"
- name: Build sdist
if: ${{runner.os == 'Linux' && matrix.cibw_archs_linux == 'x86_64'}}
run: |
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ Changelog

version 1.8.0-dev
-----------------
+ Python 3.8 is no longer supported.
+ Change build backend to setuptools-scm which is more commonly used and
supported.
+ Include test packages in the source distribution, so source distribution
installations can be verified.
+ Fix an issue where some tests failed because they ignored PYTHONPATH.

version 1.7.2
Expand Down
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,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
Expand Down
63 changes: 57 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,61 @@
[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.9" # Because of setuptools version
classifiers = [
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3",
"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",
"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",
]
2 changes: 0 additions & 2 deletions setup.cfg

This file was deleted.

44 changes: 1 addition & 43 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
)
Loading