Skip to content

How to release

Birgit Schachler edited this page Feb 20, 2024 · 16 revisions

This is a guide on how to publish and ship a new release of the windpowerlib.

Before release

  1. Check setup.py
    1. Version correct?
    2. Version of depending packages: Are lower and upper limits correct? Are new versions included? COMMENT: put upper limit of next version that could have an API break (example: pandas newest version: 0.23.1 --> put 0.24.0 as upper limit
  2. Update version number in __init__ file
  3. Make sure desired changes (PRs) are merged to dev
  4. Check docs
    1. Build docs locally sphinx-build -b html path/to/doc/ output/path/
    2. Remove errors and warnings as far as possible
  5. What's new
    1. Set release date in "What's new"
    2. Make sure list of changes, bug fixes and new features is complete. Consider to scan issues attached to the milestone that were closed.
    3. Add what's new file to whats_new.rst

Actual release process

  1. Merge dev to master

  2. Check the rendering of the README file on the master python setup.py check -r -s (This might give an error due to duplicated references, but is not actually a problem. In that case, check that the default python setup.py check -m does not result in an error and if it doesn't it is fine.)

  3. Create a release tag on master.

  4. Pull master to your local repository and check if the new tag is there. (If you do not see the tag type 'git fetch'.)

  5. Release via PyPI (this link may be helpful).

    1. Make sure you are in master branch and the latest commit.

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

      python3 -m pip install --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)

      (python3 -m) 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 windpowerlib

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

      twine upload dist/*

  6. (Newest version is automatically registered at zenodo. Check here).

After the release

  1. Set version for next release in setup.py and __init__ file of dev
  2. Create "What's new" file for next version
  3. Celebrate! 🎆 🍾 👏
Clone this wiki locally