uv
uv copied to clipboard
Add --force option to uv-publish to force upload
Summary
uv publish currently fails with the error message "error: Local file and index file do not match ... " if an attempt is made to publish a file with same name with a differing hash.
In some situation we want to be able to override this, this change adds a --force option to uv publish to by-pass this and try the upload anyway.
(discussion in https://github.com/astral-sh/uv/issues/12369 )
Test Plan
$ uv publish --index my-nexus
[...]
error: Local file and index file do not match for $FILE_NAME. If you know what you\'re doing to can still upload this file using the option `--force`. Local: sha256=xxx, Remote: sha256=yyy
$ uv publish --force --index my-nexus
[...]
Uploading $FILE_NAME ($SIZEKiB)
When is this change expected to be merged. It is urgently required for one of our projects, thanks :)
hello @mertkarakilic it seems it's stalled as there's no consensus to merge it. The corresponding issue includes a workaround : https://github.com/astral-sh/uv/issues/12369#issuecomment-2786601451