marimo icon indicating copy to clipboard operation
marimo copied to clipboard

Support shells on windows (with extensions)

Open hwine opened this issue 11 months ago • 3 comments

📝 Summary

Fixes #3445

🔍 Description of Changes

Even though the value of $SHELL is just "bash" at the command line, it is the full path to the executable in the program. (i.e. 'c:\foo\bar\bash.exe'). The "name" attribute returns "bash.exe" in that case, which doesn't match "bash". Fortunately, pathlib.Path also offers a "stem" attribute which strips the extension. \o/

📋 Checklist

  • [x] I have read the contributor guidelines.
  • [ ] 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).
  • [ ] I have added tests for the changes made.
  • [ ] I have run the code and verified that it works as expected.

📜 Reviewers

@akshayka OR @mscolnick

hwine avatar Jan 16 '25 05:01 hwine

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 Jan 17, 2025 4:07pm
marimo-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 17, 2025 4:07pm

vercel[bot] avatar Jan 16 '25 05:01 vercel[bot]

Someone is attempting to deploy a commit to the marimo Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Jan 16 '25 05:01 vercel[bot]

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

github-actions[bot] avatar Jan 16 '25 05:01 github-actions[bot]

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

hwine avatar Jan 16 '25 23:01 hwine

@hwine, are you still doing work on this (In draft), or ready to be merged?

if we wanted to update the status code to be exit(1), I am sure the test test_shell_completion would pass or we can update it to correctly test it

mscolnick avatar Jan 17 '25 00:01 mscolnick

Still draft -- I'm updating the tests, will have one more commit with that. (And there's a cleaner way than exit(1) 😉 )

This PR won't change the return code behavior, as I haven't examined all the cli.py code yet.

hwine avatar Jan 17 '25 00:01 hwine

Hmm. I'll have to read up a bit to avoid the macOS test failure. I know there's a way to skip for a platform, but I've not used that in parametrization before. 😞

hwine avatar Jan 17 '25 02:01 hwine

@hwine, it looks like its returning fish, but with an unexpected path. possibly we need a different stemming util

Screenshot 2025-01-17 at 10 47 50 AM

mscolnick avatar Jan 17 '25 15:01 mscolnick

@hwine, it looks like its returning fish, but with an unexpected path. possibly we need a different stemming util

I believe (and my latest commit will confirm) that the issue was expecting non-windows platforms to handle windows strings. In reality, that would never happen, so it's "safe" to skip the test on other platforms.

When I dug deeper into the logs, I found the same test failing on ubuntu as well.

hwine avatar Jan 17 '25 16:01 hwine

Got it, sounds good. CI is running now. I'll merge once it passes

Thanks so much!

mscolnick avatar Jan 17 '25 16:01 mscolnick

PEBKAC: I found the correct run and it passes (or is skipped appropriately) on all tested platforms.

original incorrect analysis

@mscolnick huh - I'm confused -- I don't see any of my tests failing on macos, but I can't find successes, either!

I would expect to find it reported just below this line. But I'm also not clear on your tests (many omit test_cli*).

Any suggestions on forcing the tests to run? Or are they reported somewhere else?

hwine avatar Jan 17 '25 17:01 hwine

@hwine , yep, all looks good. just some flakey tests (which i am fixing now)

mscolnick avatar Jan 17 '25 20:01 mscolnick

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

github-actions[bot] avatar Jan 17 '25 20:01 github-actions[bot]