Skip to content

bump pymdown-extensions to fix NoneType bug#9319

Merged
Light2Dark merged 2 commits into
mainfrom
sham/fix-pymdown-error
Apr 22, 2026
Merged

bump pymdown-extensions to fix NoneType bug#9319
Light2Dark merged 2 commits into
mainfrom
sham/fix-pymdown-error

Conversation

@Light2Dark
Copy link
Copy Markdown
Collaborator

@Light2Dark Light2Dark commented Apr 22, 2026

📝 Summary

Closes #9316

mo.doc(mo.hstack) (and any other @mddoc-decorated callable) crashed with AttributeError: 'NoneType' object has no attribute 'replace' when resolved against pygments>=2.20 + pymdown-extensions<10.21.2.

The root cause is upstream: pymdown-extensions <10.21.2 passes filename=None to pygments' HtmlFormatter, and pygments 2.20 stopped tolerating that. Fix released in pymdown-extensions 10.21.2, so we bump our lower bound.

📋 Pre-Review Checklist

  • For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on Discord, or the community discussions (Please provide a link if applicable).
  • Any AI generated code has been reviewed line-by-line by the human PR author, who stands by it.
  • Video or media evidence is provided for any visual changes (optional).

✅ Merge Checklist

  • I have read the contributor guidelines.
  • Documentation has been updated where applicable, including docstrings for API changes.
  • Tests have been added for the changes made.

Copilot AI review requested due to automatic review settings April 22, 2026 09:13
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Apr 22, 2026 9:49am

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR bumps the minimum supported pymdown-extensions version to avoid a pygments>=2.20 crash when rendering @mddoc-decorated callables via mo.doc, and adds a regression test to ensure the pipeline doesn’t raise.

Changes:

  • Bump pymdown-extensions lower bound to >=10.21.2 (core + docs extras).
  • Add regression tests covering doc() on common @mddoc-decorated functions and methods.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
pyproject.toml Raises the pymdown-extensions minimum version to include the upstream fix for filename=None handling with pygments>=2.20.
tests/_output/test_doc.py Adds end-to-end regression coverage ensuring doc() renders highlighted signatures without raising.

Comment thread pyproject.toml
Copy link
Copy Markdown
Contributor

@akshayka akshayka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo the copilot comment regarding snapshot test

@Light2Dark Light2Dark enabled auto-merge (squash) April 22, 2026 15:33
@Light2Dark Light2Dark merged commit e753c6a into main Apr 22, 2026
63 of 66 checks passed
@Light2Dark Light2Dark deleted the sham/fix-pymdown-error branch April 22, 2026 19:50
@github-actions
Copy link
Copy Markdown

🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.23.3-dev21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working dependencies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

In Layout tutorial: Calling mo.doc(mo.hstack) returns AttributeError: 'NoneType' object has no attribute 'replace'

4 participants