Skip to content

Commit e163b2b

Browse files
authored
Merge pull request #69 from pycompression/release_1.0.0
Release 1.0.0
2 parents e705e41 + 2a3d6bf commit e163b2b

File tree

13 files changed

+148
-102
lines changed

13 files changed

+148
-102
lines changed

.github/release_checklist.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ Release checklist
33
- [ ] Check [latest documentation](https://python-zlib-ng.readthedocs.io/en/latest/) looks fine.
44
- [ ] Create a release branch.
55
- [ ] Change current development version in `CHANGELOG.rst` to stable version.
6+
- [ ] Check if the address sanitizer does not find any problems using `tox -e asan`
67
- [ ] Merge the release branch into `main`.
78
- [ ] Created an annotated tag with the stable version number. Include changes
89
from CHANGELOG.rst.
910
- [ ] Push tag to remote. This triggers the wheel/sdist build on github CI.
1011
- [ ] merge `main` branch back into `develop`.
11-
- [ ] Add updated version number to develop. (`setup.py` and `src/zlib_ng/__init__.py`)
1212
- [ ] Build the new tag on readthedocs. Only build the last patch version of
1313
each minor version. So `1.1.1` and `1.2.0` but not `1.1.0`, `1.1.1` and `1.2.0`.
1414
- [ ] Create a new release on github.

.github/workflows/ci.yml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ jobs:
1919
- uses: actions/checkout@v4
2020
with:
2121
submodules: recursive
22-
- name: Set up Python 3.8
23-
uses: actions/setup-python@v2.2.1
22+
- name: Set up Python 3.10
23+
uses: actions/setup-python@v5
2424
with:
25-
python-version: "3.8"
25+
python-version: "3.10"
2626
- name: Install tox
2727
run: pip install tox
2828
- name: Lint
@@ -39,10 +39,10 @@ jobs:
3939
- uses: actions/checkout@v4
4040
with:
4141
submodules: recursive
42-
- name: Set up Python 3.8
43-
uses: actions/setup-python@v2.2.1
42+
- name: Set up Python 3.10
43+
uses: actions/setup-python@v5
4444
with:
45-
python-version: 3.8
45+
python-version: "3.10"
4646
- name: Install tox and upgrade setuptools and pip
4747
run: pip install --upgrade tox setuptools pip
4848
- name: Run tox -e ${{ matrix.tox_env }}
@@ -53,34 +53,34 @@ jobs:
5353
strategy:
5454
matrix:
5555
python-version:
56-
- "3.8"
57-
- "3.9"
5856
- "3.10"
5957
- "3.11"
6058
- "3.12"
61-
- "3.13-dev"
62-
- "pypy-3.9"
59+
- "3.13"
60+
- "3.14"
6361
- "pypy-3.10"
62+
- "pypy-3.11"
6463
os: ["ubuntu-latest"]
6564
include:
66-
- os: "macos-14" # For m1 macos
65+
- os: "macos-latest" # For m1 macos
6766
python-version: "3.12"
6867
- os: "macos-13" # for x86 macos
69-
python-version: "3.8"
68+
python-version: "3.10"
7069
- os: "windows-latest"
71-
python-version: "3.8"
70+
python-version: "3.10"
7271
steps:
7372
- uses: actions/checkout@v4
7473
with:
7574
submodules: recursive
7675
- name: Set up Python ${{ matrix.python-version }}
77-
uses: actions/setup-python@v2.2.1
76+
uses: actions/setup-python@v5
7877
with:
7978
python-version: ${{ matrix.python-version }}
79+
allow-prereleases: true
8080
- name: Install tox and upgrade setuptools
8181
run: pip install --upgrade tox setuptools
8282
- name: Set MSVC developer prompt
83-
uses: ilammy/msvc-dev-cmd@v1.6.0
83+
uses: ilammy/msvc-dev-cmd@v1
8484
if: runner.os == 'Windows'
8585
- name: Install build dependencies (MacOS)
8686
run: brew install make
@@ -96,12 +96,12 @@ jobs:
9696
strategy:
9797
matrix:
9898
python_version:
99-
- "3.8"
99+
- "3.10"
100100
steps:
101101
- uses: actions/checkout@v4
102102
with:
103103
submodules: recursive
104-
- uses: uraimo/run-on-arch-action@v2.5.0
104+
- uses: uraimo/run-on-arch-action@v3
105105
name: Build & run test
106106
with:
107107
arch: none
@@ -129,7 +129,7 @@ jobs:
129129
os:
130130
- "ubuntu-latest"
131131
- "macos-13"
132-
- "macos-14"
132+
- "macos-latest"
133133
- "windows-latest"
134134
python_version: [ "python" ]
135135
include:
@@ -146,7 +146,7 @@ jobs:
146146
- name: Install requirements (universal)
147147
run: conda install zlib-ng ${{ matrix.python_version}} tox
148148
- name: Set MSVC developer prompt
149-
uses: ilammy/msvc-dev-cmd@v1.6.0
149+
uses: ilammy/msvc-dev-cmd@v1
150150
if: runner.os == 'Windows'
151151
- name: Run tests (dynamic link)
152152
run: tox
@@ -167,7 +167,7 @@ jobs:
167167
os:
168168
- ubuntu-latest
169169
- macos-13
170-
- macos-14
170+
- macos-latest
171171
- windows-latest
172172
cibw_archs_linux: ["x86_64"]
173173
build_sdist: [true]
@@ -179,25 +179,25 @@ jobs:
179179
with:
180180
submodules: recursive
181181
fetch-depth: 0 # Fetch everything to get accurately versioned tag.
182-
- uses: actions/setup-python@v2
182+
- uses: actions/setup-python@v2 # Some issues where caused by higher versions.
183183
name: Install Python
184184
- name: Install cibuildwheel twine build
185185
run: python -m pip install cibuildwheel twine build
186186
- name: Install build dependencies (Macos)
187187
run: brew install make
188188
if: runner.os == 'macOS'
189189
- name: Set MSVC developer prompt
190-
uses: ilammy/msvc-dev-cmd@v1.6.0
190+
uses: ilammy/msvc-dev-cmd@v1
191191
if: runner.os == 'Windows'
192192
- name: Set up QEMU
193193
if: ${{runner.os == 'Linux' && matrix.cibw_archs_linux == 'aarch64'}}
194-
uses: docker/setup-qemu-action@v1.0.1
194+
uses: docker/setup-qemu-action@v3
195195
with:
196196
platforms: arm64
197197
- name: Build wheels
198198
run: cibuildwheel --output-dir dist
199199
env:
200-
# Skip 32 bit, macosx_arm64 causes issues on cpython 3.8
200+
# Skip 32 bit, macosx_arm64 causes issues on cpython 3.9
201201
CIBW_SKIP: "*-win32 *-manylinux_i686 cp38-macosx_arm64"
202202
CIBW_ARCHS_LINUX: ${{ matrix.cibw_archs_linux }}
203203
CIBW_TEST_REQUIRES: "pytest"
@@ -218,14 +218,14 @@ jobs:
218218
CIBW_ENVIRONMENT_LINUX: >-
219219
PYTHON_ZLIB_NG_BUILD_CACHE=True
220220
PYTHON_ZLIB_NG_BUILD_CACHE_FILE=/tmp/build_cache
221-
CFLAGS="-g0 -DNDEBUG"
221+
CFLAGS="-O3 -DNDEBUG"
222222
CIBW_ENVIRONMENT_WINDOWS: >-
223223
PYTHON_ZLIB_NG_BUILD_CACHE=True
224224
PYTHON_ZLIB_NG_BUILD_CACHE_FILE=${{ runner.temp }}\build_cache
225225
CIBW_ENVIRONMENT_MACOS: >-
226226
PYTHON_ZLIB_NG_BUILD_CACHE=True
227227
PYTHON_ZLIB_NG_BUILD_CACHE_FILE=${{ runner.temp }}/build_cache
228-
CFLAGS="-g0 -DNDEBUG"
228+
CFLAGS="-O3 -DNDEBUG"
229229
- name: Build sdist
230230
if: ${{runner.os == 'Linux' && matrix.cibw_archs_linux == 'x86_64'}}
231231
run:

CHANGELOG.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,22 @@ 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+
The library has been running without issues as a dependency in quite a few
13+
projects and is now stable enough for the first major version.
14+
15+
+ Updated bundled zlib-ng to 2.2.5.
16+
+ Python 3.14 is supported.
17+
+ Python 3.8 and 3.9 are no longer supported.
18+
+ Fix an issue where flushing using igzip_threaded caused a gzip end of stream
19+
and started a new gzip stream. In essence creating a concatenated gzip
20+
stream. Now it is in concordance with how single threaded gzip streams
21+
are flushed using Z_SYNC_FLUSH.
22+
+ Switched to setuptools-scm for building the package rather than versioningit.
23+
+ Test files are added to the source distribution.
24+
+ Fix an issue where some tests failed because they ignored PYTHONPATH.
25+
1026
version 0.5.1
1127
-----------------
1228
+ Fix a bug where flushing in threaded mode did not write the data to the

MANIFEST.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
graft src/zlib_ng/zlib-ng
2-
prune tests
32
prune docs
43
prune benchmark_scripts
54
prune .github
6-
exclude tox.ini
75
exclude requirements-docs.txt
86
exclude codecov.yml
97
exclude .readthedocs.yml

docs/conf.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@
4242
# a list of builtin themes.
4343
#
4444
html_theme = 'sphinx_rtd_theme'
45-
html_theme_options = dict(
46-
display_version=True,
47-
)
4845

4946
# Add any paths that contain custom static files (such as style sheets) here,
5047
# relative to this directory. They are copied after the builtin static files,

pyproject.toml

Lines changed: 54 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,58 @@
11
[build-system]
2-
requires = ["setuptools>=64", "versioningit>=1.1.0"]
2+
requires = ["setuptools>=77", "setuptools-scm>=8"]
33
build-backend = "setuptools.build_meta"
44

5-
[tool.versioningit.vcs]
6-
method="git"
7-
default-tag = "v0.0.0"
5+
[project]
6+
name = "zlib-ng"
7+
dynamic = ["version"]
8+
description = "Drop-in replacement for zlib and gzip modules using zlib-ng"
9+
license="PSF-2.0"
10+
keywords=["zlib-ng", "zlib", "compression", "deflate", "gzip"]
11+
authors = [{name = "Leiden University Medical Center"},
12+
{email = "[email protected]"}]
13+
readme = "README.rst"
14+
requires-python = ">=3.9" # Because of setuptools version
15+
classifiers = [
16+
"Programming Language :: Python :: 3 :: Only",
17+
"Programming Language :: Python :: 3",
18+
"Programming Language :: Python :: 3.10",
19+
"Programming Language :: Python :: 3.11",
20+
"Programming Language :: Python :: 3.12",
21+
"Programming Language :: Python :: 3.13",
22+
"Programming Language :: Python :: 3.14",
23+
"Programming Language :: Python :: Implementation :: CPython",
24+
"Programming Language :: Python :: Implementation :: PyPy",
25+
"Programming Language :: C",
26+
"Development Status :: 5 - Production/Stable",
27+
"Topic :: System :: Archiving :: Compression",
28+
"Operating System :: POSIX :: Linux",
29+
"Operating System :: MacOS",
30+
"Operating System :: Microsoft :: Windows",
31+
]
32+
urls.homepage = "https://github.com/pycompression/python-zlib-ng"
33+
urls.documentation = "https://python-zlib-ng.readthedocs.io"
834

9-
[tool.versioningit.write]
10-
file = "src/zlib_ng/_version.py"
35+
[tool.setuptools_scm]
36+
version_file = "src/zlib_ng/_version.py"
37+
38+
[tool.setuptools.packages.find]
39+
where = ["src"]
40+
include = ["zlib_ng"]
41+
42+
[tool.setuptools.package-data]
43+
zlib_ng = ['*.pyi', 'py.typed', 'zlib-ng/LICENSE', 'zlib-ng/README.md']
44+
[tool.setuptools.exclude-package-data]
45+
zlib_ng = [
46+
"*.c",
47+
"*.h",
48+
"zlib-ng/*/*",
49+
"zlib-ng/*in",
50+
"zlib-ng/.*",
51+
"zlib-ng/*.map",
52+
"zlib-ng/INDEX.md",
53+
"zlib-ng/CMakeLists.txt",
54+
"zlib-ng/PORTING.md",
55+
"zlib-ng/configure",
56+
"zlib-ng/*.empty",
57+
"zlib-ng/FAQ.zlib",
58+
]

requirements-docs.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
sphinx
2-
setuptools
1+
# https://github.com/sphinx-doc/sphinx/issues/13415
2+
sphinx<8
33
sphinx-rtd-theme
44
sphinx-argparse

setup.py

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@
1313
import tempfile
1414
from pathlib import Path
1515

16-
from setuptools import Extension, find_packages, setup
16+
from setuptools import Extension, setup
1717
from setuptools.command.build_ext import build_ext
1818

19-
import versioningit
20-
2119
ZLIB_NG_SOURCE = os.path.join("src", "zlib_ng", "zlib-ng")
2220

2321
SYSTEM_IS_UNIX = (sys.platform.startswith("linux") or
@@ -125,43 +123,6 @@ def build_zlib_ng():
125123

126124

127125
setup(
128-
name="zlib-ng",
129-
version=versioningit.get_version(),
130-
description="Drop-in replacement for zlib and gzip modules using zlib-ng",
131-
author="Leiden University Medical Center",
132-
author_email="[email protected]", # A placeholder for now
133-
long_description=Path("README.rst").read_text(),
134-
long_description_content_type="text/x-rst",
135126
cmdclass={"build_ext": BuildZlibNGExt},
136-
license="PSF-2.0",
137-
keywords="zlib-ng zlib compression deflate gzip",
138-
zip_safe=False,
139-
packages=find_packages('src'),
140-
package_dir={'': 'src'},
141-
package_data={'zlib_ng': [
142-
'*.pyi', 'py.typed',
143-
# Include zlib-ng LICENSE and other relevant files with the binary distribution.
144-
'zlib-ng/LICENSE.md', 'zlib-ng/README.md']},
145-
url="https://github.com/pycompression/python-zlib-ng",
146-
classifiers=[
147-
"Programming Language :: Python :: 3 :: Only",
148-
"Programming Language :: Python :: 3",
149-
"Programming Language :: Python :: 3.8",
150-
"Programming Language :: Python :: 3.9",
151-
"Programming Language :: Python :: 3.10",
152-
"Programming Language :: Python :: 3.11",
153-
"Programming Language :: Python :: 3.12",
154-
"Programming Language :: Python :: 3.13",
155-
"Programming Language :: Python :: Implementation :: CPython",
156-
"Programming Language :: Python :: Implementation :: PyPy",
157-
"Programming Language :: C",
158-
"Development Status :: 4 - Beta",
159-
"Topic :: System :: Archiving :: Compression",
160-
"License :: OSI Approved :: Python Software Foundation License",
161-
"Operating System :: POSIX :: Linux",
162-
"Operating System :: MacOS",
163-
"Operating System :: Microsoft :: Windows",
164-
],
165-
python_requires=">=3.8", # Earliest version still tested.
166127
ext_modules=EXTENSIONS
167128
)

src/zlib_ng/gzip_ng_threaded.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -321,30 +321,25 @@ def write(self, b) -> int:
321321
self.input_queues[worker_index].put((data, zdict))
322322
return len(data)
323323

324-
def _end_gzip_stream(self):
324+
def flush(self):
325325
self._check_closed()
326326
# Wait for all data to be compressed
327327
for in_q in self.input_queues:
328328
in_q.join()
329329
# Wait for all data to be written
330330
for out_q in self.output_queues:
331331
out_q.join()
332-
# Write an empty deflate block with a lost block marker.
332+
self.raw.flush()
333+
334+
def close(self):
335+
if self._closed:
336+
return
333337
self.raw.write(zlib_ng.compress(b"", wbits=-15))
334338
trailer = struct.pack("<II", self._crc, self._size & 0xFFFFFFFF)
335339
self.raw.write(trailer)
336340
self._crc = 0
337341
self._size = 0
338342
self.raw.flush()
339-
340-
def flush(self):
341-
self._end_gzip_stream()
342-
self._write_gzip_header()
343-
344-
def close(self) -> None:
345-
if self._closed:
346-
return
347-
self._end_gzip_stream()
348343
self.stop()
349344
if self.exception:
350345
self.raw.close()

src/zlib_ng/zlib-ng

Submodule zlib-ng updated 216 files

0 commit comments

Comments
 (0)