Get help from the marimo community

Updated 4 weeks ago

How to try a pre-release/development version locally with sandbox?

From the logs that flash by as marimo starts in sandbox mode, it seems it installs the version of the marimo package from pypi that corresponds to the running version's version. This works fine with official releases, but makes it hard to test development branches, since they still have the prior version number, so the running notebook won't reflect the changes

I tried installing the dev branch of marimo that I wanted to try from within the notebook itself, but that didn't work either:
g
M
11 comments
i dont think there is a great way to do this. i've commeneted out this in the code to test this. you can kinda trick the code path with MARIMO_MANAGE_SCRIPT_METADATA=true marimo edit, but that wont actually create the sandbox for you (just think you are in one).
i have this code:

Plain Text
    marimo_deps = [d for d in dependencies if _is_marimo_dependency(d)]
    if not marimo_deps:
        # During development, you can comment this out to install an
        # editable version of marimo assuming you are in the marimo directory
        # DO NOT COMMIT THIS WHEN SUBMITTING PRs
        # return dependencies + [f"marimo -e ."]

        return dependencies + [f"marimo=={marimo_version}"]
if there is a way to check if you are running from an editable install, that would help. or we could expose an environment variable
thanks for the follow-up! looks like this is exposed by importlib metadata
it's a little roundabout for now:

Plain Text
import json
from importlib.metadata import Distribution

direct_url = Distribution.from_name("pkg-name").read_text("direct_url.json")
pkg_is_editable = json.loads(direct_url).get("dir_info", {}).get("editable", False) 
apparently with python 3.13 you can just directly access distribution.origin
ah very cool, let me try it out
awesome! thanks!
Add a reply
Sign up and join the conversation on Discord