Skip to content

Commit 03cd4a0

Browse files
authored
Merge pull request #152 from openzim/libzim8
Update to libzim 8
2 parents 4140999 + 6eff603 commit 03cd4a0

File tree

5 files changed

+43
-43
lines changed

5 files changed

+43
-43
lines changed

.github/workflows/release.yml

Lines changed: 28 additions & 28 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,23 +41,26 @@ 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
4848
run: |
4949
echo "${{ secrets.APPLE_SIGNING_CERTIFICATE }}" | base64 --decode -o $CERTIFICATE
50-
security create-keychain -p mysecretpassword build.keychain
51-
security default-keychain -s build.keychain
52-
security unlock-keychain -p mysecretpassword build.keychain
53-
security import $CERTIFICATE -k build.keychain -P "${{ secrets.APPLE_SIGNING_P12_PASSWORD }}" -A
50+
security create-keychain -p mysecretpassword $(pwd)/build.keychain
51+
security default-keychain -s $(pwd)/build.keychain
52+
security unlock-keychain -p mysecretpassword $(pwd)/build.keychain
53+
security import $CERTIFICATE -k $(pwd)/build.keychain -P "${{ secrets.APPLE_SIGNING_P12_PASSWORD }}" -A
5454
rm $CERTIFICATE
55-
security set-key-partition-list -S "apple-tool:,apple:" -s -k mysecretpassword build.keychain
55+
security set-key-partition-list -S "apple-tool:,apple:" -s -k mysecretpassword $(pwd)/build.keychain
5656
security find-identity -v
57-
sudo sntp -sS -t 60 time4.google.com || true
58-
xcrun altool --store-password-in-keychain-item "ALTOOL_PASSWORD" \
59-
-u "${{ secrets.APPLE_SIGNING_ALTOOL_USERNAME }}" \
60-
-p "${{ secrets.APPLE_SIGNING_ALTOOL_PASSWORD }}"
57+
xcrun notarytool store-credentials \
58+
--apple-id "${{ secrets.APPLE_SIGNING_ALTOOL_USERNAME }}" \
59+
--password "${{ secrets.APPLE_SIGNING_ALTOOL_PASSWORD }}" \
60+
--team-id "${{ secrets.APPLE_SIGNING_TEAM }}" \
61+
--validate \
62+
--keychain $(pwd)/build.keychain \
63+
build-profile
6164
6265
- name: set linux environ
6366
if: matrix.os == 'ubuntu-20.04'
@@ -86,33 +89,33 @@ jobs:
8689
if: matrix.os == 'ubuntu-20.04'
8790
run: |
8891
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
92+
ln -sf libzim.so.${LIBZIM_VERSION:0:1} lib/libzim.so
93+
ln -sf $GITHUB_WORKSPACE/libzim_dist/$LIBZIM_INCLUDE_PATH include/zim
9194
9295
- name: Link macOS libzim dylib & headers into workspace lib and include folders
93-
if: matrix.os == 'macos-10.15'
96+
if: matrix.os == 'macos-12'
9497
run: |
9598
cp -Pp $GITHUB_WORKSPACE/libzim_dist/lib/* lib/
9699
ln -sf libzim.${LIBZIM_VERSION:0:1}.dylib lib/libzim.dylib
97-
ln -s $GITHUB_WORKSPACE/libzim_dist/$LIBZIM_INCLUDE_PATH include/zim
100+
ln -sf $GITHUB_WORKSPACE/libzim_dist/$LIBZIM_INCLUDE_PATH include/zim
98101
99102
- name: Build cython and sdist
100103
run: |
101-
pip install --upgrade "cython>=0.29.30,<3.0" setuptools pip wheel
104+
pip install --upgrade "cython>=0.29.32,<3.0" setuptools pip wheel
102105
python3 setup.py build_ext --rpath $RPATH
103106
if [[ "${{ matrix.python-version }}" == "3.8" ]]
104107
then
105108
python3 setup.py sdist
106109
fi
107110
108111
- name: add macOS libzim binary to source for wheel
109-
if: matrix.os == 'macos-10.15'
112+
if: matrix.os == 'macos-12'
110113
run: |
111114
install_name_tool -change libzim.${LIBZIM_VERSION:0:1}.dylib @loader_path/libzim.${LIBZIM_VERSION:0:1}.dylib $(find build -name "libzim.cpython*.so")
112115
cp -pv lib/libzim.${LIBZIM_VERSION:0:1}.dylib $(find build/lib* -type d)/
113116
114117
- name: sign macOS wrapper binary
115-
if: matrix.os == 'macos-10.15'
118+
if: matrix.os == 'macos-12'
116119
run: |
117120
echo "make sure libzim is signed and notarized"
118121
spctl -a -v -t install lib/libzim.${LIBZIM_VERSION:0:1}.dylib
@@ -123,15 +126,12 @@ jobs:
123126
wrapper_zip="${wrapper}.zip"
124127
ditto -c -k --keepParent ${wrapper} ${wrapper_zip}
125128
echo "request notarization"
126-
xcrun altool --notarize-app --file ${wrapper_zip} \
127-
--primary-bundle-id org.openzim.libzim.pylibzim \
128-
--username "${{ secrets.APPLE_SIGNING_ALTOOL_USERNAME }}" \
129-
--password "@keychain:ALTOOL_PASSWORD" \
130-
--asc-provider "${{ secrets.APPLE_SIGNING_TEAM }}"
129+
security unlock-keychain -p mysecretpassword $(pwd)/build.keychain
130+
xcrun notarytool submit --keychain $(pwd)/build.keychain --keychain-profile "build-profile" --wait ${wrapper_zip}
131131
echo "remove zip file"
132132
rm ${wrapper_zip}
133133
echo "display request status (should be rejected)"
134-
spctl -a -v -t install ${wrapper} || true
134+
spctl --assess -vv --type install ${wrapper}
135135
136136
- name: add Linux libzim binary to source for wheel
137137
if: matrix.os == 'ubuntu-20.04'

.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)