Skip to content

PyPiInstructions

Giovanni Pizzi edited this page May 19, 2023 · 14 revisions

Instructions on how to upload a package on PyPi

Since I always forget, here are some instructions.

Only once

  • pip install twine (only once)

  • create ~/.pypirc:

      [distutils]
      index-servers =
        pypi
        pypitest
    
      [pypi]    
      username=gio.piz
      
      [pypitest]
      repository=https://testpypi.python.org/pypi
      username=gio.piz
    

Commits and tags in the code

  • First, update __version__ in the code and make sure the main branch is ready to be released.
  • Create a new tag 'vX.X.X' from the latest commit in main (remember to push the tag as well!)

Then:

Update pip

  1. clear the build/, dist and seekpath.egg-info folders

  2. git pull (possibly then checking out the tag to be sure of the version we are at)

  3. python setup.py sdist bdist_wheel --universal

  4. upload the package

    twine upload dist/*

(to test: pip install seekpath)

Clone this wiki locally