manzt / juv

Reproducible Jupyter notebooks, powered by uv.
MIT License
80 stars 2 forks source link

Adding dependencies without the version numbers causes parsing error #4

Closed alonsosilvaallende closed 1 month ago

alonsosilvaallende commented 1 month ago

Adding dependencies without the version numbers causes parsing error To reproduce: uvx juv init uvx juv add Untitled.ipynb numpy pandas uvx juv lab Untitled.ipynb

error: Failed to parse: numpy,pandas Caused by: Expected one of @, (, <, =, >, ~, !, ;, found , numpy,pandas ^

manzt commented 1 month ago

Adding packages without versions should work just fine. It appears you accidentally added a comma and ran:

uvx juv add numpy,pandas

Not the command you shared. Packages should be separated by a space. It's consistent with uv add --script foo.py numpy pandas.

alonsosilvaallende commented 1 month ago

I don't think so. I redid it again with space (not comma) and it gives the same error. Screenshot 2024-10-21 142745

manzt commented 1 month ago

Can you make sure "Untitled.ipynb" is removed first? juv init doesn't override Untitled.ipynb but creates a new notebook (eg Unititled1.ipynb).

My guess is that you originally ran with the comma (adding a dependeny named "numpy,pandas"), and now are appending dependencies to that original Untitled.ipynb with the mistake.

alonsosilvaallende commented 1 month ago

Same error. Screenshot 2024-10-21 144039

manzt commented 1 month ago

hmm, let me try to reproduce.

alonsosilvaallende commented 1 month ago

I updated uv and now it works. No idea what was the problem. Sorry.

manzt commented 1 month ago

All good! This issue convinced me we should have a info subcommand (added in v0.1.5), which will print the juv and uv versions and hopefully will be easier for debugging in the future.

❯ uvx juv@latest info
juv 0.1.5
uv 0.4.24 (b9cd54913 2024-10-17)