Skip to content

Make a release

QLutz edited this page Apr 20, 2020 · 40 revisions

Procedure

After updating all RST files and before pushing a commit tag, you may check whether PyPI will be able to render the package description. To do so:

  • Create a source distribution by entering python setup.py sdist in a terminal
  • Check the distribution with Twine (to be installed) with twine check dist/*

This should mark the checks as passed and will display an error otherwise. See this link for more information.

To make a release, checkout on the master branch (make a pull request if you need to):

  • Update HISTORY.rst with the new version

  • Use bumpversion to change the version number (X.Y.Z). Type bumpversion major (respectively bumpversion minor and bumpversion patch) in a terminal to make a major release (respectively minor release and patch) ie. X+1.Y.Z (respectively X.Y+1.Z and X.Y.Z+1). This creates a tag and commits on Git, push the created commit, make sure the tag is pushed as well. For proper numbering see the associated PEP.

  • Check that Travis builds and deploys to PyPI

  • Draft a new release on GitHub (go to Releases then Draft a new release)

  • Be nice and create a pull request from master to develop afterwards :)

The most straightforward way is to follow François Durand's instructions.

Troubleshooting

If Travis builds but does not deploy to PyPI, check the console output of the last build:

  • if Travis does not detect the commit tag, manually create a release on GitHub. This should prompt Travis to launch a new build and deploy
  • if Travis does not accept the repo as valid, check the .travis.yml configuration file (look for the repo field)
  • do not hesitate to have a thorough look at the Travis log. For instance, in build 953, see how the actual error is hidden at line 737 which does not show by default.

If Travis starts to deploy but fails, make sure you have valid credentials for PyPI deployment. If not, ask an owner (nicely).

If you need to make a new tagged commit, you may add a tag to any commit. Make sure you push again after adding that tag. You can check if a commit is tagged on Travis by checking the icon next to the build number (#XXXX received/passed/...).

Clone this wiki locally