Skip to content

Commit a182513

Browse files
authored
Merge pull request #122 from pycompression/release_1.0.0
Release 1.0.0
2 parents bda6c24 + 2f199ea commit a182513

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2871
-2304
lines changed

.github/workflows/ci.yml

Lines changed: 68 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Continous integration
22

33
on:
44
pull_request:
5+
paths-ignore:
6+
- 'docs/**'
7+
- '*.rst'
58
push:
69
branches:
710
- develop
@@ -11,15 +14,15 @@ on:
1114

1215
jobs:
1316
lint:
14-
runs-on: ubuntu-20.04
17+
runs-on: ubuntu-latest
1518
steps:
1619
- uses: actions/[email protected]
1720
with:
1821
submodules: recursive
19-
- name: Set up Python 3.6
22+
- name: Set up Python 3.7
2023
uses: actions/[email protected]
2124
with:
22-
python-version: 3.6
25+
python-version: 3.7
2326
- name: Install tox
2427
run: pip install tox
2528
- name: Lint
@@ -31,16 +34,15 @@ jobs:
3134
tox_env:
3235
- docs
3336
- twine_check
34-
needs: lint
35-
runs-on: ubuntu-20.04
37+
runs-on: ubuntu-latest
3638
steps:
3739
- uses: actions/[email protected]
3840
with:
3941
submodules: recursive
40-
- name: Set up Python 3.6
42+
- name: Set up Python 3.7
4143
uses: actions/[email protected]
4244
with:
43-
python-version: 3.6
45+
python-version: 3.7
4446
- name: Install isal
4547
run: sudo apt-get install libisal-dev
4648
- name: Install tox and upgrade setuptools and pip
@@ -51,23 +53,20 @@ jobs:
5153
PYTHON_ISAL_LINK_DYNAMIC: True
5254

5355
test-static:
54-
needs: lint
5556
runs-on: ${{ matrix.os }}
5657
strategy:
5758
matrix:
5859
python-version:
59-
- "3.6"
6060
- "3.7"
6161
- "3.8"
6262
- "3.9"
63-
- "pypy-3.6"
64-
- "pypy-3.7"
63+
- "3.10"
6564
os: ["ubuntu-latest"]
6665
include:
6766
- os: "macos-latest"
68-
python-version: 3.6
67+
python-version: 3.7
6968
- os: "windows-latest"
70-
python-version: 3.6
69+
python-version: 3.7
7170
steps:
7271
- uses: actions/[email protected]
7372
with:
@@ -79,12 +78,12 @@ jobs:
7978
- name: Install tox and upgrade setuptools
8079
run: pip install --upgrade tox setuptools
8180
- name: Install build dependencies (Linux) # Yasm in pypa/manylinux images.
82-
run: sudo apt install yasm
81+
run: sudo apt install nasm
8382
if: runner.os == 'Linux'
8483
- name: Install build dependencies (Macos)
8584
# Install yasm because nasm does not work when building wheels.
8685
# Probably because of nasm-filter.sh not filtering all flags that can not be used.
87-
run: brew install yasm automake autoconf
86+
run: brew install nasm automake autoconf
8887
if: runner.os == 'macOS'
8988
- name: Set MSVC developer prompt
9089
uses: ilammy/[email protected]
@@ -100,25 +99,23 @@ jobs:
10099
test-arch:
101100
if: startsWith(github.ref, 'refs/tags') || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main'
102101
runs-on: "ubuntu-latest"
103-
needs: lint
104102
strategy:
105103
matrix:
106-
distro: [ "ubuntu20.04" ]
104+
distro: [ "ubuntu_latest" ]
107105
arch: ["aarch64"]
108106
steps:
109107
- uses: actions/[email protected]
110108
with:
111109
submodules: recursive
112-
- uses: uraimo/run-on-arch-action@v2.0.9
110+
- uses: uraimo/run-on-arch-action@v2.2.0
113111
name: Build & run test
114112
with:
115113
arch: ${{ matrix.arch }}
116114
distro: ${{ matrix.distro }}
117115
install: |
118116
apt-get update -q -y
119-
apt-get install -q -y python3 python3-pip gcc binutils automake autoconf libtool
117+
apt-get install -q -y python3 python3-pip gcc binutils automake autoconf libtool tox
120118
run: |
121-
python3 -m pip install -U setuptools pip wheel tox
122119
tox
123120
124121
# Test if the python-isal conda package can be build. Which is linked
@@ -130,14 +127,9 @@ jobs:
130127
# This is needed for miniconda, see:
131128
# https://github.com/marketplace/actions/setup-miniconda#important.
132129
shell: bash -l {0}
133-
needs: lint
134130
strategy:
135131
matrix:
136132
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
137-
python_version: ["python"]
138-
include:
139-
- os: "ubuntu-latest"
140-
python_version: "pypy"
141133
steps:
142134
- uses: actions/[email protected]
143135
with:
@@ -147,7 +139,7 @@ jobs:
147139
with:
148140
channels: conda-forge,defaults
149141
- name: Install requirements (universal)
150-
run: conda install isa-l ${{ matrix.python_version}} tox
142+
run: conda install isa-l python tox
151143
- name: Set MSVC developer prompt
152144
uses: ilammy/[email protected]
153145
if: runner.os == 'Windows'
@@ -159,10 +151,33 @@ jobs:
159151
deploy:
160152
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
161153
runs-on: ${{ matrix.os }}
162-
needs: [lint, package-checks, test-static, test-dynamic, test-arch]
154+
needs:
155+
- lint
156+
- package-checks
157+
- test-static
158+
- test-dynamic
159+
- test-arch
163160
strategy:
164161
matrix:
165-
os: ["macos-latest", "ubuntu-latest", "windows-latest"]
162+
os:
163+
- ubuntu-latest
164+
- macos-latest
165+
- windows-latest
166+
cibw_archs_linux: ["x86_64"]
167+
cibw_before_all_linux:
168+
- >-
169+
curl -o nasm-2.15.05.tar.gz https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/nasm-2.15.05.tar.gz &&
170+
tar -xzvf nasm-2.15.05.tar.gz &&
171+
cd nasm-2.15.05/ &&
172+
./autogen.sh &&
173+
./configure &&
174+
make nasm &&
175+
install -c nasm /usr/bin/nasm
176+
build_sdist: [true]
177+
include:
178+
- os: "ubuntu-latest"
179+
cibw_archs_linux: "aarch64"
180+
cibw_before_all_linux: "true" # The true command exits with 0
166181
steps:
167182
- uses: actions/[email protected]
168183
with:
@@ -172,7 +187,7 @@ jobs:
172187
- name: Install cibuildwheel twine wheel
173188
run: python -m pip install cibuildwheel twine wheel
174189
- name: Install build dependencies (Macos)
175-
run: brew install yasm automake autoconf
190+
run: brew install nasm automake autoconf
176191
if: runner.os == 'macOS'
177192
- name: Set MSVC developer prompt
178193
uses: ilammy/[email protected]
@@ -181,27 +196,43 @@ jobs:
181196
uses: ilammy/[email protected]
182197
if: runner.os == 'Windows'
183198
- name: Set up QEMU
184-
if: runner.os == 'Linux'
199+
if: ${{runner.os == 'Linux' && matrix.cibw_archs_linux == 'aarch64'}}
185200
uses: docker/[email protected]
186201
with:
187202
platforms: arm64
188203
- name: Build wheels
189204
run: cibuildwheel --output-dir dist
190205
env:
191-
CIBW_SKIP: "*-win32 *-manylinux_i686" # Skip 32 bit.
192-
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2014"
193-
CIBW_MANYLINUX_AARCH64_IMAGE: "manylinux2014"
194-
CIBW_ARCHS_LINUX: "x86_64 aarch64"
206+
CIBW_SKIP: "*-win32 *-manylinux_i686 *pp3*" # Skip 32 bit and pypy
207+
CIBW_ARCHS_LINUX: ${{ matrix.cibw_archs_linux }}
208+
CIBW_BEFORE_ALL_LINUX: ${{ matrix.cibw_before_all_linux }}
195209
# Fully test the build wheels again.
196210
CIBW_TEST_REQUIRES: "pytest"
197211
# Simple test that requires the project to be build correctly
198212
CIBW_TEST_COMMAND: >-
199213
pytest {project}/tests/test_igzip.py
200214
{project}/tests/test_compat.py
201215
{project}/tests/test_igzip_lib.py
216+
CIBW_ENVIRONMENT_LINUX: >-
217+
PYTHON_ISAL_BUILD_CACHE=True
218+
PYTHON_ISAL_BUILD_CACHE_FILE=/tmp/build_cache
219+
CFLAGS="-g0 -DNDEBUG"
220+
CIBW_ENVIRONMENT_WINDOWS: >-
221+
PYTHON_ISAL_BUILD_CACHE=True
222+
PYTHON_ISAL_BUILD_CACHE_FILE=${{ runner.temp }}\build_cache
223+
CIBW_ENVIRONMENT_MACOS: >-
224+
PYTHON_ISAL_BUILD_CACHE=True
225+
PYTHON_ISAL_BUILD_CACHE_FILE=${{ runner.temp }}/build_cache
226+
CFLAGS="-g0 -DNDEBUG"
202227
- name: Build sdist
203-
if: "runner.os == 'Linux'"
204-
run: python setup.py sdist
228+
if: ${{runner.os == 'Linux' && matrix.cibw_archs_linux == 'x86_64'}}
229+
run: |
230+
pip install build
231+
python -m build --sdist
232+
- uses: actions/upload-artifact@v2
233+
with:
234+
name: "dist"
235+
path: "dist/"
205236
- name: Publish package to TestPyPI
206237
# pypa/gh-action-pypi-publish@master does not work on OSX
207238
# Alpha, Beta and dev releases contain a - in the tag.
@@ -215,4 +246,4 @@ jobs:
215246
run: twine upload dist/*
216247
env:
217248
TWINE_USERNAME: __token__
218-
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
249+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ __pycache__/
66
# C extensions
77
*.so
88

9-
# Cython generated files
10-
*.c
11-
*.html
12-
139
# Distribution / packaging
1410
.Python
1511
build/

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "src/isal/isa-l"]
22
path = src/isal/isa-l
3-
url = https://github.com/intel/isa-l.git
3+
url = https://github.com/rhpvorderman/isa-l.git

CHANGELOG.rst

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,61 @@ 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 1.0.0
11+
------------------
12+
Python-isal has been rewritten as a C-extension (first implementation was in
13+
Cython). This has made the library faster in many key areas. It does mean
14+
that PyPy is no longer supported.
15+
16+
+ Since the module now mostly contains code copied from CPython and then
17+
modified to work with ISA-L the license has been changed to the
18+
Python Software Foundation License version 2.
19+
+ Python versions lower than 3.7 are no longer supported. Python 3.6 is out
20+
of support since December 2021.
21+
+ PyPy is no longer supported. PyPy+python-isal was slower than CPython + zlib
22+
for decompressing gzip files. PyPy should not be used for workloads that
23+
require heavy zlib-compatible compression/decompression. As such it was
24+
deemed unnecessary to continue supporting PyPy.
25+
+ Stub files with type information have now been updated to correctly display
26+
positional-only arguments.
27+
+ Expose ``READ`` and ``WRITE`` constants on the ``igzip`` module. These are
28+
also present in Python's stdlib ``gzip`` module and exposing them allows for
29+
better drop-in capability of ``igzip``. Thanks to @alexander-beedie in
30+
https://github.com/pycompression/python-isal/pull/115.
31+
+ A ``--no-name`` flag has been added to ``python -m isal.igzip``.
32+
+ Reduced wheel size by not including debug symbols in the binary. Thanks to
33+
@marcelm in https://github.com/pycompression/python-isal/pull/108.
34+
+ Cython is no longer required as a build dependency.
35+
+ isal_zlib.compressobj and isal_zlib.decompressobj are now about six times
36+
faster.
37+
+ igzip.decompress has 30% less overhead when called.
38+
+ Error structure has been simplified. There is only ``IsalError`` which has
39+
``Exception`` as baseclass instead of ``OSError``. ``isal_zlib.IsalError``,
40+
``igzip_lib.IsalError``, ``isal_zlib.error`` and ``igzip_lib.error`` are
41+
all aliases of the same error class.
42+
+ GzipReader now uses larger input and output buffers (128k) by default and
43+
IgzipDecompressor.decompress has been updated to allocate ``maxsize`` buffers
44+
when these are of reasonable size, instead of growing the buffer to maxsize
45+
on every call. This has improved gzip decompression speeds by 7%.
46+
+ Patch statically linked included library (ISA-L 2.30.0) to fix the following:
47+
48+
+ ISA-L library version variables are now available on windows as well,
49+
for the statically linked version available on PyPI.
50+
+ Wheels are now always build with nasm for the x86 architecture.
51+
Previously yasm was used for Linux and MacOS due to build issues.
52+
+ Fixed a bug upstream in ISA-L were zlib headers would be created with an
53+
incorrect wbits value.
54+
55+
+ Python-isal shows up in Python profiler reports.
56+
+ Support and tests for Python 3.10 were added.
57+
+ Due to a change in the deployment process wheels should work for older
58+
versions of pip.
59+
+ Added a ``crc`` property to the IgzipDecompressor class. Depending on the
60+
decompression flag chosen, this will update with an adler32 or crc32
61+
checksum.
62+
+ All the decompression NO_HDR flags on igzip_lib were
63+
incorrectly documented. This is now fixed.
64+
1065
version 0.11.1
1166
------------------
1267
+ Fixed an issue which occurred rarely that caused IgzipDecompressor's

LICENSE

Lines changed: 48 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,48 @@
1-
MIT License
2-
3-
Copyright (c) 2020 Leiden University Medical Center
4-
5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
11-
12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
14-
15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
1+
PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
2+
--------------------------------------------
3+
4+
1. This LICENSE AGREEMENT is between the Python Software Foundation
5+
("PSF"), and the Individual or Organization ("Licensee") accessing and
6+
otherwise using this software ("Python") in source or binary form and
7+
its associated documentation.
8+
9+
2. Subject to the terms and conditions of this License Agreement, PSF hereby
10+
grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
11+
analyze, test, perform and/or display publicly, prepare derivative works,
12+
distribute, and otherwise use Python alone or in any derivative version,
13+
provided, however, that PSF's License Agreement and PSF's notice of copyright,
14+
i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
15+
2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Python Software Foundation;
16+
All Rights Reserved" are retained in Python alone or in any derivative version
17+
prepared by Licensee.
18+
19+
3. In the event Licensee prepares a derivative work that is based on
20+
or incorporates Python or any part thereof, and wants to make
21+
the derivative work available to others as provided herein, then
22+
Licensee hereby agrees to include in any such work a brief summary of
23+
the changes made to Python.
24+
25+
4. PSF is making Python available to Licensee on an "AS IS"
26+
basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
27+
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
28+
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
29+
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
30+
INFRINGE ANY THIRD PARTY RIGHTS.
31+
32+
5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
33+
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
34+
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
35+
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
36+
37+
6. This License Agreement will automatically terminate upon a material
38+
breach of its terms and conditions.
39+
40+
7. Nothing in this License Agreement shall be deemed to create any
41+
relationship of agency, partnership, or joint venture between PSF and
42+
Licensee. This License Agreement does not grant permission to use PSF
43+
trademarks or trade name in a trademark sense to endorse or promote
44+
products or services of Licensee, or any third party.
45+
46+
8. By copying, installing or otherwise using Python, Licensee
47+
agrees to be bound by the terms and conditions of this License
48+
Agreement.

MANIFEST.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
graft src/isal/isa-l
1+
graft src/isal/isa-l
2+
include src/isal/*.h

0 commit comments

Comments
 (0)