Skip to content

Make xhtml2pdf and python-bidi optional dependencies#2471

Open
Copilot wants to merge 2 commits intomainfrom
copilot/fix-python-bidi-build-error
Open

Make xhtml2pdf and python-bidi optional dependencies#2471
Copilot wants to merge 2 commits intomainfrom
copilot/fix-python-bidi-build-error

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 7, 2026

python-bidi 0.6.x requires Rust/maturin to build from source, breaking pip install maigret on platforms without a Rust toolchain (e.g., Termux on Android). python-bidi is not imported anywhere in maigret — it's only a transitive dependency of xhtml2pdf, used solely for optional PDF report generation (--pdf flag).

Changes

  • pyproject.toml: Moved xhtml2pdf to an optional extra; removed python-bidi, PyPDF2, arabic-reshaper, reportlab from required deps (all only needed transitively for PDF)
  • maigret/report.py: Graceful ImportError in save_pdf_report() with actionable install message
  • opensuse.txt, docs/source/installation.rst: Updated to reflect optional PDF deps

Install behavior

pip install maigret          # works everywhere, no Rust needed
pip install maigret[pdf]     # adds PDF report support

Copilot AI linked an issue Apr 7, 2026 that may be closed by this pull request
@soxoj soxoj marked this pull request as ready for review April 7, 2026 23:10
python-bidi >= 0.5.0 requires Rust/maturin to build from source, which
fails on platforms like Termux (Android) that lack a Rust toolchain.

Since PDF report generation is an optional feature (--pdf flag), move
xhtml2pdf (which depends on python-bidi, arabic-reshaper, reportlab)
to an optional extras group. Users can install PDF support with:
  pip install maigret[pdf]

Also add graceful error handling in save_pdf_report() when xhtml2pdf
is not installed, with a clear message about how to install it.

Agent-Logs-Url: https://github.com/soxoj/maigret/sessions/ab19aa96-7175-47bd-af88-34b3106269e9

Co-authored-by: soxoj <31013580+soxoj@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix error failed to build 'python-bidi' during maigret installation Make xhtml2pdf and python-bidi optional dependencies Apr 7, 2026
Copilot AI requested a review from soxoj April 7, 2026 23:19
Copilot finished work on behalf of soxoj April 7, 2026 23:19
@soxoj soxoj closed this Apr 8, 2026
@soxoj soxoj reopened this Apr 26, 2026
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.

Support of Termux

2 participants