Skip to content

Commit

Permalink
Merge pull request #70 from pycompression/release_0.9.0
Browse files Browse the repository at this point in the history
Release 0.9.0
  • Loading branch information
rhpvorderman authored Mar 30, 2021
2 parents 2e5e4dc + c8e73a5 commit 1a56307
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 20 deletions.
57 changes: 47 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ jobs:
strategy:
matrix:
python-version:
- 3.6
- 3.7
- 3.8
- 3.9
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "pypy-3.6"
- "pypy-3.7"
os: ["ubuntu-latest"]
include:
- os: "macos-latest"
Expand Down Expand Up @@ -92,10 +94,34 @@ jobs:
uses: ilammy/[email protected]
if: runner.os == 'Windows'
- name: Run tests
run: tox -e py3
run: tox
- name: Upload coverage report
uses: codecov/codecov-action@v1

test-arch:
if: startsWith(github.ref, 'refs/tags') || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main'
runs-on: "ubuntu-latest"
needs: lint
strategy:
matrix:
distro: [ "ubuntu20.04" ]
arch: ["aarch64"]
steps:
- uses: actions/[email protected]
with:
submodules: recursive
- uses: uraimo/[email protected]
name: Build & run test
with:
arch: ${{ matrix.arch }}
distro: ${{ matrix.distro }}
install: |
apt-get update -q -y
apt-get install -q -y python3 python3-pip gcc binutils automake autoconf libtool
run: |
python3 -m pip install -U setuptools pip wheel tox
tox
# Test if the python-isal conda package can be build. Which is linked
# dynamically to the conda isa-l package.
test-dynamic:
Expand All @@ -109,6 +135,10 @@ jobs:
strategy:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python_version: ["python"]
include:
- os: "ubuntu-latest"
python_version: "pypy"
steps:
- uses: actions/[email protected]
with:
Expand All @@ -118,19 +148,19 @@ jobs:
with:
channels: conda-forge,defaults
- name: Install requirements (universal)
run: conda install isa-l python tox
run: conda install isa-l ${{ matrix.python_version}} tox
- name: Set MSVC developer prompt
uses: ilammy/[email protected]
if: runner.os == 'Windows'
- name: Run tests (dynamic link)
run: tox -e py3
run: tox
env:
PYTHON_ISAL_LINK_DYNAMIC: True

deploy:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ${{ matrix.os }}
needs: [lint, package-checks, test-static, test-dynamic]
needs: [lint, package-checks, test-static, test-dynamic, test-arch]
strategy:
matrix:
os: ["macos-latest", "ubuntu-latest", "windows-latest"]
Expand All @@ -151,16 +181,23 @@ jobs:
- name: Install nasm (Windows)
uses: ilammy/[email protected]
if: runner.os == 'Windows'
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/[email protected]
with:
platforms: arm64
- name: Build wheels
run: cibuildwheel --output-dir dist
env:
CIBW_BUILD: "cp3{6,7,8,9}-*"
CIBW_SKIP: "*-win32 *-manylinux_i686" # Skip 32 bit.
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014"
CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux2014"
CIBW_ARCHS_LINUX: "x86_64 aarch64"
# Fully test the build wheels again.
CIBW_TEST_REQUIRES: "pytest"
# Simple test that requires the project to be build correctly
CIBW_TEST_COMMAND: "pytest {project}/tests/test_igzip.py"
CIBW_TEST_COMMAND: >-
pytest {project}/tests/test_igzip.py {project}/tests/test_isal.py
- name: Build sdist
if: "runner.os == 'Linux'"
run: python setup.py sdist
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ Changelog
.. This document is user facing. Please word the changes in such a way
.. that users understand how the changes affect the new version.
version 0.9.0
-----------------
+ Fix a bug where a AttributeError was triggered when zlib.Z_RLE or
zlib.Z_FIXED were not present.
+ Add support for Linux aarch64 builds.
+ Add support for pypy by adding pypy tests to the CI and setting up wheel
building support.

version 0.8.1
-----------------
+ Fix a bug where multi-member gzip files where read incorrectly due to an
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def build_extension(self, ext):
for prefix in possible_prefixes:
if Path(prefix, "include", "isa-l").exists():
ext.include_dirs = [os.path.join(prefix, "include")]
ext.library_dirs = [os.path.join(prefix, "lib")]
break # Only one include directory is needed.
# On windows include is in Library apparently
elif Path(prefix, "Library", "include", "isa-l").exists():
Expand Down Expand Up @@ -169,7 +170,7 @@ def build_isa_l(compiler_command: str, compiler_options: str):

setup(
name="isal",
version="0.8.1",
version="0.9.0",
description="Faster zlib and gzip compatible compression and "
"decompression by providing python bindings for the ISA-L "
"library.",
Expand Down
2 changes: 1 addition & 1 deletion src/isal/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@
"__version__"
]

__version__ = "0.8.1"
__version__ = "0.9.0"
7 changes: 5 additions & 2 deletions src/isal/isal_zlib.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,13 @@ DEFLATED = zlib.DEFLATED

# Strategies
Z_DEFAULT_STRATEGY=zlib.Z_DEFAULT_STRATEGY
Z_RLE=zlib.Z_RLE
Z_HUFFMAN_ONLY=zlib.Z_HUFFMAN_ONLY
Z_FILTERED=zlib.Z_FILTERED
Z_FIXED=zlib.Z_FIXED
# Following strategies not supported on all versions of zlib.
if hasattr(zlib, "Z_RLE"):
Z_RLE = zlib.Z_RLE
if hasattr(zlib, "Z_FIXED"):
Z_FIXED=zlib.Z_FIXED

# Flush methods
Z_NO_FLUSH=zlib.Z_NO_FLUSH
Expand Down
6 changes: 3 additions & 3 deletions tests/test_isal.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ def test_compress_compressobj(data_size, level, wbits, memLevel):
memLevel=memLevel)
compressed = compressobj.compress(data) + compressobj.flush()
if wbits in range(8, 16):
# In case a zlib header is used, determine the wbits automatically.
# For some reason it fails if wbits is set manually.
decompressed = zlib.decompress(compressed, wbits=0)
# TODO: Apparently the wbits level is not correctly implemented in
# ISA-L for the zlib stuff.
decompressed = zlib.decompress(compressed, wbits=15)
else:
decompressed = zlib.decompress(compressed, wbits=wbits)
assert data == decompressed
Expand Down
7 changes: 4 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
# Running plain tox will run the default environment (testenv) with the default
# python3 interpreter of the user.
envlist=py3
envlist=testenv
[testenv]
deps=pytest
coverage
Expand All @@ -10,8 +10,9 @@ passenv=
commands =
# Create HTML coverage report for humans and xml coverage report for external services.
coverage run --source=isal -m py.test tests
coverage html
coverage xml
# Ignore errors during report generation. Pypy does not generate proper coverage reports.
coverage html -i
coverage xml -i

[testenv:coverage]
# Separate test environment for cython coverage.
Expand Down

0 comments on commit 1a56307

Please sign in to comment.