From 0525755e85ddb40aea8f5bbd0b5f044c132dd81e Mon Sep 17 00:00:00 2001 From: renaud gaudin Date: Wed, 8 Nov 2023 14:37:56 +0000 Subject: [PATCH 1/2] Dependencies updates and Python 3.12 Updating all our dependencies and building targets to make sure we support and publish for 3.12 Building on macos-13 as well and bump macOS min version to 12.0 to harmonize with other projects --- .github/workflows/release.yaml | 14 +++++++------- .github/workflows/test.yml | 9 +++++---- .github/workflows/wheels.yml | 6 +++--- pyproject.toml | 4 ++-- requirements-dev.txt | 8 ++++---- setup.cfg | 5 +++-- tests/test_libzim_creator.py | 2 +- tests/test_libzim_reader.py | 1 - 8 files changed, 25 insertions(+), 24 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e87a8f37..8d2b9502 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -7,7 +7,7 @@ on: env: LIBZIM_DL_VERSION: "8.2.1-1" - MACOSX_DEPLOYMENT_TARGET: "11.0" + MACOSX_DEPLOYMENT_TARGET: "12.0" CIBW_ENVIRONMENT_PASS_LINUX: "LIBZIM_DL_VERSION" # APPLE_SIGNING_KEYCHAIN_PATH set in prepare keychain step APPLE_SIGNING_KEYCHAIN_PROFILE: "build-profile" @@ -22,19 +22,19 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-20.04, macos-12] # macos-11, windows-2019 + os: [ubuntu-20.04, macos-13] # windows-2019 steps: - uses: actions/checkout@v3 - name: Set up QEMU if: runner.os == 'Linux' - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 with: platforms: all - name: Prepare Apple Keychain for Signing - if: matrix.os == 'macos-12' + if: matrix.os == 'macos-13' shell: bash run: | # store certificate on filesystem @@ -68,10 +68,10 @@ jobs: security unlock-keychain -p mysecretpassword ${APPLE_SIGNING_KEYCHAIN_PATH} - name: Build wheels - uses: pypa/cibuildwheel@v2.14 + uses: pypa/cibuildwheel@v2.16 - name: Cleanup Apple Keychain - if: matrix.os == 'macos-12' + if: matrix.os == 'macos-13' shell: bash run: | security lock-keychain ${APPLE_SIGNING_KEYCHAIN_PATH} @@ -107,7 +107,7 @@ jobs: name: artifact path: dist - - uses: pypa/gh-action-pypi-publish@v1.5.0 + - uses: pypa/gh-action-pypi-publish@v1.8.10 with: user: __token__ # password: ${{ secrets.PYPI_TEST_API_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 833da265..130b296e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,17 +3,18 @@ on: [push] env: LIBZIM_DL_VERSION: "nightly" + MACOSX_DEPLOYMENT_TARGET: "12.0" jobs: lint: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python }} uses: actions/setup-python@v4 with: - python-version: "3.11" + python-version: "3.12" architecture: x64 - name: Check formatting and linting @@ -26,8 +27,8 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-22.04, macos-12] - python: ["3.8", "3.9", "3.10", "3.11"] + os: [ubuntu-22.04, macos-13] + python: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 1f1fa524..32d9a265 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -8,7 +8,7 @@ on: env: LIBZIM_DL_VERSION: "nightly" - MACOSX_DEPLOYMENT_TARGET: "11.0" + MACOSX_DEPLOYMENT_TARGET: "12.0" CIBW_ENVIRONMENT_PASS_LINUX: "LIBZIM_DL_VERSION" CIBW_BUILD_VERBOSITY: "3" @@ -19,7 +19,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-20.04, macos-12] # macos-11, windows-2019 + os: [ubuntu-20.04, macos-13] # windows-2019 steps: - uses: actions/checkout@v3 @@ -31,7 +31,7 @@ jobs: platforms: all - name: Build wheels - uses: pypa/cibuildwheel@v2.14 + uses: pypa/cibuildwheel@v2.16 - uses: actions/upload-artifact@v3 with: diff --git a/pyproject.toml b/pyproject.toml index 27cd94a7..267eaebc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,9 @@ [build-system] -requires = [ "setuptools == 68.0.0", "wheel == 0.41.0", "cython == 0.29.36" ] +requires = [ "setuptools == 68.2.2", "wheel == 0.41.3", "cython == 3.0.5" ] build-backend = "setuptools.build_meta" [tool.black] -target-version = ['py38', 'py39', 'py310', 'py311'] +target-version = ['py38', 'py39', 'py310', 'py311', 'py312'] [tool.pytest.ini_options] diff --git a/requirements-dev.txt b/requirements-dev.txt index 76b4d87d..9564bbcb 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,8 +1,8 @@ isort>=5.10.1,<6.0 -black>=22.10.0,<23.0 +black~=23.11 flake8>=6.0.0,<7.0 -invoke>=1.7.3,<2.0 -coverage>=6.5.0,<7.0 +invoke>=1.7.3,<3.0 +coverage>=6.5.0,<8.0 pytest>=7.2,<8.0 pytest-cov>=4.0.0,<5.0 -Cython>=0.29.32 +Cython>=3.0.5 diff --git a/setup.cfg b/setup.cfg index 48523007..51a67316 100644 --- a/setup.cfg +++ b/setup.cfg @@ -28,6 +28,7 @@ classifiers = Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 Typing :: Stubs Only License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+) Operating System :: MacOS @@ -39,9 +40,9 @@ zim_safe = False packages = libzim python_requires = - >=3.8,<3.12 + >=3.8,<3.13 setup_requires = - cython == 0.29.36 + cython == 3.0.5 test_requires = pytest diff --git a/tests/test_libzim_creator.py b/tests/test_libzim_creator.py index 2cb354c0..95d996ae 100644 --- a/tests/test_libzim_creator.py +++ b/tests/test_libzim_creator.py @@ -362,7 +362,7 @@ def test_creator_additem(fpath, lipsum_item): c.add_item(None) with pytest.raises(RuntimeError): c.add_item("hello") - with pytest.raises(TypeError, match="takes no keyword arguments"): + with pytest.raises(TypeError, match="takes exactly 1 positional argument"): c.add_item(mimetype="text/html") diff --git a/tests/test_libzim_reader.py b/tests/test_libzim_reader.py index 6763cd02..3ead9fb8 100644 --- a/tests/test_libzim_reader.py +++ b/tests/test_libzim_reader.py @@ -358,7 +358,6 @@ def test_reader_archive(all_zims, filename, filesize, new_ns, mutlipart, zim_uui def test_reader_metadata( all_zims, filename, metadata_keys, test_metadata, test_metadata_value ): - zim = Archive(all_zims / filename) # make sure metadata_keys is empty From 2dce834a8f41f78adb297be647590bd2fe4fe2c1 Mon Sep 17 00:00:00 2001 From: renaud gaudin Date: Tue, 14 Nov 2023 15:35:03 +0000 Subject: [PATCH 2/2] Using libzim 9 --- .github/workflows/release.yaml | 2 +- .github/workflows/test.yml | 2 +- .github/workflows/wheels.yml | 2 +- CHANGELOG.md | 6 ++++++ setup.cfg | 4 ++-- setup.py | 4 ++-- 6 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8d2b9502..296a89c1 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -6,7 +6,7 @@ on: - published env: - LIBZIM_DL_VERSION: "8.2.1-1" + LIBZIM_DL_VERSION: "9.0.0" MACOSX_DEPLOYMENT_TARGET: "12.0" CIBW_ENVIRONMENT_PASS_LINUX: "LIBZIM_DL_VERSION" # APPLE_SIGNING_KEYCHAIN_PATH set in prepare keychain step diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 130b296e..a455b986 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,7 +2,7 @@ name: test on: [push] env: - LIBZIM_DL_VERSION: "nightly" + LIBZIM_DL_VERSION: "9.0.0" MACOSX_DEPLOYMENT_TARGET: "12.0" jobs: diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 32d9a265..b97bf28d 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -7,7 +7,7 @@ on: - main env: - LIBZIM_DL_VERSION: "nightly" + LIBZIM_DL_VERSION: "9.0.0" MACOSX_DEPLOYMENT_TARGET: "12.0" CIBW_ENVIRONMENT_PASS_LINUX: "LIBZIM_DL_VERSION" CIBW_BUILD_VERBOSITY: "3" diff --git a/CHANGELOG.md b/CHANGELOG.md index 09d44157..22ddfcdc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Changed + +- Using C++ libzim 9.0.0 + ## [3.2.0] - 2023-09-15 ### Added diff --git a/setup.cfg b/setup.cfg index 51a67316..3e29c956 100644 --- a/setup.cfg +++ b/setup.cfg @@ -48,8 +48,8 @@ test_requires = [options.package_data] libzim = - libzim.8.dylib - libzim.so.8 + libzim.9.dylib + libzim.so.9 [isort] profile = black diff --git a/setup.py b/setup.py index f4c1a08d..9dcaea2c 100755 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ class Config: - libzim_dl_version: str = os.getenv("LIBZIM_DL_VERSION", "8.2.1-1") + libzim_dl_version: str = os.getenv("LIBZIM_DL_VERSION", "9.0.0") use_system_libzim: bool = bool(os.getenv("USE_SYSTEM_LIBZIM", False)) download_libzim: bool = not bool(os.getenv("DONT_DOWNLOAD_LIBZIM", False)) @@ -62,7 +62,7 @@ class Config: @property def libzim_major(self) -> str: # assuming nightlies are for version 8.x - return 8 if self.is_nightly else self.libzim_dl_version[0] + return 9 if self.is_nightly else self.libzim_dl_version[0] @property def found_libzim(self) -> str: