Skip to content

Commit 5f126ab

Browse files
authored
Merge pull request #147 from openzim/scraperlib_3.3.2
Add arguments to make_zim_file and relax dependencies constraints
2 parents b479038 + d18275c commit 5f126ab

File tree

4 files changed

+30
-14
lines changed

4 files changed

+30
-14
lines changed

.pre-commit-config.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ repos:
77
- id: trailing-whitespace
88
- id: end-of-file-fixer
99
- repo: https://github.com/psf/black
10-
rev: "24.1.1"
10+
rev: "24.3.0"
1111
hooks:
1212
- id: black
1313
- repo: https://github.com/astral-sh/ruff-pre-commit
14-
rev: v0.2.1
14+
rev: v0.3.3
1515
hooks:
1616
- id: ruff
1717
- repo: https://github.com/RobertCraigie/pyright-python
18-
rev: v1.1.350
18+
rev: v1.1.354
1919
hooks:
2020
- id: pyright
2121
name: pyright (system)

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Add support for `disable_metadata_checks` and `ignore_duplicates` arguments in `make_zim_file` function ("zimwritefs-mode")
13+
14+
### Changed
15+
16+
- Relaxed constraints on Python dependencies
17+
- Upgraded optional dependencies used for test and QA
18+
1019
## [3.3.1] - 2024-02-27
1120

1221
### Added

pyproject.toml

+10-10
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ dependencies = [
1515
"Babel>=2.9,<3.0",
1616
"python-magic>=0.4.3,<0.5",
1717
"libzim>=3.4.0,<4.0",
18-
"beautifulsoup4>=4.9.3,<4.10", # upgrade to 4.10 and later to be done
19-
"lxml>=4.6.3,<4.10", # upgrade to 4.10 and later to be done
20-
"optimize-images>=1.3.6,<1.6",
18+
"beautifulsoup4>=4.9.3,<5.0",
19+
"lxml>=4.6.3,<6.0",
20+
"optimize-images>=1.3.6,<2.0",
2121
# youtube-dl should be updated as frequently as possible
2222
"yt-dlp"
2323
]
@@ -36,20 +36,20 @@ scripts = [
3636
"invoke==2.2.0",
3737
]
3838
lint = [
39-
"black==24.1.1",
40-
"ruff==0.2.1",
39+
"black==24.3.0",
40+
"ruff==0.3.3",
4141
]
4242
check = [
43-
"pyright==1.1.350",
43+
"pyright==1.1.354",
4444
]
4545
test = [
46-
"pytest==8.0.0",
46+
"pytest==8.1.1",
4747
"pytest-mock==3.12.0",
48-
"coverage==7.4.1",
48+
"coverage==7.4.4",
4949
]
5050
dev = [
51-
"pre-commit==3.5.0",
52-
"debugpy==1.8.0",
51+
"pre-commit==3.6.2",
52+
"debugpy==1.8.1",
5353
"zimscraperlib[scripts]",
5454
"zimscraperlib[lint]",
5555
"zimscraperlib[test]",

src/zimscraperlib/zim/filesystem.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ def make_zim_file(
135135
redirects_file: pathlib.Path = None, # noqa: RUF013 # pyright: ignore
136136
rewrite_links: bool = True, # noqa: FBT001, FBT002, ARG001
137137
workaround_nocancel: bool = True, # noqa: FBT001, FBT002
138+
ignore_duplicates: bool = True, # noqa: FBT001, FBT002
139+
disable_metadata_checks: bool = False, # noqa: FBT001, FBT002
138140
):
139141
"""Creates a zimwriterfs-like ZIM file at {fpath} from {build_dir}
140142
@@ -157,7 +159,12 @@ def make_zim_file(
157159
with open(illustration_path, "rb") as fh:
158160
illustration_data = fh.read()
159161

160-
zim_file = Creator(filename=fpath, main_path=main_page).config_metadata(
162+
zim_file = Creator(
163+
filename=fpath,
164+
main_path=main_page,
165+
ignore_duplicates=ignore_duplicates,
166+
disable_metadata_checks=disable_metadata_checks,
167+
).config_metadata(
161168
**{
162169
k: v
163170
for k, v in {

0 commit comments

Comments
 (0)