Skip to content

Bump matplotlib pin in tutorials to avoid Path.__deepcopy__ recursion - #10702

Open
afonsojanu wants to merge 1 commit into
marimo-team:mainfrom
afonsojanu:fix/tutorial-matplotlib-pin-savefig-recursion-10680
Open

Bump matplotlib pin in tutorials to avoid Path.__deepcopy__ recursion#10702
afonsojanu wants to merge 1 commit into
marimo-team:mainfrom
afonsojanu:fix/tutorial-matplotlib-pin-savefig-recursion-10680

Conversation

@afonsojanu

Copy link
Copy Markdown

Closes #10680.

plots.py, dataflow.py, and markdown.py under marimo/_tutorials/ are pinned to matplotlib==3.10.1. That version hits an infinite recursion in Path.__deepcopy__ when _render_figure_mimebundle calls savefig(bbox_inches="tight"), which forces a full draw pass under marimo's sandboxed edit mode. The fix for that recursion landed upstream in matplotlib/matplotlib#30198, and 3.10.9 already carries it, the same version sql.py in this directory already uses without issue.

Bumping the three affected tutorials to matplotlib==3.10.9 to match.

plots.py, dataflow.py, and markdown.py were pinned to matplotlib==3.10.1,
which hits an infinite recursion in Path.__deepcopy__ during
savefig(bbox_inches="tight") under marimo's sandboxed edit mode. The fix
for that landed upstream in matplotlib/matplotlib#30198; 3.10.9 already
carries it and is already used by sql.py in this same directory.

Fixes marimo-team#10680
Copilot AI lite review requested due to automatic review settings August 29, 2026 21:18
@vercel

vercel Bot commented Aug 29, 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 Aug 29, 2026 9:19pm

Request Review

@github-actions

github-actions Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

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 the PEP 723 dependency pins for several built-in tutorials to avoid a matplotlib recursion bug triggered during figure rendering in --sandbox edit mode.

Changes:

  • Bump matplotlib pin from 3.10.1 to 3.10.9 in plots.py, dataflow.py, and markdown.py tutorial headers.
  • Align these tutorials’ matplotlib version with sql.py, which already uses 3.10.9.

Reviewed changes

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

File Description
marimo/_tutorials/plots.py Updates tutorial dependency pin to matplotlib==3.10.9 to avoid the sandbox rendering recursion.
marimo/_tutorials/markdown.py Updates tutorial dependency pin to matplotlib==3.10.9 for consistency and to avoid the recursion.
marimo/_tutorials/dataflow.py Updates tutorial dependency pin to matplotlib==3.10.9 to avoid the sandbox rendering recursion.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 3 to 8
# requires-python = ">=3.12"
# dependencies = [
# "marimo",
# "matplotlib==3.10.1",
# "matplotlib==3.10.9",
# "numpy==2.2.4",
# "polars==1.26.0",
@afonsojanu

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

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.

Plots tutorial doesn't work in --sandbox edit mode

2 participants