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

uv add struggles with an auto-generated entry in uv.lock #4267

Closed
hoechenberger opened this issue Jun 12, 2024 · 2 comments · Fixed by #4271
Closed

uv add struggles with an auto-generated entry in uv.lock #4267

hoechenberger opened this issue Jun 12, 2024 · 2 comments · Fixed by #4271
Assignees
Labels
bug Something isn't working preview Experimental behavior

Comments

@hoechenberger
Copy link

uv add creates a lockfile uv.lock it cannot parse again on re-run.

Steps to reproduce:

  • Check out mne-python
  • run uv add to add an entry to pyproject.toml. This will also create a uv.lock lockfile:
$ uv toolchain install 3.12
warning: `uv toolchain install` is experimental and may change without warning.
Looking for Python 3.12
Downloading cpython-3.12.3-linux-aarch64-gnu
Installed Python 3.12.3 to /home/mne-user/.local/share/uv/toolchains/cpython-3.12.3-linux-aarch64-gnu
$ uv venv -p /home/mne-user/.local/share/uv/toolchains/cpython-3.12.3-linux-aarch64-gnu/install/bin/python
$ . .venv/bin/activate
$ uv add ipython
warning: `uv add` is experimental and may change without warning.
Resolved 286 packages in 3.61s
error: found distribution vtk==9.3.0 @ registry+https://pypi.org/simple with neither wheels nor source distribution

All good so far: pyproject.toml got updated. The error message about vtk is irritating because vtk is only an "extra" dependency, but this can be ignored for now.

Ok, now let's try to uv add another package:

$ uv add cowsay 
warning: `uv add` is experimental and may change without warning.
Failed to parse lockfile; ignoring locked requirements: TOML parse error at line 492, column 10
    |
492 | marker = ""
    |          ^^
Expected marker value, found end of dependency specification

^
Resolved 287 packages in 1.18s
error: found distribution vtk==9.3.0 @ registry+https://pypi.org/simple with neither wheels nor source distribution

Looking at uv.lock, it turns out the problematic marker entry is for the numpy dependency:

[[distribution.dependencies]]
name = "numpy"
version = "1.26.4"
source = "registry+https://pypi.org/simple"
marker = ""

System info

$ uv --version 
uv 0.2.11
$ uname -a    
Linux 1a34753d5e98 6.6.26-linuxkit #1 SMP Sat Apr 27 04:13:19 UTC 2024 aarch64 GNU/Linux
@charliermarsh
Copy link
Member

Thanks!

@charliermarsh charliermarsh self-assigned this Jun 12, 2024
@charliermarsh charliermarsh added bug Something isn't working preview Experimental behavior labels Jun 12, 2024
@charliermarsh
Copy link
Member

You can reproduce this with: dependencies = ["cftime==1.6.4"].

charliermarsh added a commit that referenced this issue Jun 12, 2024
## Summary

`normalize` now takes an owned value and returns `Option<MarkerTree>`,
such that if any sub-expression evaluates to `true`, we can normalize
out the entire marker.

Closes #4267.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working preview Experimental behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants