These are some simple notes to remind myself how to upload a python package to PyPI. The full description on how to upload a package to PyPI can be found here.
These notes assume that you have already set up the proper folder structure, a working setup.py and all the requirements (
wheel, and useraccounts at PyPI and TestPyPI) for uploading to PyPI installed.
Make sure you have the latest versions of
Run this command from the same location as setup.py
This creates several files in the dist/ directory:
dist/ example_pkg_YOUR_USERNAME_HERE-0.0.1-py3-none-any.whl example_pkg_YOUR_USERNAME_HERE-0.0.1.tar.gz
If this runs without warnings you can upload to TestPyPI.
After the command completes you can see the package on https://test.pypi.org/project/example-pkg-YOUR-USERNAME-HERE.
If everything looks as it should you can upload to PyPI.
This procedure works well for pure python packages. Once platform dependencies creep in, it is advicable to take that into account. I recommend checking out the python packaging tutorial (SciPy 2018).