Skip to content

Commit

Permalink
Dependencies updates and Python 3.12
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rgaudin committed Nov 15, 2023
1 parent 68ed8ef commit 0525755
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 24 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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 }}
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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
Expand All @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
8 changes: 4 additions & 4 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -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
5 changes: 3 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion tests/test_libzim_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")


Expand Down
1 change: 0 additions & 1 deletion tests/test_libzim_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0525755

Please sign in to comment.