Update pygments version constraint in pyproject.toml#8921
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
|
@tschm it looks like the new min version is failing CI |
|
Interesting problem. Seems some red herring to me. |
|
⏺ Good, patch-1 is correctly on >=2.20. Here's the picture: Pygments-related failures (AttributeError, snapshot diff) — these are pre-existing failures in the upstream main repo's CI because main still has >=2.19. Your PR fixes all of them. Serializer failures — these pass locally on both main and patch-1 (Python 3.13). They're likely flaky in CI due to environment differences (Python 3.10 + specific dependency versions in the upstream runner). They're not caused by your PR and are pre-existing Your pygments>=2.20 change is the right fix for the CI failures that are actually pygments-related. ✻ Cogitated for 42s ❯ can you test locally with 3.10 ⏺ Bash(uv run --group test --python 3.10 pytest tests/_session/notebook/test_serializer.py::TestMarkdownNotebookSerializer::test_deserialize_basic tests/_session/noteb…) ⏺ All 4 serializer tests pass on Python 3.10 locally too. Those failures in CI are likely due to a different reason — possibly the specific dependency versions that were installed in that CI run, or a test ordering issue. They're not reproducible and not related to |
|
fix: resolve Markdown rendering regression and bump pygments minimum version This PR addresses two issues affecting Markdown rendering in marimo/_output/md.py.
The regex used to detect fenced code blocks was greedy and didn't use a backreference for the closing fence, causing it to incorrectly consume adjacent fenced blocks. This was fixed by:
markdown.markdown() can return None in certain edge cases (observed with pygments 2.19). A null-check was added before calling .strip() to prevent AttributeError.
pygments 2.19 has a bug in HtmlFormatter.init where options.get('filename', '') returns None, causing AttributeError: 'NoneType' object has no attribute 'replace'. This broke syntax highlighting in several tutorials and docstring rendering. Bumping to >=2.20 |
- Bump pygments minimum version to 2.20 to avoid a bug in 2.19 where HtmlFormatter raises AttributeError when filename option is None - Fix PyconDetectorPreprocessor fence regex to use a backreference so the closing fence matches the opening marker, preventing greedy over-consumption of adjacent fenced blocks - Support both backtick and tilde fence styles in the detector - Raise preprocessor priority (30 → 175) to run before pymdownx - Guard against None return from markdown.markdown() Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…patibility Versions 10.15–10.21 pass filename=None to pygments HtmlFormatter, which crashes in pygments 2.20 where html.escape() is applied to the filename. 10.21.2 is the first release that resolves this incompatibility. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
All passing. The root cause was clear once reproduced locally: Problem: pymdownx-extensions 10.15 through 10.21 are incompatible with pygments>=2.20. Only 10.21.2 fixed the filename=None bug that causes AttributeError: 'NoneType' object has no attribute 'replace' in pygments.formatters.html.HtmlFormatter. As a side-effect of
|
|
🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.22.1-dev8 |
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: Myles Scolnick <myles@marimo.io>
pip-audit raised issues with pygments 2.19. pygments has been updated yesterday