Skip to content

How to release

nesnoj edited this page May 28, 2021 · 14 revisions

Prerequisites

  • make sure the right version is set in setup.py and doc's conf.py
  • Make sure "What's new" file was updated and included in Docs
  • Check docs
    1. Build docs locally sphinx-build -b html path/to/doc/ output/path/
    2. Remove errors and warnings as far as possible

Release

  1. Create pull request (to master)

  2. Merge or let someone else merge it

  3. Check dist with twine: twine check dist/* and fix all errors

  4. Create a release tag on master

  5. Release via PyPI (if you don't have permissions for this repo, ask @gplssm, @nesnoj) This link may be helpful.

    1. Pull master to get the release tag (If you do not see the tag type 'git fetch'.)

    2. Make sure you have the latest versions of setuptools and wheel installed:

      python3 -m pip install --user --upgrade setuptools wheel twine

    3. Now run this command from the same directory where setup.py is located:

      python3 setup.py sdist bdist_wheel

    4. README - Last check on README file because it will be the first page on PyPi

      python3 -m twine check dist/*

      If errors occur fix them now and check again. It is NOT possible to fix them after the release.

    5. Run Twine to upload all of the archives under dist to TestPyPI (you need to register at TestPyPI first)

      twine upload --repository-url https://test.pypi.org/legacy/ dist/*

    6. Before uploading to PyPI you can now test the uploaded package by installing it from TestPyPI and check if everything works correctly (e.g. run an example).

      pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple ding0

    7. If everything works as expected you can now upload the new ding0 version to PyPI.

      twine upload dist/*

  6. List package versions in Installed-packages by using conda list --export

After release

  • bump version to the next one (in dev branch) specified in setup.py
  • Add "What's new" file for next version: file itself and include statement in whatsnews.rst
  • Generate a new dataset
  • Add Zenodo badges to GitHub: source code and data
Clone this wiki locally