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

Guide "Using uv with marimo" #3075

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from
Draft

Conversation

kolibril13
Copy link

📝 Summary

This is a draft pull request intended for testing the online documentation build and is
not yet ready for review.

🔍 Description of Changes

Adding a guide "Using uv with marimo".

📋 Checklist

  • 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).

📜 Reviewers

Copy link

vercel bot commented Dec 6, 2024

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 Dec 7, 2024 8:30pm
marimo-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 7, 2024 8:30pm

Copy link

github-actions bot commented Dec 6, 2024


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


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


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@kolibril13
Copy link
Author

kolibril13 commented Dec 6, 2024

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

recheck

@@ -0,0 +1,260 @@

# Running Marimo with `uv`
Copy link
Contributor

Choose a reason for hiding this comment

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

marimo is lowercase everywhere as a library

You can run a Marimo notebook using the package manager `uv` through one of the following methods:

1. **Within a project environment**
2. **Temporary installation (cached)**
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe a "ephemeral virtual enviroment"

Copy link
Author

Choose a reason for hiding this comment

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

I agree,
Temporary installation (cached) is not the best choice.

I think "Ephemeral" is not widely recognized, especially by non-native English speakers.
How about:
Short-Lived Environment

But I would also love to find a better word for
"self-contained scripts that run with temporary enviornments"


<div align="center">
<figure>
<img src="/_static/image.png" width="650px"/>
Copy link
Contributor

Choose a reason for hiding this comment

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

can we rename these images to be more descriptive


```


Copy link
Contributor

Choose a reason for hiding this comment

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

not sure what IDE you are using, but most of markdown plugins that will autoformat your markdown. it would be useful to install to avoid PR comments about it

Copy link
Author

Choose a reason for hiding this comment

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

Good point! I use the "Prettier" Markdown formatter and will re-format the code.

For instance, you can run:

```bash
uv tool run marimo edit hi.py
Copy link
Contributor

Choose a reason for hiding this comment

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

we should just always suggest using --sandbox when using uv tool run, otherwise they lose their package metadata

Copy link
Author

Choose a reason for hiding this comment

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

Good point! Maybe --sandbox can even become be the default when using uv tool run?


```bash
uv tool run marimo edit hi.py
```
Copy link
Contributor

Choose a reason for hiding this comment

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

you can delete this part, its not too informational / adds confusion

Marimo detects the embedded dependencies in sandbox mode, so you can also use:

```bash
uv tool run marimo edit hi.py
```
```

```bash
Run in a sandboxed venv containing this notebook's dependencies?
[Y/n]
```
Copy link
Contributor

Choose a reason for hiding this comment

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

same as here, we don't need to explain this


---

### Simplifying with `uvx`
Copy link
Contributor

Choose a reason for hiding this comment

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

this doc should be a tool about using uv with marimo and less about a uv's features/alias.

i would:

  1. link a doc to uv whenever you get in the weed about it
  2. choose uv tool run or uvx in the docs, and don't repeat the same instructions for both.

this could be simply, Using uvx(an alias foruv tool run), you can..

Copy link
Author

Choose a reason for hiding this comment

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

good point!
This also raises the question of who the intended audience for this article is: people already familiar with uv, or those using it for the first time?

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.

2 participants