Environment and requirements

twine is used to register Python projects to PyPI and upload release artifacts:

  • PKG-INFO: project description and metadata defined in

  • sdist: source distribution tarball

  • wheel: binary release that can be platform- and interpreter- dependent

Development libraries need to be installed to build the project and upload artifacts (see Testing):

(shaarli) $ pip install -r requirements/dev.txt

PyPI and TestPyPI configuration


Once uploaded, artifacts cannot be overwritten. If something goes wrong while releasing artifacts, you will need to bump the release version code and issue a new release.

It is safer to test the release process on TestPyPI first; it provides a sandbox to experiment with project registration and upload.



repository =
username = <PyPI username>

repository =
username = <TestPyPI username>
password = <TestPyPI password>

Releasing shaarli-client


  • install Python dependencies

  • setup PyPI and TestPyPI:

    • create an account on both servers

    • edit ~/.pypirc

    • register the project on both servers

  • get a GnuPG key to sign the artifacts

  • double check project binaries and metadata

  • tag the new release

  • build and upload the release on TestPyPI

  • build and upload the release on PyPI


A Makefile is provided for convenience, and allows to build, sign and upload artifacts on both PyPI and TestPyPI.


(shaarli) $ export IDENTITY=<GPG key ID>
(shaarli) $ make test_release


(shaarli) $ export IDENTITY=<GPG key ID>
(shaarli) $ make release