Steps to publish and install python packages
This post records some useful commands for publishing and installing a Python package.
Publishing a Python package to PyPi
-
Build locally
python setup.py sdist bdist_wheel
The files are built under directory ./dist
-
Check
twine check dist/*
-
Publish to Test PyPI
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
to see if everything looks fine.
-
Final publish to PyPI
twine upload dist/*
Installation
-
Install using pip
pip install molann==1.0.2
-
Build and install from source code
python setup.py sdist pip install dist/*.tar.gz --user
Useful tutorials
The following tutorials contain many useful information.
- Packaging Python Projects.
- Python Packaging User Guide.
- An excellent tutorial is here.
- The Sheer Joy of Packaging.