Skip to content

Commit b893d2a

Browse files
authored
Merge pull request #171 from openzim/8_2_1
Using libzim 8.2.1
2 parents 2dd7b0f + aec5528 commit b893d2a

File tree

7 files changed

+61
-18
lines changed

7 files changed

+61
-18
lines changed

.github/workflows/release.yaml

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

88
env:
9-
LIBZIM_DL_VERSION: "8.2.0"
9+
LIBZIM_DL_VERSION: "8.2.1-1"
1010
MACOSX_DEPLOYMENT_TARGET: "11.0"
1111
CIBW_ENVIRONMENT_PASS_LINUX: "LIBZIM_DL_VERSION"
1212
# APPLE_SIGNING_KEYCHAIN_PATH set in prepare keychain step
@@ -68,7 +68,7 @@ jobs:
6868
security unlock-keychain -p mysecretpassword ${APPLE_SIGNING_KEYCHAIN_PATH}
6969
7070
- name: Build wheels
71-
uses: pypa/cibuildwheel@v2.12.1
71+
uses: pypa/cibuildwheel@v2.14
7272

7373
- name: Cleanup Apple Keychain
7474
if: matrix.os == 'macos-12'

.github/workflows/test.yml

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

44
env:
5-
LIBZIM_DL_VERSION: "2023-07-13"
5+
LIBZIM_DL_VERSION: "8.2.1-1"
66

77
jobs:
88
lint:
99
runs-on: ubuntu-20.04
1010
steps:
11-
- uses: actions/checkout@v3.1.0
11+
- uses: actions/checkout@v3
1212

1313
- name: Set up Python ${{ matrix.python }}
14-
uses: actions/setup-python@v4.2.0
14+
uses: actions/setup-python@v4
1515
with:
1616
python-version: "3.11"
1717
architecture: x64
@@ -27,13 +27,13 @@ jobs:
2727
strategy:
2828
matrix:
2929
os: [ubuntu-22.04, macos-12]
30-
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
30+
python: ["3.8", "3.9", "3.10", "3.11"]
3131

3232
steps:
33-
- uses: actions/checkout@v3.1.0
33+
- uses: actions/checkout@v3
3434

3535
- name: Set up Python ${{ matrix.python }}
36-
uses: actions/setup-python@v4.2.0
36+
uses: actions/setup-python@v4
3737
with:
3838
python-version: ${{ matrix.python }}
3939
architecture: x64

.github/workflows/wheels.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ on:
77
- main
88

99
env:
10-
LIBZIM_DL_VERSION: "2023-07-13"
10+
LIBZIM_DL_VERSION: "8.2.1-1"
1111
MACOSX_DEPLOYMENT_TARGET: "11.0"
1212
CIBW_ENVIRONMENT_PASS_LINUX: "LIBZIM_DL_VERSION"
13+
CIBW_BUILD_VERBOSITY: "3"
1314

1415

1516
jobs:
@@ -30,7 +31,7 @@ jobs:
3031
platforms: all
3132

3233
- name: Build wheels
33-
uses: pypa/cibuildwheel@v2.12.1
34+
uses: pypa/cibuildwheel@v2.14
3435

3536
- uses: actions/upload-artifact@v3
3637
with:

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [Unreleased]
9+
10+
### Added
11+
12+
- Added `clean` command to setup.py to remove downloaded libzim
13+
14+
### Changed
15+
16+
- Build with (and target) libzim 8.2.1
17+
18+
## Removed
19+
20+
- Support for Python 3.7 (EOL)
21+
822
## [3.1.0] - 2023-05-01
923

1024
### Changed

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[build-system]
2-
requires = [ "setuptools >= 35.0.2", "wheel >= 0.29.0", "cython >= 0.29.34,<3.0" ]
2+
requires = [ "setuptools == 68.0.0", "wheel == 0.41.0", "cython == 0.29.36" ]
33
build-backend = "setuptools.build_meta"
44

55
[tool.black]
6-
target-version = ['py37', 'py38', 'py39', 'py310', 'py311']
6+
target-version = ['py38', 'py39', 'py310', 'py311']
77

88

99
[tool.pytest.ini_options]
@@ -35,4 +35,4 @@ archs = ["x86_64", "arm64"]
3535
# skipping tests on cp <=3.9 as the wheels we produce are on unexpected combinations
3636
# because those python versions were released before our building host version
3737
# > requires changing wheel names
38-
test-skip = "*_arm64 cp39* cp38* cp37*"
38+
test-skip = "*_arm64 cp39* cp38*"

setup.cfg

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ classifiers =
2424
Intended Audience :: Developers
2525
Programming Language :: Cython
2626
Programming Language :: Python :: 3
27-
Programming Language :: Python :: 3.7
2827
Programming Language :: Python :: 3.8
2928
Programming Language :: Python :: 3.9
3029
Programming Language :: Python :: 3.10
@@ -40,9 +39,9 @@ zim_safe = False
4039
packages =
4140
libzim
4241
python_requires =
43-
>=3.7,<3.12
42+
>=3.8,<3.12
4443
setup_requires =
45-
cython >= 0.29.34,<0.30
44+
cython == 0.29.36
4645
test_requires =
4746
pytest
4847

setup.py

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929

3030
class Config:
31-
libzim_dl_version: str = os.getenv("LIBZIM_DL_VERSION", "8.2.0")
31+
libzim_dl_version: str = os.getenv("LIBZIM_DL_VERSION", "8.2.1-1")
3232
use_system_libzim: bool = bool(os.getenv("USE_SYSTEM_LIBZIM", False))
3333
download_libzim: bool = not bool(os.getenv("DONT_DOWNLOAD_LIBZIM", False))
3434

@@ -256,6 +256,18 @@ def _install_from(self, folder: pathlib.Path):
256256
file=sys.stderr,
257257
)
258258

259+
def cleanup(self):
260+
"""removes created files to prevent re-run issues"""
261+
# we downloaded libzim, so we must remove it
262+
if self.download_libzim:
263+
print("removing downloaded libraries")
264+
for fpath in self.dylib_file.parent.glob("*.[dylib|so]*"):
265+
print(">", fpath)
266+
fpath.unlink(missing_ok=True)
267+
if self.header_file.parent.exists():
268+
print("removing downloaded headers")
269+
shutil.rmtree(self.header_file.parent, ignore_errors=True)
270+
259271
@property
260272
def header_file(self) -> pathlib.Path:
261273
return self.base_dir / "include" / "zim" / "zim.h"
@@ -466,13 +478,30 @@ def run(self):
466478
config.download_to_dest()
467479

468480

481+
class LibzimClean(Command):
482+
user_options = []
483+
484+
def initialize_options(self):
485+
...
486+
487+
def finalize_options(self):
488+
...
489+
490+
def run(self):
491+
config.cleanup()
492+
493+
469494
if len(sys.argv) == 2 and sys.argv[1] in config.buildless_commands:
470495
ext_modules = None
471496
else:
472497
config.check_platform()
473498
ext_modules = get_cython_extension()
474499

475500
setup(
476-
cmdclass={"build_ext": LibzimBuildExt, "download_libzim": DownloadLibzim},
501+
cmdclass={
502+
"build_ext": LibzimBuildExt,
503+
"download_libzim": DownloadLibzim,
504+
"clean": LibzimClean,
505+
},
477506
ext_modules=ext_modules,
478507
)

0 commit comments

Comments
 (0)