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

improvement: allow more package installation rules in the pkg management UI #2448

Merged
merged 1 commit into from
Sep 30, 2024

Conversation

mscolnick
Copy link
Contributor

@mscolnick mscolnick commented Sep 29, 2024

Allow fancier package installation rules like editable (-e) or @

Copy link

vercel bot commented Sep 29, 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 Sep 29, 2024 3:50pm
marimo-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 29, 2024 3:50pm

@anthonywu
Copy link

anthonywu commented Sep 30, 2024

observation about default pyproject+uv+marimo behavior in combination:

if I have script metadata:

# /// script
# requires-python = ">=3.11"
# dependencies = [
#     "marimo",
#     "foo @ ~/workspace/foo",
#     "-e ~/workspace/bar",
# ]
# ///

and I run it in sandbox mode, the ~ path is assumed to be a relative to PWD, and the whole path is expected to be file:/// scheme

Running in a sandbox: uv run --isolated --no-project --with-requirements /var/folders/53/vkqj14gn2wsc1xp5dbx1wszh0000gn/T/tmp6xxqh9my.txt marimo run /tmp/local_editable_demo.py
  × Invalid `--with` requirement
  ╰─▶ Distribution not found at: file:///Users/anthonywu/workspace/marimo/~/workspace/bar

and if I give a full abs path, that's where the tool error is raised (in terminal log output, after browser frontend is launched)

error: TOML parse error at line 2, column 16
  |
2 | dependencies = [
  |                ^
Expected package name starting with an alphanumeric character, found `-`
-e /Users/anthonywu/workspace/mflux
^

error: TOML parse error at line 2, column 16
  |
2 | dependencies = [
  |                ^
Expected package name starting with an alphanumeric character, found `-`
-e /Users/anthonywu/workspace/mflux
^

@mscolnick
Copy link
Contributor Author

mscolnick commented Sep 30, 2024

@anthonywu, i can reproduce the first issue: ~ does not get expanded. i wonder if this can be handled by uv upstream. because even if we support expanding this, this would break if you didn't go through marimo, e.g. python notebook.py or uv run notebook.py. thoughts?

for the second issue: I was able to reproduce this as well, by just doing uv run notebook.py.

i think these would be better feature requests on the uv library, otherwise we wouldn't be able to provide parity when running this as a script.

@mscolnick mscolnick merged commit 93620f2 into main Sep 30, 2024
35 checks passed
@mscolnick mscolnick deleted the ms/smart-split-packages branch September 30, 2024 02:30
Copy link

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

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