Skip to content

chore(python): back the package with the Rust engine and release 0.7.0 - #191

Merged
shps951023 merged 1 commit into
mainfrom
chore/python-0.7.0
Sep 19, 2026
Merged

shps951023 merged 1 commit into
mainfrom
chore/python-0.7.0

Conversation

@shps951023

@shps951023 shps951023 commented Sep 19, 2026 •

Copy link
Copy Markdown
Member

Summary

The Python package now renders through the Rust MiniPdf engine instead of the pure Python renderers, and its version follows the Rust core at 0.7.0.

Changes

  • Add a PyO3 binding crate at \minipdf-python/native/\ exposing \minipdf._native\ (convert to PDF/path/bytes, font registration). It calls
    egister_system_fonts()\ per conversion, matching the Node.js binding.
  • Switch \minipdf-python/pyproject.toml\ to the maturin build backend (mixed layout, abi3 for Python 3.10+) so \pip install\ builds the Rust extension; pure Python renderers remain as a fallback when the extension is not importable.
  • Prefer the native engine in \�pi.py\ while keeping the existing error semantics.
  • Add \scripts/Build-Python-Native.ps1\ and wire the Python visual benchmark build step to it.
  • Update \python-ci.yml\ with a Rust toolchain step.
  • Rework \pypi-publish.yml\ to build wheels on Linux, Windows, and macOS (x64 and arm64) plus an sdist, and publish them all through trusted publishing.
  • Refresh xlsx/pptx test fixtures to real OOXML namespaces and shape/txBody structure so tests pass under both engines.
  • Bump versions to 0.7.0 (pyproject, _init_.py, native crate, version test).

Validation

  • 24 tests pass with the native extension and with the pure Python fallback; ruff and mypy pass.
  • A wheel built locally installs into a clean venv and converts a real fixture byte-identically to the Rust CLI (same SHA-256).
  • \python -m build\ produces both sdist and abi3 wheel; twine check passes.

Summary by CodeRabbit

  • New Features

    • Python conversions now use the Rust-backed engine when available, improving native performance and consistency.
    • Added native support for PDF conversion, custom font registration, and retrieving registered fonts.
    • Packages can build the native engine automatically during installation across supported platforms.
    • Pure Python rendering remains available as a reduced-feature fallback.
  • Bug Fixes

    • Unsupported input formats now raise a clear error instead of failing silently.
  • Documentation

    • Updated Python package documentation to explain native engine usage and setup.
  • Chores

    • Updated the Python package version to 0.7.0.

@coderabbitai

coderabbitai Bot commented Sep 19, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: c65222ba-d9b1-4c7c-8d52-13a684c9164d

📥 Commits

Reviewing files that changed from the base of the PR and between 3787e20 and 91cf716.

⛔ Files ignored due to path filters (1)
  • minipdf-python/native/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (15)
  • .github/workflows/pypi-publish.yml
  • .github/workflows/python-ci.yml
  • .gitignore
  • FEATURE_PARITY.md
  • minipdf-python/README.md
  • minipdf-python/native/Cargo.toml
  • minipdf-python/native/src/lib.rs
  • minipdf-python/pyproject.toml
  • minipdf-python/src/minipdf/__init__.py
  • minipdf-python/src/minipdf/_native.pyi
  • minipdf-python/src/minipdf/api.py
  • minipdf-python/tests/helpers.py
  • minipdf-python/tests/test_api.py
  • scripts/Build-Python-Native.ps1
  • scripts/Invoke-LanguageVisualBenchmark.ps1
 __________________________________________
< The GIL can't stop these rabbit threads. >
 ------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@shps951023
shps951023 merged commit 7b67020 into main Sep 19, 2026
8 of 9 checks passed
@shps951023
shps951023 deleted the chore/python-0.7.0 branch September 20, 2026 10:23
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