-
Notifications
You must be signed in to change notification settings - Fork 105
How to release
This is a guide on how to publish and ship a new release of the windpowerlib.
- Check
setup.py
- Version correct?
- 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
- Update version number in
__init__
file - Make sure desired changes (PRs) are merged to
dev
- Check docs
- Build docs locally
sphinx-build -b html path/to/doc/ output/path/
- Remove errors and warnings as far as possible
- Build docs locally
- What's new
- Set release date in "What's new"
- Make sure list of changes, bug fixes and new features is complete. Consider to scan issues attached to the milestone that were closed.
- Add what's new file to whats_new.rst
-
Merge
dev
tomaster
-
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 defaultpython setup.py check -m
does not result in an error and if it doesn't it is fine.) -
Create a release tag on
master
. -
Pull master to your local repository and check if the new tag is there. (If you do not see the tag type 'git fetch'.)
-
Release via PyPI (this link may be helpful).
-
Make sure you are in
master
branch and the latest commit. -
Make sure you have the latest versions of setuptools and wheel installed:
python3 -m pip install --upgrade setuptools wheel twine
-
Now run this command from the same directory where setup.py is located:
python3 setup.py sdist bdist_wheel
-
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.
-
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/*
-
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
-
If everything works as expected you can now upload the new windpowerlib version to PyPI.
twine upload dist/*
-
-
(Newest version is automatically registered at zenodo. Check here).
- Set version for next release in setup.py and
__init__
file ofdev
- Create "What's new" file for next version
- Celebrate! 🎆 🍾 👏