diff --git a/requirements.txt b/requirements.txt index 00d973cdf..32938ab23 100644 --- a/requirements.txt +++ b/requirements.txt @@ -19,6 +19,8 @@ django-oauth2-provider>=0.2.4 # wheel for PyPI installs wheel==0.24.0 +# twine for secured PyPI uploads +twine==1.4.0 # MkDocs for documentation previews/deploys mkdocs==0.11.1 diff --git a/setup.py b/setup.py index efe39d8d4..4cdcfa86e 100755 --- a/setup.py +++ b/setup.py @@ -48,8 +48,11 @@ if sys.argv[-1] == 'publish': if os.system("pip freeze | grep wheel"): print("wheel not installed.\nUse `pip install wheel`.\nExiting.") sys.exit() - os.system("python setup.py sdist upload") - os.system("python setup.py bdist_wheel upload") + 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 %s -m 'version %s'" % (version, version)) print(" git push --tags")