Skip to content

Commit 1a56307

Browse files
authored
Merge pull request #70 from pycompression/release_0.9.0
Release 0.9.0
2 parents 2e5e4dc + c8e73a5 commit 1a56307

File tree

7 files changed

+70
-20
lines changed

7 files changed

+70
-20
lines changed

.github/workflows/ci.yml

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,12 @@ jobs:
5757
strategy:
5858
matrix:
5959
python-version:
60-
- 3.6
61-
- 3.7
62-
- 3.8
63-
- 3.9
60+
- "3.6"
61+
- "3.7"
62+
- "3.8"
63+
- "3.9"
64+
- "pypy-3.6"
65+
- "pypy-3.7"
6466
os: ["ubuntu-latest"]
6567
include:
6668
- os: "macos-latest"
@@ -92,10 +94,34 @@ jobs:
9294
uses: ilammy/[email protected]
9395
if: runner.os == 'Windows'
9496
- name: Run tests
95-
run: tox -e py3
97+
run: tox
9698
- name: Upload coverage report
9799
uses: codecov/codecov-action@v1
98100

101+
test-arch:
102+
if: startsWith(github.ref, 'refs/tags') || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main'
103+
runs-on: "ubuntu-latest"
104+
needs: lint
105+
strategy:
106+
matrix:
107+
distro: [ "ubuntu20.04" ]
108+
arch: ["aarch64"]
109+
steps:
110+
- uses: actions/[email protected]
111+
with:
112+
submodules: recursive
113+
- uses: uraimo/[email protected]
114+
name: Build & run test
115+
with:
116+
arch: ${{ matrix.arch }}
117+
distro: ${{ matrix.distro }}
118+
install: |
119+
apt-get update -q -y
120+
apt-get install -q -y python3 python3-pip gcc binutils automake autoconf libtool
121+
run: |
122+
python3 -m pip install -U setuptools pip wheel tox
123+
tox
124+
99125
# Test if the python-isal conda package can be build. Which is linked
100126
# dynamically to the conda isa-l package.
101127
test-dynamic:
@@ -109,6 +135,10 @@ jobs:
109135
strategy:
110136
matrix:
111137
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
138+
python_version: ["python"]
139+
include:
140+
- os: "ubuntu-latest"
141+
python_version: "pypy"
112142
steps:
113143
- uses: actions/[email protected]
114144
with:
@@ -118,19 +148,19 @@ jobs:
118148
with:
119149
channels: conda-forge,defaults
120150
- name: Install requirements (universal)
121-
run: conda install isa-l python tox
151+
run: conda install isa-l ${{ matrix.python_version}} tox
122152
- name: Set MSVC developer prompt
123153
uses: ilammy/[email protected]
124154
if: runner.os == 'Windows'
125155
- name: Run tests (dynamic link)
126-
run: tox -e py3
156+
run: tox
127157
env:
128158
PYTHON_ISAL_LINK_DYNAMIC: True
129159

130160
deploy:
131161
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
132162
runs-on: ${{ matrix.os }}
133-
needs: [lint, package-checks, test-static, test-dynamic]
163+
needs: [lint, package-checks, test-static, test-dynamic, test-arch]
134164
strategy:
135165
matrix:
136166
os: ["macos-latest", "ubuntu-latest", "windows-latest"]
@@ -151,16 +181,23 @@ jobs:
151181
- name: Install nasm (Windows)
152182
uses: ilammy/[email protected]
153183
if: runner.os == 'Windows'
184+
- name: Set up QEMU
185+
if: runner.os == 'Linux'
186+
uses: docker/[email protected]
187+
with:
188+
platforms: arm64
154189
- name: Build wheels
155190
run: cibuildwheel --output-dir dist
156191
env:
157-
CIBW_BUILD: "cp3{6,7,8,9}-*"
158192
CIBW_SKIP: "*-win32 *-manylinux_i686" # Skip 32 bit.
159193
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014"
194+
CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux2014"
195+
CIBW_ARCHS_LINUX: "x86_64 aarch64"
160196
# Fully test the build wheels again.
161197
CIBW_TEST_REQUIRES: "pytest"
162198
# Simple test that requires the project to be build correctly
163-
CIBW_TEST_COMMAND: "pytest {project}/tests/test_igzip.py"
199+
CIBW_TEST_COMMAND: >-
200+
pytest {project}/tests/test_igzip.py {project}/tests/test_isal.py
164201
- name: Build sdist
165202
if: "runner.os == 'Linux'"
166203
run: python setup.py sdist

CHANGELOG.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ Changelog
77
.. This document is user facing. Please word the changes in such a way
88
.. that users understand how the changes affect the new version.
99
10+
version 0.9.0
11+
-----------------
12+
+ Fix a bug where a AttributeError was triggered when zlib.Z_RLE or
13+
zlib.Z_FIXED were not present.
14+
+ Add support for Linux aarch64 builds.
15+
+ Add support for pypy by adding pypy tests to the CI and setting up wheel
16+
building support.
17+
1018
version 0.8.1
1119
-----------------
1220
+ Fix a bug where multi-member gzip files where read incorrectly due to an

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def build_extension(self, ext):
6262
for prefix in possible_prefixes:
6363
if Path(prefix, "include", "isa-l").exists():
6464
ext.include_dirs = [os.path.join(prefix, "include")]
65+
ext.library_dirs = [os.path.join(prefix, "lib")]
6566
break # Only one include directory is needed.
6667
# On windows include is in Library apparently
6768
elif Path(prefix, "Library", "include", "isa-l").exists():
@@ -169,7 +170,7 @@ def build_isa_l(compiler_command: str, compiler_options: str):
169170

170171
setup(
171172
name="isal",
172-
version="0.8.1",
173+
version="0.9.0",
173174
description="Faster zlib and gzip compatible compression and "
174175
"decompression by providing python bindings for the ISA-L "
175176
"library.",

src/isal/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@
3939
"__version__"
4040
]
4141

42-
__version__ = "0.8.1"
42+
__version__ = "0.9.0"

src/isal/isal_zlib.pyx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,13 @@ DEFLATED = zlib.DEFLATED
9999

100100
# Strategies
101101
Z_DEFAULT_STRATEGY=zlib.Z_DEFAULT_STRATEGY
102-
Z_RLE=zlib.Z_RLE
103102
Z_HUFFMAN_ONLY=zlib.Z_HUFFMAN_ONLY
104103
Z_FILTERED=zlib.Z_FILTERED
105-
Z_FIXED=zlib.Z_FIXED
104+
# Following strategies not supported on all versions of zlib.
105+
if hasattr(zlib, "Z_RLE"):
106+
Z_RLE = zlib.Z_RLE
107+
if hasattr(zlib, "Z_FIXED"):
108+
Z_FIXED=zlib.Z_FIXED
106109

107110
# Flush methods
108111
Z_NO_FLUSH=zlib.Z_NO_FLUSH

tests/test_isal.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ def test_compress_compressobj(data_size, level, wbits, memLevel):
106106
memLevel=memLevel)
107107
compressed = compressobj.compress(data) + compressobj.flush()
108108
if wbits in range(8, 16):
109-
# In case a zlib header is used, determine the wbits automatically.
110-
# For some reason it fails if wbits is set manually.
111-
decompressed = zlib.decompress(compressed, wbits=0)
109+
# TODO: Apparently the wbits level is not correctly implemented in
110+
# ISA-L for the zlib stuff.
111+
decompressed = zlib.decompress(compressed, wbits=15)
112112
else:
113113
decompressed = zlib.decompress(compressed, wbits=wbits)
114114
assert data == decompressed

tox.ini

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tox]
22
# Running plain tox will run the default environment (testenv) with the default
33
# python3 interpreter of the user.
4-
envlist=py3
4+
envlist=testenv
55
[testenv]
66
deps=pytest
77
coverage
@@ -10,8 +10,9 @@ passenv=
1010
commands =
1111
# Create HTML coverage report for humans and xml coverage report for external services.
1212
coverage run --source=isal -m py.test tests
13-
coverage html
14-
coverage xml
13+
# Ignore errors during report generation. Pypy does not generate proper coverage reports.
14+
coverage html -i
15+
coverage xml -i
1516

1617
[testenv:coverage]
1718
# Separate test environment for cython coverage.

0 commit comments

Comments
 (0)