Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow marimo configuration in notebook.py as script metadata (per PEP 723) #3794

Merged
merged 2 commits into from
Feb 14, 2025

Conversation

mscolnick
Copy link
Contributor

@mscolnick mscolnick commented Feb 14, 2025

Fixes #2885
Fixes #2774

This adds inline script metadata (PEP 723) support for marimo configuration, similar to our pyproject.toml config.

e.g. can add:

# /// script
# [tool.marimo.runtime]
# auto_instantiate = false
# on_cell_change = "lazy"
# ///

to the top of the script to add per-notebook configuration. the precedence is

Script config > pyproject.toml config > user config

Copy link

vercel bot commented Feb 14, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
marimo-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 14, 2025 2:17am
marimo-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 14, 2025 2:17am

Copy link
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.

This is awesome!

Thoughts on adding

# /// script
# [tool.marimo.runtime]
# auto_instantiate = false
# ///

to notebooks created with marimo convert in a future PR? Since Jupyter notebooks aren't written with automatic execution in mind.

@mscolnick mscolnick merged commit 73732d2 into main Feb 14, 2025
27 of 34 checks passed
@mscolnick mscolnick deleted the ms/config-in-script branch February 14, 2025 12:59
Copy link

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

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.

Add app-level configuration for autorun on startup Cell Output Location as Notebook property?
2 participants