سؤال

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?

هل كانت مفيدة؟

المحلول 2

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."

نصائح أخرى

upload will only push files that are products of a command run from the same command line, e.g. “sdist upload”. If you run “sdist”, check the result, and then do “sdist upload”, the second sdist should be exactly the same, unless your setup.py is buggy, you made changes to your files or you have a computer problem. (I agree that’s a lot of unless). So for distutils, having to run “sdist upload” is not inefficient, and makes you be explicit about the files you want to push, which is IMO good.

(from http://bugs.python.org/issue12944#msg144382 )

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top