From 242aeb7f12a00ab57e9585bf2b080c9cff694f9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Padilla?= Date: Fri, 12 Jun 2015 17:03:12 -0400 Subject: [PATCH] Tweak publish to use twine --- setup.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 5f20265c..69eedf16 100644 --- a/setup.py +++ b/setup.py @@ -64,11 +64,17 @@ def get_package_data(package): if sys.argv[-1] == 'publish': - os.system("python setup.py sdist upload") - os.system("python setup.py bdist_wheel upload") - print("You probably want to also tag the version now:") + if os.system('pip freeze | grep wheel'): + print('wheel not installed.\nUse `pip install wheel`.\nExiting.') + sys.exit() + if os.system('pip freeze | grep twine'): + print('twine not installed.\nUse `pip install twine`.\nExiting.') + sys.exit() + os.system('python setup.py sdist bdist_wheel') + os.system('twine upload dist/*') + print('You probably want to also tag the version now:') print(" git tag -a {0} -m 'version {0}'".format(version)) - print(" git push --tags") + print(' git push --tags') sys.exit()