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 lock should invalidate lockfile if registries change #5920

Closed
charliermarsh opened this issue Aug 8, 2024 · 4 comments · Fixed by #6026
Closed

uv lock should invalidate lockfile if registries change #5920

charliermarsh opened this issue Aug 8, 2024 · 4 comments · Fixed by #6026
Assignees
Labels
bug Something isn't working preview Experimental behavior

Comments

@charliermarsh
Copy link
Member

If a lockfile lists a package from a registry that isn't part of the index URLs passed to uv lock, we should probably not reuse it.

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

I'm actually unsure about this. Like if you do:

uv add idna --index-url https://test.pypi.org/simple

And then uv lock later (no arguments)... should we "allow" the lockfile to use the existing entries, which reference https://test.pypi.org/simple?

@zanieb
Copy link
Member

zanieb commented Aug 9, 2024

Definitely! Seems weird to force everything to use another index URL after an add operation.

@charliermarsh
Copy link
Member Author

The only quirk is that if you don’t specify any index URL, we treat it as PyPI, so the lock would be invalidated if you “stop” passing it on the command-line for any command.

@charliermarsh
Copy link
Member Author

Actually, I think the type is rich enough that we can avoid enforcing this if no index URLs are provided (i.e., assume the lockfile is fine). It's a little strange because if we fail, we'll then resolve against PyPI. But probably fine in practice.

charliermarsh added a commit that referenced this issue Aug 13, 2024
## Summary

Now, if you resolve against a registry, then swap it out for another, we
won't reuse the lockfile. (If you don't provide any registry
configuration, then we won't enforce this, so that `uv lock --index-url
foo` and `uv lock` is stable.)

Closes #5920.
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
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants