Make xhtml2pdf and python-bidi optional dependencies#2471
Open
Make xhtml2pdf and python-bidi optional dependencies#2471
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
python-bidi0.6.x requires Rust/maturin to build from source, breakingpip install maigreton platforms without a Rust toolchain (e.g., Termux on Android).python-bidiis not imported anywhere in maigret — it's only a transitive dependency ofxhtml2pdf, used solely for optional PDF report generation (--pdfflag).Changes
pyproject.toml: Movedxhtml2pdfto an optional extra; removedpython-bidi,PyPDF2,arabic-reshaper,reportlabfrom required deps (all only needed transitively for PDF)maigret/report.py: GracefulImportErrorinsave_pdf_report()with actionable install messageopensuse.txt,docs/source/installation.rst: Updated to reflect optional PDF depsInstall behavior