Skip to content

Commit a7ffab7

Browse files
committed
Assume latest version with Windows header and zlib patch is available
1 parent 40267e1 commit a7ffab7

File tree

4 files changed

+5
-30
lines changed

4 files changed

+5
-30
lines changed

setup.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,11 @@
3333
DEFAULT_CACHE_FILE))
3434

3535
EXTENSIONS = [
36-
Extension("isal.isal_zlib", ["src/isal/isal_zlibmodule.c"]),
37-
Extension("isal.igzip_lib", ["src/isal/igzip_libmodule.c"]),
36+
Extension("isal.isal_zlib", ["src/isal/isal_zlibmodule.c"]),
37+
Extension("isal.igzip_lib", ["src/isal/igzip_libmodule.c"]),
38+
Extension("isal._isal", ["src/isal/_isalmodule.c"]),
3839
]
3940

40-
# This does not add the extension on windows for dynamic linking. The required
41-
# header file might be missing.
42-
if not (SYSTEM_IS_WINDOWS and
43-
os.getenv("PYTHON_ISAL_LINK_DYNAMIC") is not None):
44-
EXTENSIONS.append(Extension("isal._isal", ["src/isal/_isalmodule.c"]))
45-
4641

4742
class BuildIsalExt(build_ext):
4843
def build_extension(self, ext):

src/isal/__init__.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,8 @@
55
# This file is part of python-isal which is distributed under the
66
# PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2.
77

8-
from typing import Optional
9-
10-
try:
11-
from . import _isal
12-
ISAL_MAJOR_VERSION: Optional[int] = _isal.ISAL_MAJOR_VERSION
13-
ISAL_MINOR_VERSION: Optional[int] = _isal.ISAL_MINOR_VERSION
14-
ISAL_PATCH_VERSION: Optional[int] = _isal.ISAL_PATCH_VERSION
15-
ISAL_VERSION: Optional[str] = _isal.ISAL_VERSION
16-
except ImportError:
17-
ISAL_MAJOR_VERSION = None
18-
ISAL_MINOR_VERSION = None
19-
ISAL_PATCH_VERSION = None
20-
ISAL_VERSION = None
8+
from ._isal import (ISAL_MAJOR_VERSION, ISAL_MINOR_VERSION, ISAL_PATCH_VERSION,
9+
ISAL_VERSION)
2110

2211
__all__ = [
2312
"ISAL_MAJOR_VERSION",

tests/test_compat.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
import gzip
1313
import itertools
14-
import os
1514
import zlib
1615
from pathlib import Path
1716

@@ -35,8 +34,6 @@
3534
# Wbits for ZLIB compression, GZIP compression, and RAW compressed streams
3635
WBITS_RANGE = list(range(9, 16)) + list(range(25, 32)) + list(range(-15, -8))
3736

38-
DYNAMICALLY_LINKED = os.getenv("PYTHON_ISAL_LINK_DYNAMIC") is not None
39-
4037

4138
@pytest.mark.parametrize(["data_size", "value"],
4239
itertools.product(DATA_SIZES, SEEDS))
@@ -93,8 +90,6 @@ def test_decompress_isal_zlib(data_size, level):
9390
@pytest.mark.parametrize(["data_size", "level", "wbits", "memLevel"],
9491
itertools.product([128 * 1024], range(4),
9592
WBITS_RANGE, range(1, 10)))
96-
@pytest.mark.xfail(condition=DYNAMICALLY_LINKED,
97-
reason="Dynamically linked version may not have patch.")
9893
def test_compress_compressobj(data_size, level, wbits, memLevel):
9994
data = DATA[:data_size]
10095
compressobj = isal_zlib.compressobj(level=level,

tests/test_zlib_compliance.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@
4040

4141

4242
class VersionTestCase(unittest.TestCase):
43-
44-
@unittest.skipIf(os.getenv("PYTHON_ISAL_LINK_DYNAMIC") is not None and
45-
sys.platform.startswith("win"),
46-
"Header file missing on windows")
4743
def test_library_version(self):
4844
# Test that the major version of the actual library in use matches the
4945
# major version that we were compiled against. We can't guarantee that

0 commit comments

Comments
 (0)