Created
November 10, 2017 16:06
-
-
Save meganlkm/d98a52a236abc475b141e04c1e1d1e58 to your computer and use it in GitHub Desktop.
upload packages to pypi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
## ======================================================================= | |
## ~/.pypirc | |
## ----------------------------------------------------------------------- | |
# [distutils] # this tells distutils what package indexes you can push to | |
# index-servers = | |
# pypi | |
# pypitest | |
# [pypi] | |
# username: your_username | |
# password: your_password | |
# [pypitest] | |
# repository: https://test.pypi.org/legacy/ | |
# username: your_username | |
# password: your_password | |
## ======================================================================= | |
## install twine | |
pip install twine | |
## your pypi username and password can be stored in | |
## environment variables if they are not in ~/.pypirc | |
export TWINE_USERNAME="your_username" | |
export TWINE_PASSWORD="your_password" | |
## clean up and build | |
rm -rf build dist | |
python setup.py sdist bdist_wheel | |
## upload to test pypi | |
twine upload --repository pypitest dist/* | |
## install from pypi test | |
pip install --index-url https://test.pypi.org/simple/ package-name | |
## upload to pypi | |
twine upload dist/* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment