Skip to content

Commit 9fd81d7

Browse files
authored
Merge pull request #97 from pycompression/testwbits
Properly check for all zlib wbits options.
2 parents 567dbd1 + b6a60a9 commit 9fd81d7

File tree

5 files changed

+63
-43
lines changed

5 files changed

+63
-43
lines changed

.github/workflows/ci.yml

Lines changed: 52 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ jobs:
8383
- name: Install tox and upgrade setuptools
8484
run: pip install --upgrade tox setuptools
8585
- name: Install build dependencies (Linux) # Yasm in pypa/manylinux images.
86-
run: sudo apt install yasm
86+
run: sudo apt install nasm
8787
if: runner.os == 'Linux'
8888
- name: Install build dependencies (Macos)
8989
# Install yasm because nasm does not work when building wheels.
9090
# Probably because of nasm-filter.sh not filtering all flags that can not be used.
91-
run: brew install yasm automake autoconf
91+
run: brew install nasm automake autoconf
9292
if: runner.os == 'macOS'
9393
- name: Set MSVC developer prompt
9494
uses: ilammy/[email protected]
@@ -127,54 +127,69 @@ jobs:
127127
128128
# Test if the python-isal conda package can be build. Which is linked
129129
# dynamically to the conda isa-l package.
130-
test-dynamic:
131-
runs-on: ${{ matrix.os }}
132-
defaults:
133-
run:
134-
# This is needed for miniconda, see:
135-
# https://github.com/marketplace/actions/setup-miniconda#important.
136-
shell: bash -l {0}
137-
needs: lint
138-
strategy:
139-
matrix:
140-
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
141-
python_version: ["python"]
142-
include:
143-
- os: "ubuntu-latest"
144-
python_version: "pypy"
145-
steps:
146-
- uses: actions/[email protected]
147-
with:
148-
submodules: recursive
149-
- name: Install miniconda.
150-
uses: conda-incubator/[email protected] # https://github.com/conda-incubator/setup-miniconda.
151-
with:
152-
channels: conda-forge,defaults
153-
- name: Install requirements (universal)
154-
run: conda install isa-l ${{ matrix.python_version}} tox
155-
- name: Set MSVC developer prompt
156-
uses: ilammy/[email protected]
157-
if: runner.os == 'Windows'
158-
- name: Run tests (dynamic link)
159-
run: tox
160-
env:
161-
PYTHON_ISAL_LINK_DYNAMIC: True
130+
# test-dynamic:
131+
# runs-on: ${{ matrix.os }}
132+
# defaults:
133+
# run:
134+
# # This is needed for miniconda, see:
135+
# # https://github.com/marketplace/actions/setup-miniconda#important.
136+
# shell: bash -l {0}
137+
# needs: lint
138+
# strategy:
139+
# matrix:
140+
# os: ["ubuntu-latest", "macos-latest", "windows-latest"]
141+
# python_version: ["python"]
142+
# include:
143+
# - os: "ubuntu-latest"
144+
# python_version: "pypy"
145+
# steps:
146+
# - uses: actions/[email protected]
147+
# with:
148+
# submodules: recursive
149+
# - name: Install miniconda.
150+
# uses: conda-incubator/[email protected] # https://github.com/conda-incubator/setup-miniconda.
151+
# with:
152+
# channels: conda-forge,defaults
153+
# - name: Install requirements (universal)
154+
# run: conda install isa-l ${{ matrix.python_version}} tox
155+
# - name: Set MSVC developer prompt
156+
# uses: ilammy/[email protected]
157+
# if: runner.os == 'Windows'
158+
# - name: Run tests (dynamic link)
159+
# run: tox
160+
# env:
161+
# PYTHON_ISAL_LINK_DYNAMIC: True
162162

163163
deploy:
164164
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
165165
runs-on: ${{ matrix.os }}
166-
needs: [lint, package-checks, test-static, test-dynamic, test-arch]
166+
needs:
167+
- lint
168+
- package-checks
169+
- test-static
170+
# - test-dynamic
171+
- test-arch
167172
strategy:
168173
matrix:
169174
os:
170175
- ubuntu-latest
171176
- macos-latest
172177
- windows-latest
173178
cibw_archs_linux: ["x86_64"]
179+
cibw_before_all_linux:
180+
- >-
181+
curl -o nasm-2.15.05.tar.gz https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/nasm-2.15.05.tar.gz &&
182+
tar -xzvf nasm-2.15.05.tar.gz &&
183+
cd nasm-2.15.05/ &&
184+
./autogen.sh &&
185+
./configure &&
186+
make nasm &&
187+
install -c nasm /usr/bin/nasm
174188
build_sdist: [true]
175189
include:
176190
- os: "ubuntu-latest"
177191
cibw_archs_linux: "aarch64"
192+
cibw_before_all_linux: "true" # The true command exits with 0
178193
steps:
179194
- uses: actions/[email protected]
180195
with:
@@ -184,7 +199,7 @@ jobs:
184199
- name: Install cibuildwheel twine wheel
185200
run: python -m pip install cibuildwheel twine wheel
186201
- name: Install build dependencies (Macos)
187-
run: brew install yasm automake autoconf
202+
run: brew install nasm automake autoconf
188203
if: runner.os == 'macOS'
189204
- name: Set MSVC developer prompt
190205
uses: ilammy/[email protected]
@@ -202,6 +217,7 @@ jobs:
202217
env:
203218
CIBW_SKIP: "*-win32 *-manylinux_i686" # Skip 32 bit.
204219
CIBW_ARCHS_LINUX: ${{ matrix.cibw_archs_linux }}
220+
CIBW_BEFORE_ALL_LINUX: ${{ matrix.cibw_before_all_linux }}
205221
# Fully test the build wheels again.
206222
CIBW_TEST_REQUIRES: "pytest"
207223
# Simple test that requires the project to be build correctly

CHANGELOG.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ Changelog
99
1010
version 1.0.0-dev
1111
------------------
12+
+ Wheels are now always build with nasm for the x86 architecture. Previously
13+
yasm was used for Linux and MacOS due to build issues that have since been
14+
fixed upstream.
15+
+ Updated statically included ISA-L to version 2.31.0. This fixes the bug
16+
mentioned below in python-isal as well.
17+
+ Fixed a bug upstream in ISA-L were zlib headers would be created with an
18+
incorrect wbits value.
1219
+ Python-isal shows up in Python profiler reports.
1320
+ Support and tests for Python 3.10 were added.
1421
+ Due to a change in the deployment process wheels should work for older

README.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ This project builds upon the software and experience of many. Many thanks to:
149149

150150
+ The `ISA-L contributors
151151
<https://github.com/intel/isa-l/graphs/contributors>`_ for making ISA-L.
152+
Special thanks to @gbtucker for always being especially helpful and
153+
responsive.
152154
+ The `Cython contributors
153155
<https://github.com/cython/cython/graphs/contributors>`_ for making it easy
154156
to create an extension and helping a novice get start with pointer addresses.

src/isal/isa-l

Submodule isa-l updated 65 files

tests/test_compat.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,7 @@ def test_compress_compressobj(data_size, level, wbits, memLevel):
105105
wbits=wbits,
106106
memLevel=memLevel)
107107
compressed = compressobj.compress(data) + compressobj.flush()
108-
if wbits in range(8, 16):
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)
112-
else:
113-
decompressed = zlib.decompress(compressed, wbits=wbits)
108+
decompressed = zlib.decompress(compressed, wbits=wbits)
114109
assert data == decompressed
115110

116111

0 commit comments

Comments
 (0)