-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
sometimes we want to force uv publish
to upload anyway
#12369
Comments
I'm fine with a cc @konstin |
Oh this can definitely lead to caching issues, we're using it in a CI context where we know we start from a clean cache each time, but it's really a "I hope you know what's your doing, user" situation, for sure :) |
I believe it was intentional that we did not support this so we should make sure that @konstin is heard before committing any changes. |
Do you mean you replace an already published file with a different file with the same name? |
Yes, exactly. |
I don't want to support that, uv assumes that files don't change once their published. If they change, it breaks hash-checking and installers that depend on the old file. |
I’d like to explain (as briefly as possible but it seems I've already failed) why I believe this should be allowed and share our use case. That said, I don’t claim any kind of expertise in uv or Python package management in general, and I respect your broader understanding of these decisions. As @zanieb pointed out, if the registry permits package overwrites, then they will inevitably happen—whether they should or not. If uv prevents re-uploading a file, we would simply resort to using curl and the Nexus API instead of uv publish. While that workaround would be less safe and more cumbersome, it would still achieve the intended outcome. By providing an explicit escape hatch, however, you would have the opportunity to clearly communicate to users why this is discouraged and outline the potential consequences of proceeding down this path. Also I went for the simplest implementation with my PR with a simple flag but there's maybe something more appropriate UX wise. Heck you can rename the flag to "--unleash-the-kraken" if you prefer :) Regarding our use case:We have two nexus pipy registries: let say (note that we are migrating from poetry to uv. Poetry let us overwrite a package without even a warning. I consider the fact that uv is checking and prevent overwriting a package an improvement and the right default. But I still wish it would let me override the security) |
@marc-planard |
I am fine with amending it to |
You can deactivate the check by not telling uv about the index URL, i.e., I agree that testing and using packages from continuous integration currently does not have a good, recommendable workflows. There's e.g. build tags in the wheel filename we could use, but I don't think there's build backend support for that, similarly we're lacking something like a well-integrated concept of a package override that uses let's say an S3 bucket that the CI uploads too, without any expectation of consistent packages and consistent package metadata. |
@konstin good to know an escape hatch already exists. not trying to argue but just a couple of remarks:
|
Summary
We use a private Nexus Pipy repository and we regularly need/want to update a package on the server without bumping its version number.
uv publish
currently prevent us from doing that (certainly for very good reasons) , nevertheless, we would like to be able to override this safeguard.I've added a --force option to
uv publish
which fix this for us in this PR: #12370I've found a couple of issues tangentially related to this topic (like #7917 ) but I haven't found a way to achieve the behavior we need with the current set of available options (maybe I've missed something though).
I realize that this proposal may be rejected as a whole because you really really don't want to allow that period, otherwise I'd be happy to be mentored a little bit to carry the PR home as it's my first time contributing...)
Example
Old behavior:
New behavior:
The text was updated successfully, but these errors were encountered: