/ mozey.co / blog

publish to pypi

October 1, 2015

How to submit a package to PyPI

List packages installed in virtual env

pip freeze

Make sure setup.py requires relevant packages

Build source distribution

python setup.py sdist

tar -ztvf dist/package.tar.gz

Register package on PyPI

python setup.py register

Upload package to PyPI

python setup.py sdist upload

Install package to virtualenv for testing

workon testing

python setup.py install

command -v mypackage

unzip -l ~/.venvs/testing/lib/python3.4/site-packages/mypackage.egg

Upgrade PyPI package

pip install mypackage --upgrade