Skip to content
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

Upload of existing packages is treated as success #354

Closed
iliapolo opened this issue May 1, 2018 · 5 comments
Closed

Upload of existing packages is treated as success #354

iliapolo opened this issue May 1, 2018 · 5 comments

Comments

@iliapolo
Copy link

iliapolo commented May 1, 2018

Any chance something is broken in the way twine (or pypi) handles uploads of existing packages?

Case in point:

twine upload --repository-url https://test.pypi.org/legacy/ <my_package>-0.0.1-py2-none-any.whl
Uploading <my_package>-0.0.1-py2-none-any.whl
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 50.1k/50.1k [00:01<00:00, 41.5kB/s]

Running the same command should have resulted in a "File already exists" error, but now for some reason it just acts as if the package doesn't exist and prints the same output as the first execution. However, the actual package in pypi isn't overridden (which is good obviously).

Whats going on? Am i missing something? tested both on test.pypi and pypi... :\

Thanks

@brainwane
Copy link
Contributor

What versions of twine, setuptools, pkginfo, and wheel are installed? Thanks!

@iliapolo
Copy link
Author

iliapolo commented May 1, 2018

Right, sorry:

setuptools==28.8.0
pkginfo==1.4.2
twine==1.11.0
wheel==0.29.0

@di
Copy link
Sponsor Member

di commented May 1, 2018

This is behaving as expected.

What's happening here is that you're uploading the exact same file (same hash, same source, same filename, etc.) and there's just nothing for PyPI to do, since what you've requested (make this file the distribution for this version of this project) is already done. There's no problem with asking PyPI to do it again, because it would make no difference if PyPI did it again or not.

Relevant issue that introduced this behavior is here: pypi/warehouse#2284

It's possible that you're experiencing a common user problem (hard to tell without more details), in which you've:

  • published a distribution to PyPI;
  • made changes to the source, but forgot to build a new source distribution or wheel;
  • tried to upload these changes to PyPI with twine, however;
  • what you're actually uploading is the old distribution, created before the changes were made.

Usually this manifests itself as "I published a new distribution to PyPI but it's not showing up!" however in your case, it would be equivalent to the behavior you're seeing.

@iliapolo
Copy link
Author

iliapolo commented May 2, 2018

Got it.

I was indeed uploading the exact same file as part of a unit test, changed the test to modify the source code between executions and it worked as expected.

Thanks for the clarification and quick response 👍

@brainwane
Copy link
Contributor

Glad we could help! :D Great work troubleshooting, @di. 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants