Skip to content

chore(deps): relax pymdown-extensions upper bound to allow 11.x#10332

Open
tschm wants to merge 1 commit into
marimo-team:mainfrom
tschm:relax-pymdown-extensions-upper-bound
Open

chore(deps): relax pymdown-extensions upper bound to allow 11.x#10332
tschm wants to merge 1 commit into
marimo-team:mainfrom
tschm:relax-pymdown-extensions-upper-bound

Conversation

@tschm

@tschm tschm commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

This pull request was authored by a coding agent.

📝 Summary

Closes #10328

pymdown-extensions was capped at <11. That cap has been there since the initial commit as a conventional major-version guard — the git history shows every subsequent change only ever moved the lower bound. With pymdown-extensions 11.x released, the cap blocks downstream projects from upgrading while keeping marimo installed:

Because marimo depends on pymdown-extensions>=10.21.2,<11 and
pymdown-extensions==11.0.0, we can conclude that marimo cannot be used.

This relaxes it to >=10.21.2,<12, matching how the rest of the markdown stack is capped (markdown<4, pygments<3).

It also replaces the stale # Pinned to specific version for introduction of codeblock handling. comment with the actual reasons for the lower bound — that comment predates the two bumps that set the current floor and no longer described it.

Compatibility with 11.x

Checked each of 11.0's changes against how marimo uses pymdownx:

11.0 change Impact on marimo
Dropped Python 3.9 None — marimo is already requires-python = ">=3.10", and pymdown-extensions 11.x declares >=3.10
Breaking: pymdownx.b64 restricts relative links to base_path by default (new restrict_path option) None in practice. marimo enables b64 only under WASM (marimo/_output/md.py), scoped to the notebook directory. Restricting to base_path matches the existing intent — the code comment there already says b64 stays off elsewhere because "app users could potentially use it to grab files they shouldn't have access to." The new default is strictly tighter, so no restrict_path override is set (which also keeps 10.x working, since the option doesn't exist there).
pymdownx.tabbed empty-title fix Not used by marimo
11.0.1 regex fixes in BetterEm/Tilde/Caret/MagicLink No API change

Every pymdownx symbol marimo imports still exists and behaves the same on 11.0.1: superfences.RE_NESTED_FENCE_START and the other superfences internals (marimo/_convert/markdown/to_ir.py, marimo/_convert/ipynb/to_ir.py), pymdownx.emoji.to_alt, and the pymdownx.blocks / pymdownx.blocks.block API that the docs marimo-embed extension is built on (docs/blocks/__init__.py).

Verification

Ran the CI test selection (pytest tests/ -k "not test_cli", ~11k tests) twice on pymdown-extensions==11.0.1 and once on 10.21.3. The results are identical — same pass count, same failure set. The failures present in all three runs are pre-existing and local to my machine (they come from a manager = "pixi" setting in my user-level ~/.config/marimo/marimo.toml leaking into tests/_code_mode/; unrelated to markdown).

The pymdownx.b64 WASM round-trip is covered by the existing test_md_with_b64_in_wasm, which actually inlines a PNG and passes on 11.0.1. I also rendered a marimo-embed block through the docs extension on 11.0.1 to confirm the docs blocks API still works.

One thing for maintainers to note

CI won't actually exercise 11.x yet. The docs group pins mkdocs-material==9.6.20, which requires pymdown-extensions~=10.2; because uv resolves all groups together, the whole-workspace resolution stays on 10.x regardless of this cap. So the 11.x verification above was done by force-installing pymdown-extensions==11.0.1 into the test environment.

#10333 lifts that pin, which lets CI resolve 11.x. The two PRs are independent and can merge in either order — this one relaxes the cap, that one lets the resolver act on it.

📋 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 — discussed in Relax pymdown-extensions upper bound to allow 11.x #10328.
  • 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 — n/a, no user-facing API change.
  • Tests have been added for the changes made — the tests/snapshots/dependencies.txt snapshot asserted by tests/test_project_dependencies.py is updated to the new constraint; no new behavior to test.

🤖 Generated with Claude Code

The `<11` cap has been in place since the initial commit as a
conventional major-version guard, not because of a known
incompatibility. Now that pymdown-extensions 11.x is out, the cap
prevents downstream projects from upgrading while keeping marimo
installed.

Relax it to `<12`, matching how the other markdown-stack dependencies
are capped (`markdown<4`, `pygments<3`).

Verified against pymdown-extensions 11.0.1:

- Nothing marimo imports from `pymdownx` changed (superfences
  `RE_NESTED_FENCE_START` and friends, `pymdownx.emoji.to_alt`, and the
  `pymdownx.blocks` API used by the docs extension).
- 11.0 drops Python 3.9, which is already below marimo's
  `requires-python = ">=3.10"`.
- 11.0's only breaking change is `pymdownx.b64` restricting relative
  links to `base_path` by default. marimo enables b64 only under WASM
  and already scopes it to the notebook directory, so the new default
  matches the existing intent.
- `tests/` (minus `test_cli`) produces an identical result on 11.0.1 and
  10.21.3.

Also replace the stale "Pinned to specific version for introduction of
codeblock handling" comment with the actual reasons for the lower bound.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 25, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Jul 25, 2026 7:20pm

Request Review

@tschm
tschm marked this pull request as ready for review July 25, 2026 19:46
@tschm
tschm requested a review from akshayka as a code owner July 25, 2026 19:46
Copilot AI review requested due to automatic review settings July 25, 2026 19:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates marimo’s runtime dependency constraints to allow pymdown-extensions 11.x, aligning the upper-bound strategy with the rest of the markdown stack while keeping the existing safety floor tied to known pygments compatibility.

Changes:

  • Relax pymdown-extensions upper bound from <11 to <12 in pyproject.toml.
  • Update the dependency snapshot to reflect the new constraint.
  • Replace the stale “pinned for codeblock handling” note with more specific lower-bound rationale.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
pyproject.toml Relaxes pymdown-extensions upper bound to <12 and clarifies why the lower bound is >=10.21.2.
tests/snapshots/dependencies.txt Updates the dependency snapshot to match the new pymdown-extensions constraint.

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.

Relax pymdown-extensions upper bound to allow 11.x

2 participants