Created
August 11, 2013 05:21
-
-
Save jbub/6203506 to your computer and use it in GitHub Desktop.
how to build your own python package and upload it 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
# build source distribution | |
python setup.py sdist | |
# build wheel distribution | |
python setup.py bdist_wheel | |
# register with pypi test server | |
python setup.py register -r test | |
# configure your .pypirc | |
[distutils] | |
index-servers = | |
test | |
pypi | |
[test] | |
repository = https://testpypi.python.org/pypi | |
username = your_test_username | |
password = your_test_password | |
[pypi] | |
repository = https://pypi.python.org/pypi | |
username = your_username | |
password = your_password | |
# upload to pypi test server | |
python setup.py sdist upload -r test | |
python setup.py bdist_wheel upload -r test | |
# install from test server | |
pip install -i https://testpypi.python.org/pypi your_package | |
# upload to live pypi server | |
python setup.py sdist upload -r pypi | |
python setup.py bdist_wheel upload -r pypi | |
# install from live server | |
pip install your_package |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment