Skip to content

fix argument splitting on '--' in the command line#9368

Open
colobas wants to merge 3 commits intomarimo-team:mainfrom
colobas:main
Open

fix argument splitting on '--' in the command line#9368
colobas wants to merge 3 commits intomarimo-team:mainfrom
colobas:main

Conversation

@colobas
Copy link
Copy Markdown

@colobas colobas commented Apr 24, 2026

📝 Summary

Fixes argument splitting in marimo run when notebook args are passed after --.

Problem

click consumes the -- separator, so _split_run_paths_and_args() does not see it.
As a result, trailing args may be interpreted as additional notebook paths (NAME) and trigger errors like: Invalid NAME - ... is not a Python or Markdown file.

Changes

  • Added a failing test commit showing that _split_run_paths_and_args() does not receive -- from CLI parsing.
  • Added a fix to restore -- sentinel semantics using raw sys.argv in run() before splitting.
  • Added/updated tests covering these forms after --:
    • key=value
    • --key value
    • --key
    • -key value

Validation

  • First commit adds the failing tests that show the behavior.
  • Second commit makes tests pass.

📋 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.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 24, 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 24, 2026 11:22pm

Request Review

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 24, 2026

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

@colobas
Copy link
Copy Markdown
Author

colobas commented Apr 24, 2026

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

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

Architecture diagram
sequenceDiagram
    participant User as CLI / Shell
    participant Click as Click Framework
    participant CLI as marimo.run()
    participant Sys as sys.argv (Raw)
    participant Splitter as _split_run_paths_and_args()

    User->>Click: marimo run notebook.py -- arg=1
    Note over Click: Click strips '--' from arguments
    Click->>CLI: run(name="notebook.py", args=("arg=1",))
    
    CLI->>Sys: Access raw process arguments
    Sys-->>CLI: ["marimo", "run", "notebook.py", "--", "arg=1"]
    
    alt NEW: Re-inject double dash sentinel
        CLI->>CLI: Detect "--" in raw argv but missing in Click args
        CLI->>CLI: Reconstruct args as ("--", "arg=1")
    end

    CLI->>Splitter: CHANGED: pass args with preserved sentinel
    
    Note over Splitter: Logic identifies items after "--" <br/>as notebook params, not file paths
    
    Splitter-->>CLI: return (paths, notebook_args)
    
    CLI->>CLI: Continue execution with correct paths
Loading

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

4 issues found across 1 file (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="pyproject.toml">

<violation number="1" location="pyproject.toml:6">
P0: Package renamed from `marimo` to `marimo-colobas` — this is a fork-specific change that must not be merged. It would break the package identity, PyPI publishing, and all existing installations.</violation>

<violation number="2" location="pyproject.toml:7">
P1: Version changed to `0.23.2.post1` — this fork-specific version bump should be reverted to avoid interfering with the project's release process.</violation>

<violation number="3" location="pyproject.toml:101">
P0: Optional dependency self-references renamed to `marimo-colobas[...]` — these must remain `marimo[...]` to match the actual package name.</violation>

<violation number="4" location="pyproject.toml:603">
P0: Pixi dev dependency renamed to `marimo-colobas` — revert to `marimo` to keep the local development workflow intact.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.

Comment thread pyproject.toml Outdated

[tool.pixi.pypi-dependencies]
marimo = {path = ".", editable = true}
marimo-colobas = {path = ".", editable = true}
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Apr 24, 2026

Choose a reason for hiding this comment

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

P0: Pixi dev dependency renamed to marimo-colobas — revert to marimo to keep the local development workflow intact.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At pyproject.toml, line 603:

<comment>Pixi dev dependency renamed to `marimo-colobas` — revert to `marimo` to keep the local development workflow intact.</comment>

<file context>
@@ -600,4 +600,4 @@ python = "3.12.*"
 
 [tool.pixi.pypi-dependencies]
-marimo = {path = ".", editable = true}
+marimo-colobas = {path = ".", editable = true}
</file context>
Suggested change
marimo-colobas = {path = ".", editable = true}
marimo = {path = ".", editable = true}
Fix with Cubic

Comment thread pyproject.toml Outdated
recommended = [
"marimo[sql]",
"marimo[sandbox]", # For `marimo edit --sandbox DIRECTORY`
"marimo-colobas[sql]",
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Apr 24, 2026

Choose a reason for hiding this comment

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

P0: Optional dependency self-references renamed to marimo-colobas[...] — these must remain marimo[...] to match the actual package name.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At pyproject.toml, line 101:

<comment>Optional dependency self-references renamed to `marimo-colobas[...]` — these must remain `marimo[...]` to match the actual package name.</comment>

<file context>
@@ -98,8 +98,8 @@ sandbox = [
 recommended = [
-    "marimo[sql]",
-    "marimo[sandbox]",                  # For `marimo edit --sandbox DIRECTORY`
+    "marimo-colobas[sql]",
+    "marimo-colobas[sandbox]",                  # For `marimo edit --sandbox DIRECTORY`
     "altair>=5.4.0",                    # Plotting in datasource viewer
</file context>
Suggested change
"marimo-colobas[sql]",
"marimo[sql]",
Fix with Cubic

Comment thread pyproject.toml Outdated
[project]
name = "marimo"
version = "0.23.2"
name = "marimo-colobas"
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Apr 24, 2026

Choose a reason for hiding this comment

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

P0: Package renamed from marimo to marimo-colobas — this is a fork-specific change that must not be merged. It would break the package identity, PyPI publishing, and all existing installations.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At pyproject.toml, line 6:

<comment>Package renamed from `marimo` to `marimo-colobas` — this is a fork-specific change that must not be merged. It would break the package identity, PyPI publishing, and all existing installations.</comment>

<file context>
@@ -3,8 +3,8 @@ requires = ["uv_build>=0.8.3,<0.12.0"]
 [project]
-name = "marimo"
-version = "0.23.2"
+name = "marimo-colobas"
+version = "0.23.2.post1"
 description = "A library for making reactive notebooks and apps"
</file context>
Suggested change
name = "marimo-colobas"
name = "marimo"
Fix with Cubic

Comment thread pyproject.toml Outdated
name = "marimo"
version = "0.23.2"
name = "marimo-colobas"
version = "0.23.2.post1"
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot Apr 24, 2026

Choose a reason for hiding this comment

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

P1: Version changed to 0.23.2.post1 — this fork-specific version bump should be reverted to avoid interfering with the project's release process.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At pyproject.toml, line 7:

<comment>Version changed to `0.23.2.post1` — this fork-specific version bump should be reverted to avoid interfering with the project's release process.</comment>

<file context>
@@ -3,8 +3,8 @@ requires = ["uv_build>=0.8.3,<0.12.0"]
-name = "marimo"
-version = "0.23.2"
+name = "marimo-colobas"
+version = "0.23.2.post1"
 description = "A library for making reactive notebooks and apps"
 # We try to keep dependencies to a minimum, to avoid conflicts with
</file context>
Suggested change
version = "0.23.2.post1"
version = "0.23.2"
Fix with Cubic

@colobas
Copy link
Copy Markdown
Author

colobas commented Apr 25, 2026

sorry I overwrote the PR branch by mistake because I needed a wheel. I've reverted it back to the original PR state. Apologies

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.

1 participant