fix(deps): add Pygments to requirements.txt (rich.syntax dep)#9819
Conversation
`lib/tools/patching.py` imports `from rich.syntax import Syntax`. The
`rich` package already in requirements.txt does not pull `pygments` as a
hard dep — it is an extras_require for syntax highlighting. On a fresh
host where `requirements.txt` is the only source of pip installs, the
build fails:
Traceback (most recent call last):
File "/armbian/lib/tools/patching.py", line 444, in <module>
from rich.syntax import Syntax
File ".../rich/syntax.py", line 24, in <module>
from pygments.lexer import Lexer
ModuleNotFoundError: No module named 'pygments'
Pin Pygments == 2.19.1 so dependabot can keep it current alongside rich.
Assisted-by: Claude:claude-opus-4.7
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds a single pinned dependency on Pygments version 2.19.1 to requirements.txt, explicitly marking it as required by the rich.syntax module for syntax highlighting functionality. ChangesDependencies
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
✅ This PR has been reviewed and approved — all set for merge! |
lib/tools/patching.py:444importsfrom rich.syntax import Syntax. Therichpackage pinned inrequirements.txthaspygments<3.0.0,>=2.13.0listed in its PyPIrequires_dist, yet on a fresh host the install resolved torichwithout pulling Pygments (possibly an interaction with the pinnedpip == 26.1.1resolver or a cached pip-hash short-circuit). The build fails with:Reproduced on a fresh Hetzner CAX21 (Ubuntu Noble 6.8) with:
Fail surface is the u-boot patching phase (
uboot_main_patching_python); any code path that importsrich.syntaxis affected.Pinning
Pygments == 2.19.1explicitly inrequirements.txtis a defensive fix — dependabot will keep it current alongsiderich.Assisted-by: Claude:claude-opus-4.7
Summary by CodeRabbit