Releasing

Reference:

Environment and requirements

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

  • PKG-INFO: project description and metadata defined in setup.py
  • 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

Danger

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.

~/.pypirc

[distutils]
index-servers=
    pypi
    testpypi

[pypi]
repository = https://upload.pypi.org/legacy/
username = <PyPI username>

[testpypi]
repository = https://test.pypi.org/legacy/
username = <TestPyPI username>
password = <TestPyPI password>

Releasing shaarli-client

Checklist

  • 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

Tip

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

TestPyPI

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

PyPI

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