Skip to content

Commit 98a4f52

Browse files
committed
Update to libzim 8
Uses libzim8 release and updates tests & release worflow: - macos-10.15 has been removed - macos-12 has no default python3.6 anymore. Using python-versions's 3.6.15 (downloaded) - pytest7 now requires pythonpath in pyproject.toml - using latest minor cython 0.29.32 - Updating blank ZIM's expected size. libzim8 creates a slightly larger ZIM for this.
1 parent 4140999 commit 98a4f52

File tree

5 files changed

+28
-28
lines changed

5 files changed

+28
-28
lines changed

.github/workflows/release.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- v*
77

88
env:
9-
LIBZIM_VERSION: 7.2.2
9+
LIBZIM_VERSION: 8.0.0
1010
LIBZIM_INCLUDE_PATH: include/zim
1111
TWINE_USERNAME: __token__
1212
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
@@ -19,20 +19,20 @@ jobs:
1919
runs-on: ${{ matrix.os }}
2020
strategy:
2121
matrix:
22-
os: [ubuntu-20.04, macos-10.15]
23-
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
22+
os: [ubuntu-20.04, macos-12]
23+
python-version: ["3.6.15", "3.7", "3.8", "3.9", "3.10"]
2424

2525
steps:
2626
- uses: actions/checkout@v2
2727

2828
- name: Set up Python ${{ matrix.python-version }}
29-
uses: actions/setup-python@v1
29+
uses: actions/setup-python@v4.2.0
3030
with:
3131
python-version: ${{ matrix.python-version }}
3232
architecture: x64
3333

3434
- name: set macOS environ
35-
if: matrix.os == 'macos-10.15'
35+
if: matrix.os == 'macos-12'
3636
run: |
3737
echo LIBZIM_EXT=dylib >> $GITHUB_ENV
3838
echo LIBZIM_RELEASE=libzim_macos-x86_64-$LIBZIM_VERSION >> $GITHUB_ENV
@@ -41,7 +41,7 @@ jobs:
4141
echo RPATH=@loader_path/ >> $GITHUB_ENV
4242
4343
- name: install Apple certificate
44-
if: matrix.os == 'macos-10.15'
44+
if: matrix.os == 'macos-12'
4545
shell: bash
4646
env:
4747
CERTIFICATE: /tmp/wmch-devid.p12
@@ -86,33 +86,33 @@ jobs:
8686
if: matrix.os == 'ubuntu-20.04'
8787
run: |
8888
cp -dp $GITHUB_WORKSPACE/libzim_dist/lib/x86_64-linux-gnu/* lib/
89-
ln -s libzim.so.${LIBZIM_VERSION:0:1} lib/libzim.so
90-
ln -s $GITHUB_WORKSPACE/libzim_dist/$LIBZIM_INCLUDE_PATH include/zim
89+
ln -sf libzim.so.${LIBZIM_VERSION:0:1} lib/libzim.so
90+
ln -sf $GITHUB_WORKSPACE/libzim_dist/$LIBZIM_INCLUDE_PATH include/zim
9191
9292
- name: Link macOS libzim dylib & headers into workspace lib and include folders
93-
if: matrix.os == 'macos-10.15'
93+
if: matrix.os == 'macos-12'
9494
run: |
9595
cp -Pp $GITHUB_WORKSPACE/libzim_dist/lib/* lib/
9696
ln -sf libzim.${LIBZIM_VERSION:0:1}.dylib lib/libzim.dylib
97-
ln -s $GITHUB_WORKSPACE/libzim_dist/$LIBZIM_INCLUDE_PATH include/zim
97+
ln -sf $GITHUB_WORKSPACE/libzim_dist/$LIBZIM_INCLUDE_PATH include/zim
9898
9999
- name: Build cython and sdist
100100
run: |
101-
pip install --upgrade "cython>=0.29.30,<3.0" setuptools pip wheel
101+
pip install --upgrade "cython>=0.29.32,<3.0" setuptools pip wheel
102102
python3 setup.py build_ext --rpath $RPATH
103103
if [[ "${{ matrix.python-version }}" == "3.8" ]]
104104
then
105105
python3 setup.py sdist
106106
fi
107107
108108
- name: add macOS libzim binary to source for wheel
109-
if: matrix.os == 'macos-10.15'
109+
if: matrix.os == 'macos-12'
110110
run: |
111111
install_name_tool -change libzim.${LIBZIM_VERSION:0:1}.dylib @loader_path/libzim.${LIBZIM_VERSION:0:1}.dylib $(find build -name "libzim.cpython*.so")
112112
cp -pv lib/libzim.${LIBZIM_VERSION:0:1}.dylib $(find build/lib* -type d)/
113113
114114
- name: sign macOS wrapper binary
115-
if: matrix.os == 'macos-10.15'
115+
if: matrix.os == 'macos-12'
116116
run: |
117117
echo "make sure libzim is signed and notarized"
118118
spctl -a -v -t install lib/libzim.${LIBZIM_VERSION:0:1}.dylib

.github/workflows/test.yml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: test
22
on: [push]
33

44
env:
5-
LIBZIM_VERSION: 7.2.2
5+
LIBZIM_VERSION: 8.0.0
66
LIBZIM_INCLUDE_PATH: include/zim
77
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
88
PROFILE: 1
@@ -29,31 +29,31 @@ jobs:
2929
runs-on: ${{ matrix.os }}
3030
strategy:
3131
matrix:
32-
os: [ubuntu-20.04, macos-10.15]
33-
python: ["3.6", "3.7", "3.8", "3.9", "3.10"]
32+
os: [ubuntu-20.04, macos-12]
33+
python: ["3.6.15", "3.7", "3.8", "3.9", "3.10"]
3434

3535
steps:
3636
- uses: actions/checkout@v2
3737

3838
- name: Set up Python ${{ matrix.python }}
39-
uses: actions/setup-python@v1
39+
uses: actions/setup-python@v4.2.0
4040
with:
4141
python-version: ${{ matrix.python }}
4242
architecture: x64
4343

4444
- name: set macOS environ
45-
if: matrix.os == 'macos-10.15'
45+
if: matrix.os == 'macos-12'
4646
run: |
4747
echo LIBZIM_EXT=dylib >> $GITHUB_ENV
4848
echo LIBZIM_RELEASE=libzim_macos-x86_64-$LIBZIM_VERSION >> $GITHUB_ENV
49-
echo LIBZIM_LIBRARY_PATH=lib/libzim.7.dylib >> $GITHUB_ENV
49+
echo LIBZIM_LIBRARY_PATH=lib/libzim.8.dylib >> $GITHUB_ENV
5050
5151
- name: set linux environ
5252
if: matrix.os == 'ubuntu-20.04'
5353
run: |
5454
echo LIBZIM_EXT=so >> $GITHUB_ENV
5555
echo LIBZIM_RELEASE=libzim_linux-x86_64-$LIBZIM_VERSION >> $GITHUB_ENV
56-
echo LIBZIM_LIBRARY_PATH=lib/x86_64-linux-gnu/libzim.so.7.2.2 >> $GITHUB_ENV
56+
echo LIBZIM_LIBRARY_PATH=lib/x86_64-linux-gnu/libzim.so.$LIBZIM_VERSION >> $GITHUB_ENV
5757
5858
- name: Cache libzim dylib & headers
5959
uses: actions/cache@master
@@ -81,22 +81,17 @@ jobs:
8181
run: |
8282
sudo ldconfig $PWD/lib
8383
84-
- name: update macOS shared objects cache
85-
if: matrix.os == 'macos-10.15'
86-
run: |
87-
export DYLD_LIBRARY_PATH="$PWD/lib:$DYLD_LIBRARY_PATH"
88-
8984
- name: Build cython, sdist, and bdist_wheel
9085
run: |
91-
pip install --upgrade pip install "cython>=0.29.30,<3.0" setuptools pip wheel
86+
pip install --upgrade pip install "cython>=0.29.32,<3.0" setuptools pip wheel
9287
python3 setup.py build_ext --inplace
9388
python3 setup.py sdist bdist_wheel
9489
9590
- name: Test built package with pytest
9691
run: |
9792
pip install pytest pytest-cov
9893
pip install -e .
99-
export DYLD_LIBRARY_PATH="$PWD/lib:$DYLD_LIBRARY_PATH"
94+
export DYLD_LIBRARY_PATH="$PWD:$PWD/lib:$DYLD_LIBRARY_PATH"
10095
pytest --cov=libzim --cov-report=term --cov-report term-missing .
10196
10297
- name: Upload coverage report to codecov

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- Removed `lzma` compression option (#150)
1313

14+
### Changed
15+
16+
- Using libzim 8.0.0
17+
1418
## [1.1.1] – 2022-06-17
1519

1620
### Changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ target-version = ['py36', 'py37', 'py38', 'py39', 'py310']
88

99
[tool.pytest.ini_options]
1010
testpaths = ["tests"]
11+
pythonpath = ["."]

tests/test_libzim_reader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
ZIMS_DATA = {
1818
"blank.zim": {
1919
"filename": "blank.zim",
20-
"filesize": 1173,
20+
"filesize": 2197,
2121
"new_ns": True,
2222
"mutlipart": False,
2323
"zim_uuid": None,

0 commit comments

Comments
 (0)