To upload to PyPI, you run python setup.py register sdist upload
. But this requires regenerating the source distribution. As part of my release process, I want to be able to generate the source distribution separately from the uploading. Is there a way to upload from a file, i.e., something like python setup.py upload dists/mypackage.tar.gz
?
The issue mentioned by Éric Araujo mentions this trick:
"A trick can be used to avoid the second sdist to redo all its work: Fist you run “python setup.py sdist --keep-temp”, then you check the sdist, and to upload you call “python setup.py sdist --dry-run upload”. I’m not in favor of adding that trick to the doc, as for normal usage, running sdist twice is okay."