Invalidate uv.lock if registry sources are removed (#6026)

## 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 https://github.com/astral-sh/uv/issues/5920.
This commit is contained in:
Charlie Marsh 2024-08-13 19:42:04 -04:00 committed by GitHub
parent 34ac8cb53f
commit 1bbb05dca7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 220 additions and 29 deletions

View file

@ -76,7 +76,7 @@ fn {{module_name}}() -> Result<()> {
.lock()
.env_remove("UV_EXCLUDE_NEWER")
.arg("--index-url")
.arg("https://astral-sh.github.io/packse/0.3.31/simple-html/")
.arg(packse_index_url())
.assert()
.success();
let lock2 = fs_err::read_to_string(context.temp_dir.join("uv.lock"))?;