Skip to content

Commit 29b74aa

Browse files
authored
Merge pull request #156 from openzim/libzim8.1
Libzim 8.1
2 parents 4641f5a + fbba9a5 commit 29b74aa

File tree

13 files changed

+73
-24
lines changed

13 files changed

+73
-24
lines changed

.github/workflows/release.yml

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

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

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

.github/workflows/test.yml

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

44
env:
5-
LIBZIM_VERSION: 8.0.0
5+
LIBZIM_VERSION: 8.1.0
66
LIBZIM_INCLUDE_PATH: include/zim
77
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
88
PROFILE: 1
@@ -16,7 +16,7 @@ jobs:
1616
- name: Set up Python ${{ matrix.python }}
1717
uses: actions/setup-python@v1
1818
with:
19-
python-version: 3.6
19+
python-version: "3.10"
2020
architecture: x64
2121

2222
- name: Check formatting and linting
@@ -30,7 +30,7 @@ jobs:
3030
strategy:
3131
matrix:
3232
os: [ubuntu-20.04, macos-12]
33-
python: ["3.6.15", "3.7", "3.8", "3.9", "3.10"]
33+
python: ["3.6.15", "3.7", "3.8", "3.9", "3.10", "3.11"]
3434

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

CHANGELOG.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,27 @@ 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+
* `Archive.media_count`
13+
* Python 3.11 Support
14+
15+
### Changed
16+
17+
* Using libzim 8.1.0
18+
* Exceptions in getIndexData dont crash interpreter (#153)
19+
820
## [2.0.0] - 2022-09-06
921

1022
### Removed
1123

12-
- Removed `lzma` compression option (#150)
24+
* Removed `lzma` compression option (#150)
1325

1426
### Changed
1527

16-
- Using libzim 8.0.0
28+
* Using libzim 8.0.0
1729

1830
## [1.1.1] – 2022-06-17
1931

MANIFEST.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ include pyproject.toml
55
include setup.cfg
66
include requirements-dev.txt
77
include tasks.py
8-
include lib/libzim.7.dylib
9-
include lib/libzim.so.7
8+
include lib/libzim.8.dylib
9+
include lib/libzim.so.8
1010
include libzim/*.cxx
1111
include libzim/*.h
1212
include libzim/*.py

libzim/libwrapper.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ class Archive : public Wrapper<zim::Archive>
158158
FORWARD(zim::size_type, getEntryCount)
159159
FORWARD(zim::size_type, getAllEntryCount)
160160
FORWARD(zim::size_type, getArticleCount)
161+
FORWARD(zim::size_type, getMediaCount)
161162
FORWARD(std::string, getChecksum)
162163
FORWARD(std::string, getFilename)
163164
FORWARD(bool, hasMainEntry)

libzim/libzim.pyx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,13 @@ cdef class Archive:
987987
listing, resulting in this returning all entries."""
988988
return self.c_archive.getArticleCount()
989989

990+
@property
991+
def media_count(self) -> pyint:
992+
"""Number of media in the Archive
993+
994+
This definition of "media" is based on the mimetype."""
995+
return self.c_archive.getMediaCount()
996+
990997
def get_illustration_sizes(self) -> Set[pyint]:
991998
"""Sizes for which an illustration is available (@1 scale only)"""
992999
return self.c_archive.getIllustrationSizes()

libzim/zim.pxd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ cdef extern from "libwrapper.h" namespace "wrapper":
156156
size_type getEntryCount() except +
157157
size_type getAllEntryCount() except +
158158
size_type getArticleCount() except +
159+
size_type getMediaCount() except +
159160

160161
string getChecksum() except +
161162
string getFilename() except +

pyproject.toml

Lines changed: 2 additions & 2 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", "twine", "cython >= 0.29.30,<3.0" ]
2+
requires = [ "setuptools >= 35.0.2", "wheel >= 0.29.0", "twine", "cython >= 0.29.32,<3.0" ]
33
build-backend = "setuptools.build_meta"
44

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

88

99
[tool.pytest.ini_options]

requirements-dev.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
isort>=5.9,<6.0
2-
black>=21.9b0,<22.0
3-
flake8>=3.9,<4.0
4-
invoke>=1.5,<2.0
5-
coverage>=5.0,<7.0
6-
pytest>=6.2,<7.0
7-
pytest-cov>=2.10,<4.0
8-
Cython>=0.29.30
1+
isort>=5.10.1,<6.0
2+
black>=22.10.0,<23.0
3+
flake8>=6.0.0,<7.0
4+
invoke>=1.7.3,<2.0
5+
coverage>=6.5.0,<7.0
6+
pytest>=7.2,<8.0
7+
pytest-cov>=4.0.0,<5.0
8+
Cython>=0.29.32

setup.cfg

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ classifiers =
2929
Programming Language :: Python :: 3.8
3030
Programming Language :: Python :: 3.9
3131
Programming Language :: Python :: 3.10
32+
Programming Language :: Python :: 3.11
3233
Typing :: Stubs Only
3334
License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
3435
Operating System :: MacOS
@@ -40,9 +41,9 @@ zim_safe = False
4041
packages =
4142
libzim
4243
python_requires =
43-
>=3.6,<3.11
44+
>=3.6,<3.12
4445
setup_requires =
45-
cython >= 0.29.30,<0.30
46+
cython >= 0.29.32,<0.30
4647
test_requires =
4748
pytest
4849

0 commit comments

Comments
 (0)