Skip to content

PyPiInstructions

Giovanni Pizzi edited this page May 17, 2020 · 1 revision

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 (subfolder tools-barebone)
  • merge also into master (via a PR!)
  • commit and create a new tag vX.X.X from the commit in master (remember to push the tag as well!)
  • make sure that a new tag has been successfully built on DockerHub.

Then:

Update pip

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

  2. git pull

  3. git checkout vX.X.X

  4. python setup.py sdist bdist_wheel --universal

  5. upload the package

    twine upload dist/*

Clone this wiki locally