uv icon indicating copy to clipboard operation
uv copied to clipboard

Add --force option to uv-publish to force upload

Open marc-planard opened this issue 8 months ago • 2 comments

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)

marc-planard avatar Mar 21 '25 16:03 marc-planard

When is this change expected to be merged. It is urgently required for one of our projects, thanks :)

mertkarakilic avatar May 12 '25 17:05 mertkarakilic

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

marc-planard avatar May 13 '25 07:05 marc-planard