From 40267e1531da76d5ce4a1e43782374c074c1cd90 Mon Sep 17 00:00:00 2001 From: Ruben Vorderman Date: Wed, 24 Jan 2024 10:46:15 +0100 Subject: [PATCH 1/2] Use ISA-L 2.31.0 --- CHANGELOG.rst | 1 + src/isal/isa-l | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index c6e57dba..39bcbb53 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -9,6 +9,7 @@ Changelog version 1.6.0-dev ----------------- ++ Update statically linked ISA-L release to 2.31.0 + Fix an error that occurred in the ``__close__`` function when a threaded writer was initialized with incorrect parameters. diff --git a/src/isal/isa-l b/src/isal/isa-l index d4e1c21a..bd226375 160000 --- a/src/isal/isa-l +++ b/src/isal/isa-l @@ -1 +1 @@ -Subproject commit d4e1c21acbc61df30804004b61b068d9da7d3c6a +Subproject commit bd226375027899087bd48f3e59b910430615cc0a From a7ffab76af5c049ceacc1fd0b90d0816115d9933 Mon Sep 17 00:00:00 2001 From: Ruben Vorderman Date: Wed, 24 Jan 2024 10:51:41 +0100 Subject: [PATCH 2/2] Assume latest version with Windows header and zlib patch is available --- setup.py | 11 +++-------- src/isal/__init__.py | 15 ++------------- tests/test_compat.py | 5 ----- tests/test_zlib_compliance.py | 4 ---- 4 files changed, 5 insertions(+), 30 deletions(-) diff --git a/setup.py b/setup.py index 728200be..008e16ba 100644 --- a/setup.py +++ b/setup.py @@ -33,16 +33,11 @@ DEFAULT_CACHE_FILE)) EXTENSIONS = [ - Extension("isal.isal_zlib", ["src/isal/isal_zlibmodule.c"]), - Extension("isal.igzip_lib", ["src/isal/igzip_libmodule.c"]), + Extension("isal.isal_zlib", ["src/isal/isal_zlibmodule.c"]), + Extension("isal.igzip_lib", ["src/isal/igzip_libmodule.c"]), + Extension("isal._isal", ["src/isal/_isalmodule.c"]), ] -# This does not add the extension on windows for dynamic linking. The required -# header file might be missing. -if not (SYSTEM_IS_WINDOWS and - os.getenv("PYTHON_ISAL_LINK_DYNAMIC") is not None): - EXTENSIONS.append(Extension("isal._isal", ["src/isal/_isalmodule.c"])) - class BuildIsalExt(build_ext): def build_extension(self, ext): diff --git a/src/isal/__init__.py b/src/isal/__init__.py index f7257098..d6c02fdb 100644 --- a/src/isal/__init__.py +++ b/src/isal/__init__.py @@ -5,19 +5,8 @@ # This file is part of python-isal which is distributed under the # PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2. -from typing import Optional - -try: - from . import _isal - ISAL_MAJOR_VERSION: Optional[int] = _isal.ISAL_MAJOR_VERSION - ISAL_MINOR_VERSION: Optional[int] = _isal.ISAL_MINOR_VERSION - ISAL_PATCH_VERSION: Optional[int] = _isal.ISAL_PATCH_VERSION - ISAL_VERSION: Optional[str] = _isal.ISAL_VERSION -except ImportError: - ISAL_MAJOR_VERSION = None - ISAL_MINOR_VERSION = None - ISAL_PATCH_VERSION = None - ISAL_VERSION = None +from ._isal import (ISAL_MAJOR_VERSION, ISAL_MINOR_VERSION, ISAL_PATCH_VERSION, + ISAL_VERSION) __all__ = [ "ISAL_MAJOR_VERSION", diff --git a/tests/test_compat.py b/tests/test_compat.py index baa86bfe..0ea54f70 100644 --- a/tests/test_compat.py +++ b/tests/test_compat.py @@ -11,7 +11,6 @@ import gzip import itertools -import os import zlib from pathlib import Path @@ -35,8 +34,6 @@ # Wbits for ZLIB compression, GZIP compression, and RAW compressed streams WBITS_RANGE = list(range(9, 16)) + list(range(25, 32)) + list(range(-15, -8)) -DYNAMICALLY_LINKED = os.getenv("PYTHON_ISAL_LINK_DYNAMIC") is not None - @pytest.mark.parametrize(["data_size", "value"], itertools.product(DATA_SIZES, SEEDS)) @@ -93,8 +90,6 @@ def test_decompress_isal_zlib(data_size, level): @pytest.mark.parametrize(["data_size", "level", "wbits", "memLevel"], itertools.product([128 * 1024], range(4), WBITS_RANGE, range(1, 10))) -@pytest.mark.xfail(condition=DYNAMICALLY_LINKED, - reason="Dynamically linked version may not have patch.") def test_compress_compressobj(data_size, level, wbits, memLevel): data = DATA[:data_size] compressobj = isal_zlib.compressobj(level=level, diff --git a/tests/test_zlib_compliance.py b/tests/test_zlib_compliance.py index 4e2285b4..e2270050 100644 --- a/tests/test_zlib_compliance.py +++ b/tests/test_zlib_compliance.py @@ -40,10 +40,6 @@ class VersionTestCase(unittest.TestCase): - - @unittest.skipIf(os.getenv("PYTHON_ISAL_LINK_DYNAMIC") is not None and - sys.platform.startswith("win"), - "Header file missing on windows") def test_library_version(self): # Test that the major version of the actual library in use matches the # major version that we were compiled against. We can't guarantee that