-
Notifications
You must be signed in to change notification settings - Fork 1k
Release procedures
This wiki has notes on how to release new versions of pvlib-python.
It assumes that the git remote pvlib
points to pvlib/pvlib-python
:
git remote add pvlib [email protected]:pvlib/pvlib-python.git
Before making any releases, you need to double check that your clone is up to date with the pvlib
remote:
git checkout master
git fetch pvlib
git merge pvlib/master --ff-only
If the last step fails you need to git checkout -b dirtymaster; git checkout master; git reset --hard pvlib/master
. Your work is saved in dirtymaster
.
Alternatively, one can use the GitHub Releases interface to accomplish some of the git tag
/git push
steps.
Sphinx allows to check that all external links in the documentation are working properly. For this purpose, a dedicated builder exists: linkcheck
.
To run this builder:
- Change the working directory to
docs/sphinx
- Run
python -m sphinx --builder linkcheck --show-traceback source build/linkcheck
(make sure you havesphinx==7.3
) - Wait ~4 minutes for the builder to finish and show all problems at resolving external links.
Pre-releases help with two things:
- ensuring that changes to the pvlib build/install procedures work as expected (the CI,
pyproject.toml
, etc.) - checking that we've remembered to remove deprecated features.
It's no big deal to make multiple pre-releases.
-
Bring your clone up to date with the
pvlib
remote (see above) -
Make an alpha, beta, or release candidate tag (e.g.
git tag v0.6.0-alpha
orgit tag v0.6.0-rc.1
). See semver.org -
Reinstall pvlib from your clone (
pip install .
) so that the new version number is reflected in your development environment. -
Run
pytest pvlib
-
If necessary, remove any features that correspond to tests that failed due to
pvlibDeprecationWarnings
through the standard pull request process. -
Push the tag to GitHub:
git push pvlib [the-tag-name]
This will trigger Github Actions to deploy the package to PyPI as a prerelease. -
Test it:
conda create -n pvlibreltest python=3.8
conda activate pvlibreltest
pip install pvlib --pre
python -c 'import pvlib'
- Finalize the whatsnew file using the standard pull request process:
- Add/edit release date
- Add names/usernames of anyone that is missing from the Contributors list. Be sure to include people that created issues or commented on issues/pull-requests.
- Clean up common rst mistakes such as line wraps that are not indented and apostrophes (') instead of back-ticks (`).
Choose one of the options below for making the release.
- Make the GitHub release using the releases page. The tag should be e.g.
v0.6.0
. The title is the version name. The description can be a link to the version-specific whats new section on readthedocs e.g. v0.5.2. GitHub actions will build the package and push it to PyPI.
- Bring your clone up to date with the
pvlib
remote (see above) - Create a git tag:
git tag v0.6.0
- Push the tag:
git push pvlib [the-tag-name]
GitHub actions will build the package and push it to PyPI. - Make the GitHub release using the releases page. The tag must be the same as was previously pushed. The title is the version name. The description can be a link to the version-specific whats new section on readthedocs e.g. v0.5.2
After the GitHub action finishes, the new version will be installable with pip install pvlib
. Test it!
- Fork the pvlib-python-feedstock.
- Update the
recipe/meta.yaml
file with the new version and the md5 hash of the .tar.gz file. - Double check the version numbers of packages specified in
recipe/meta.yaml
E.g. numpy, pandas. Update version numbers if necessary. Make sure to add any new dependencies, including build-time dependencies likesetuptools_scm
. - Make a pull request with the update.
- Complete the check marks on the conda-forge pull request template.
- Merge the pull request (assuming the tests pass).
It sometimes takes hours for conda-forge to build the new package. Eventually you can test it using a procedure like this:
conda create -n pvlibreltest python=3.8 pvlib -c conda-forge
conda activate pvlibreltest
python -c 'import pvlib'
Then test it on another kind of operating system, if possible.
- Close the GitHub milestone for the released version; create a milestone for the next version if it doesn't already exist.
- Make a whatsnew file for the next version, and link it in the
whatsnew.rst
so that the new page is included in documentation builds for the next development cycle. This should be done in a pull request immediately after the release.
- Send an announcement to the pvlib-python Google group.
- Notify NumFOCUS and ask them to include in a note in the next newsletter. The latest contact as of 2021-09-03 was Arliss Collins [email protected]
2020-04-22 was Walker Chabbott [email protected]2019-12-19 was Nicole Foster [email protected](please update as needed). - Optionally send announcements to NumFOCUS Google group and PyData Google group. The easiest way to update all Google groups at the same time is to send a single email to all 3 simultaneously, as long as you are a member from the same Google account to all 3 groups.
- Also optionally send an email to the following Python mailing lists: [email protected], [email protected], [email protected] after registering for each list. Same as with Google groups, it's easiest to send one email to all 3 lists at the same time.
- Here's an example email template:
Subject: [ANN] pvlib-python <vX.Y.Z>: predicting power for solar energy
From: Release Manager <[email protected]>
To: [email protected], [email protected], [email protected], \
[email protected], [email protected], [email protected]
pvlib has a new <major|minor> release, <vX.Y.Z>
Release Notes: https://pvlib-python.readthedocs.io/en/<vX.Y.Z>/whatsnew.html
PyPI: https://pypi.org/project/pvlib/
Read the Docs: https://pvlib-python.readthedocs.io/en/latest/
GitHub: https://github.com/pvlib/pvlib-python
Highlights:
- dropped support for <package>
- new <features>
- updated <something>
This is a <major|minor> release, so there are a few <breaking API changes|bug fixes>.
Users are advised to read the release notes before updating.
- Check that Zenodo successfully detected and imported the new version. The DOI in README.md should already automatically link to the latest version.
- Edit the infobox on the wikipedia page to list the new version.
These instructions should not be needed, but are included here just in case.
A GitHub action is configured to automatically push tagged commits to PyPI. So, manual upload should not usually be necessary for pvlib releases. But if you need to...
Note: these instructions are out of date and need to be updated to use pyproject.toml
instead of setup.py
.
From the root pvlib-python directory:
- Bring your clone up to date with the
pvlib
remote (see above) - Ensure that your working directory is clean. Make a fresh clone or remove any added files. Carefully run
git clean
if necessary. - Build a source distribution
python setup.py sdist
- Build wheels
python setup.py bdist_wheel --universal
- Upload to PyPI
twine upload dist/*
as described by the PyPA.
The package is now installable with pip install pvlib
. Test it!
v0.9.4 was the last version to be distributed via the pvlib
anaconda channel, so the release procedure no longer involves uploading a distribution to anaconda.org (see #1622). For reference, the original content of this section is preserved here: https://github.com/pvlib/pvlib-python/wiki/Release-procedures/c0a6471e3813742e75b73e6f0ba874e2bb87daf0#upload-to-anacondaorg