-
Notifications
You must be signed in to change notification settings - Fork 35
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
In pypi, it is impossible to reupload a removed file. #74
Comments
Also the previous version has been removed and is impossible to find. |
It's probably still available in the Fastly caches, which is why you need to use a new filename. The old filename will have been marked as to cache indefinitely so even if you could upload a filename with the same name, if they had already fetched the old version they would never get the new one. |
In my case it isn't a problem because it is the exact same file. |
See Donald's email at http://comments.gmane.org/gmane.comp.python.distutils.devel/22739
|
Npm did the same in 2014. See http://blog.npmjs.org/post/77758351673/no-more-npm-publish-f
I presume the justification is the same for PyPI. It's an FAQ, so should probably go in documentation somewhere. |
Then we shouldn't allow people to remove their files if they cannot put them back. |
I think we should allow to reupload the same removed file |
There are very good reasons for the current behavior. Authors should be able to delete for any number of reasons (legal, security, etc.) Users of the package should be able to rely on getting the exact same thing every time they install a package of a specific version. If you delete a package that someone relies on, they know the version is gone and they need to make a change to fix it. If you could delete a package and replace it with something different but with the same version, it can break their program is any number of subtle ways and it would be very hard to determine the cause of the problem. Allowing this would break the entire version number contract. You may have what seems to be a good reason to replace a version but allowing it is not worth making versions unreliable. |
Absolutely. |
You broke their package and you cannot put it back. |
That's not what I am asking for. I am asking for putting back the package I removed. |
Allowing to put back the version you removed doesn't break any contracts. + You already have the previous package hash so you can check the version didn't change and that you are really re-uploading the file that you removed. |
There I agree. If it can be ensured via the hash that only the exact same package is uploaded to the same version then I don't see this being a problem in concept. |
So long as the documentation and confirmation makes it clear that unpublishing is permanent, then I think it's reasonable and prudent.
|
To prevent malicious abuse, perhaps the policy should be strengthened to 'no uploads to old versions' #75 |
Unless you have the physical file laying around still, it's unlikely you're going to have something that matches the same hash. The Most likely the eventual solution to this is that "delete" won't actually be a full out absolute deletion, it'll be more like a soft delete where it just acts as if it's deleted without actually deleting it (so it won't show up in the API, won't appear anywhere, etc) but there will be a list of these deleted things when the author logs in and a button that says "Restore" that allows them to restore a file they've previously deleted. Possibly this would have a periodic cleanup where if something was soft deleted for some period of time (a month? 6 months? a year?) we'll go through and clean it up and actually hard delete it then. Perhaps we'd also enable it for authors to trigger an immediate hard delete of something they've soft deleted, but there would be plenty of big warnings that if they press that button there is no recovery possible. |
With
|
Right, I wrote |
People are not dumb, if they need to do something complicated they will eventually succeed. The fact is even if they know all the things, they won't be able to do it. But yeah #75 is a workaround for now, (using .zip instead of .tar.gz for instance) |
As I already wrote it in #75 I think that behaviour is quite OK for the live repo. Though, to be honest, it's a huge PITA for the test repo. I support integrity and all that stuff on "production" systems. However, developers need to have their code / packages checked somewhere and it's a PITA if you can't upload them same version twice while testing a new release. There's no other way than the test repo to test your package. With git (or any other SCM) you can easily create a new branch and test it until you're sure everything works. Or if you've a look at PHP Packagist (compose) there's a -dev version for each development branch. On Docker the same, you can test your feature/release branches before tagging and going "live". With the new policy you basically say: You've ONE SINGLE TRY and that one SHOULD WORK. No chance for a 2nd try. IMHO this isn't the purpose of a testing system and breaks the whole "we've a testing repo" idea. To be honest, I think this only leads to annoyed developers and a lot of "crippled versions" because developers couldn't properly test their versions before going live. tl;dr: |
In my case, I forgot to sign the upload. It appears once you have uploaded the package it is impossible to fix any problems you made with the upload without making a new release. Even if you just want to upload the exact same version again. |
But how do you know it is "the exact same version"? Unless it checks the uploads are binary identical it would allow you to upload a totally different release with the same version which can cause any amount of problems. |
Just his what @domibarton is describing. What's the point of a test repo if you can't make mistakes? |
Why cannot you do |
I could, and then having to remember to wipe those temp changes from my working tree before pushing to the live pypi repo. |
I uploaded a new version of Voltron yesterday and the server threw a 500 error during the upload. This resulted in a partial file being hosted as the current wheel for this package. The file size was smaller than my local one, and the hash differed. This operation needs to be atomic. If the upload fails, you have no opportunity to try again. The only option is to use a different version number, which is not an appropriate solution. IMO it should be a requirement that the hash of the upload is verified by the author before it is marked as "published". |
Yes I have the same problem with my last uploaded packages. |
My files were uploaded broken, due to a connection error, why can't I replace them?! |
The Repo Score v1 is forked from criticality_score and had much not graceful modification on upstream code, after the discussion[1], we decided to decouple the dependency of criticality_score. So in this patch, we keep the v1 code and doc unchanged, only move the criticality_score into requirements, set the setup version to 2.0.0 to avoid the pypi reupload problem[2]. [1] #1 [2] pypa/packaging-problems#74 Close: #1
@arigo Unfortunately I have a problem with this approach:
|
Hi, I just removed a package version because my internet connection failed midway through and so it thought I had uploaded a file when I actually hadn't. I didn't realise this would mean I could never use that version number again because there's no warning. I think this is a bit absurd as now I'm going to have to make a new release (v0.1.4) without making any changes. There should be a warning before you delete versions and files saying that you can never use those names again to ensure users understand what they're doing. |
You can upload a post version, |
I just bumped the version number a few times, tried again and it worked fine, and got on with my day. |
3.0.1 upload failed, upload again as 3.0.2. pypa/packaging-problems#74
I also had the same problem and could not re-upload a package with the same version after deleting it from pypi, but the following solution worked for me. |
I had a similar question but for binary packages. A fix for binary packages is to append a build tag to the version number, e.g. rename
This is better than appending This may not work with source distributions. |
Source distributions have no formal notion of a build tag, so if it works with sdists, that's likely to be by accident and shouldn't be relied on. |
The text was updated successfully, but these errors were encountered: