Skip to content

Commit 0e4d202

Browse files
committed
Merge pull request #2527 from linovia/feature/secured_pypi_upload
Use twine to upload to pypi.
2 parents 24372ec + 750d0c9 commit 0e4d202

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ django-oauth2-provider>=0.2.4
1919

2020
# wheel for PyPI installs
2121
wheel==0.24.0
22+
# twine for secured PyPI uploads
23+
twine==1.4.0
2224

2325
# MkDocs for documentation previews/deploys
2426
mkdocs==0.11.1

setup.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,11 @@ def get_package_data(package):
4848
if os.system("pip freeze | grep wheel"):
4949
print("wheel not installed.\nUse `pip install wheel`.\nExiting.")
5050
sys.exit()
51-
os.system("python setup.py sdist upload")
52-
os.system("python setup.py bdist_wheel upload")
51+
if os.system("pip freeze | grep twine"):
52+
print("twine not installed.\nUse `pip install twine`.\nExiting.")
53+
sys.exit()
54+
os.system("python setup.py sdist bdist_wheel")
55+
os.system("twine upload dist/*")
5356
print("You probably want to also tag the version now:")
5457
print(" git tag -a %s -m 'version %s'" % (version, version))
5558
print(" git push --tags")

0 commit comments

Comments
 (0)