Skip to content

Support only Python 3.15, with libzim 4 - #374

Draft
benoit74 wants to merge 1 commit into
mainfrom
benoit74/python-3.15
Draft

benoit74 wants to merge 1 commit into
mainfrom
benoit74/python-3.15

Conversation

@benoit74

@benoit74 benoit74 commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Support only Python 3.15, which requires libzim 4: this is a breaking change, for zimscraperlib 6.0.0.

Draft until tree-sitter publishes Python 3.15 wheels (tree-sitter/py-tree-sitter#504): tree-sitter 0.26.0 has no 3.15 nor abi3 wheel, so on 3.15 pip builds it from source, which needs a C compiler (fine on CI runners, not on slim scraper Docker images).

Changes:

  • requires-python = ">=3.15,<3.16", ruff py315, pyright 3.15
  • version bumped to 6.0.0-dev0 (__about__.py and javascript/package.json)
  • require libzim 4 (libzim 3 does not support 3.15) and hatch-openzim 0.4
  • adapt to libzim 4 API, which reaches our Creator since it subclasses libzim's: camelCase arguments renamed (config_nbworkers(nb_workers=), set_mainpath(main_path=), add_redirection(target_path=), add_alias(target_path=)), new add_illustration(content, width, height=None, scale=1.0) signature, renamed Search / SuggestionSearch methods, Archive.get_entry_by_id now provided by libzim
  • breaking: Archive.get_search_results yields libzim 4 SearchResult objects (path, title, snippet, archive) instead of paths
  • depend on pymupdf-lite instead of pymupdf (same change as Depend on pymupdf-lite instead of pymupdf #373, see Use pymupdf-lite: pymupdf 2.0 pulls heavy dependencies (onnxruntime, numpy, ...) #372): pymupdf 2.0 pulls onnxruntime, numpy and more, and onnxruntime has no 3.15 wheel (pip was silently falling back to pymupdf 1.28.2); pymupdf-lite has 3.15 abi3 wheels and no dependency
  • Read the Docs has no Python 3.15 yet: use the 3.14 it provides to install uv, which installs Python 3.15 for hatch to build the docs with
  • scoped pyright: ignore on tree_sitter.Parser.parse(), whose stub uses collections.abc.ByteString, gone from typeshed since 3.14

Will need a rebase on #373 once merged (both switch to pymupdf-lite and touch the changelog).

@benoit74 benoit74 added this to the 6.0.0 milestone Oct 29, 2026
@codecov

codecov Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (69713b3) to head (9dbf6f6).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #374   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           42        42           
  Lines         2868      2865    -3     
  Branches       432       432           
=========================================
- Hits          2868      2865    -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

- require libzim 4, the first version supporting Python 3.15, and
  hatch-openzim 0.4
- adapt to libzim 4 API: renamed search methods, get_entry_by_id now in
  libzim, add_illustration(content, width, height) signature,
  add_alias(target_path=)
- Archive.get_search_results yields libzim 4 SearchResult objects
- depend on pymupdf-lite instead of pymupdf, whose 2.0 pulls heavy
  dependencies (#372)
- build docs on Read the Docs with a uv-installed Python 3.15
- bump version to 6.0.0-dev0
@benoit74
benoit74 force-pushed the benoit74/python-3.15 branch from 33032b9 to 9dbf6f6 Compare October 29, 2026 13:51
@benoit74 benoit74 mentioned this pull request Oct 30, 2026
18 tasks done

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant