Skip to content

How to upload a new version to PyPI

Marco Tazzari edited this page Mar 3, 2021 · 3 revisions

The following steps need to be performed if you want to publish a new version to PyPI.

  1. Update the version (in uvplot/_version.py).
  2. If you added new, non-Python files to the project that need to be distributed as well, e.g., configuration files, add them to MANIFEST.in.
  3. Open a terminal and go into the project's root dir (where setup.py is located)
  4. python setup.py sdist bdist_wheel to create the packages in dist/ directory.
  5. Check the resulting files, especially the egg file: are all the files contained? Check the content (e.g., with tar tzf dist/*.tar.gz) and more formally check with the official PyPI tool twine check dist/*
  6. If everything is ok, upload the new version to PyPI: twine upload --repository uvplot dist/*

Note: In order to upload to PyPI, twine needs the PyPI credentials. They can be stored in a $HOME/.pypirc file. Examples on how to create the .pypirc file are given in the PyPI page, just after creating the API token.

Useful resources:

Clone this wiki locally