Skip to content
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
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ Changelog

version 1.10.0-dev
------------------
+ Speed up ``import isal`` by about 0.1 ms in programs that have not imported
``__future__`` yet. The version module that is generated when isal is built
no longer imports ``__future__``. Building isal now requires setuptools-scm
9.2 or later.
+ Fix ``igzip_threaded`` files that stopped working when the thread that
opened them ended, for example a ``ThreadPoolExecutor`` thread after
``shutdown()``. Reads returned truncated data without an error, and writes
Expand Down
30 changes: 29 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=77", "setuptools-scm>=8"]
requires = ["setuptools>=77", "setuptools-scm>=9.2"]
build-backend = "setuptools.build_meta"

[project]
Expand Down Expand Up @@ -36,6 +36,34 @@ urls.documentation = "https://python-isal.readthedocs.io"

[tool.setuptools_scm]
version_file = "src/isal/_version.py"
# The default template of setuptools-scm 10 without its
# "from __future__ import annotations", which slows down "import isal".
# scm_version.short_node needs setuptools-scm 9.2 or later.
version_file_template = '''
# file generated by setuptools-scm
# don't change, don't track in version control

__all__ = [
"__version__",
"__version_tuple__",
"version",
"version_tuple",
"__commit_id__",
"commit_id",
]

version: str
__version__: str
__version_tuple__: tuple[int | str, ...]
version_tuple: tuple[int | str, ...]
commit_id: str | None
__commit_id__: str | None

__version__ = version = {version!r}
__version_tuple__ = version_tuple = {version_tuple!r}

__commit_id__ = commit_id = {scm_version.short_node!r}
'''

[tool.setuptools.packages.find]
where = ["src"]
Expand Down
5 changes: 5 additions & 0 deletions src/isal/_version.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@
# This file is part of python-isal which is distributed under the
# PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2.

version: str
__version__: str
__version_tuple__: tuple[int | str, ...]
version_tuple: tuple[int | str, ...]
commit_id: str | None
__commit_id__: str | None
8 changes: 8 additions & 0 deletions tests/test_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""Check the version module that setuptools-scm writes."""
from importlib import metadata

import isal


def test_version_matches_package_metadata():
assert isal.__version__ == metadata.version("isal")
Loading