-
Notifications
You must be signed in to change notification settings - Fork 801
Add --force flag to marimo convert
#7199
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
cc api change codeowners: @dmadisetti @akshayka |
mscolnick
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does "marimo -y" not work? Which is used to con
| if output: | ||
| output_path = Path(output) | ||
| if prompt_to_overwrite(output_path): | ||
| if force or prompt_to_overwrite(output_path): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does "marimo -y" not work? Not sure if it's wired up but that should confirm any prompts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh. I guess I hadn't tried that, mainly because the CLI docs don't point that out. That does totally work!
Related question maybe, why does the marimo export command have a --force flag? Doesn't the marimo -y apply there too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could change this PR to a documentation PR so this is made clear there. Might be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could add a --force here as well. it is more common and natural than the marimo -y (as you just experienced yourself). im open to adding a --force as well, but want to let the api codeowners (@dmadisetti @akshayka) chime in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uv run marimo convert demo.py > out.py should also work. I don't think we need the extra flag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough.
Still worth it to turn this PR into a docs PR that mentions the -y flag? It feels hard to discover that one right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely agree. as a note, -y provides auto accept for everything
|
Made a new PR for the docs update here |
Replaces #7199. No need to add a `--force` flag, but would be nice to make the user more aware. This is a natural place to mention it. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Dylan Madisetti <[email protected]> Co-authored-by: Akshay Agrawal <[email protected]>
When dealing with sphinx builds that need marimo to convert files this force flag sure would be nice to have around.
This is the difference:
I copied how this test tests a similar feature and noticed that we don't generally expect a non-zero status code. It's because we check for non interactive shells here I think.
Either way, feels like a useful flag, hence the PR.