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..881c62a3 100644 --- a/tests/test_compat.py +++ b/tests/test_compat.py @@ -35,8 +35,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 +91,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