-
Notifications
You must be signed in to change notification settings - Fork 438
Release instructions
Richard Murray edited this page Mar 15, 2025
·
49 revisions
This page contains the information that you need in order to make a release of the python-control package. The page is under construction.
We assume that the release candidate is in the main branch, with all pull requests associated with the release merged.
- Verify that all unit tests execute properly (GitHub Actions + local)
- Linux: check build status at https://github.com/python-control/python-control/actions
- look at conda-based test with and without slycot to make sure there are no unexpected warnings
- run
os-blas-test-matrix
workflow to make sure everything works on various platforms
- Local (optional): check that tests pass on local machine using
pytest
for Python 3.x, with and without Slycot.-
pytest
: should have no errors or warnings -
cd examples; PYTHONPATH=.. ./run_examples.sh
: should exit with 'All examples ran successfully' -
PYTHONPATH=.. ./run_notebooks.py
: should exit with 'All examples ran successfully'
-
- Verify that all checks pass for all variants
- Linux: check build status at https://github.com/python-control/python-control/actions
- Verify that documentation builds properly (ReadTheDocs)
- Check build status at https://readthedocs.org/projects/python-control/builds/
- Look at entry for html to make sure there are no warnings that need to be fixed
- Inspect documentation for latest release to verify that it looks OK
-
Note: current version of readthedocs is not rendering bullet lists correctly(fixed in PR #817)
-
- Check build status at https://readthedocs.org/projects/python-control/builds/
- Create an annotated tag in git (in main branch in GitHub repository):
- git tag -a x.y.z -m "python-control version x.y.z"
- git push --tags
- Note: don't use the GitHub release mechanism at this stage (you need an annotated tag, which requires this step)
- (optional) Mark all pull requests contained in the release with the milestone associated with the release
-
github: On the project’s GitHub page, click the releases tab and then press the “Draft a new release” button to create a release from the appropriate tag.
- Note: github may do this automatically when it sees the tag get posted
- Use "Auto-generate release notes" to generate draft release notes; edit for style and consistency
-
pypi
- Install setuptools_scm and build tools, if needed
- python -m pip install --upgrade pip
- python -m pip install --upgrade build, setuptools_scm, twine
- Create the source distribution and upload to PyPI:
- git clean -xfd
- Generate the version file: python -m setuptools_scm
- Generate the souce distribution: python -m build
- upload to PyPi using twine: twine upload dist/*
- Note that you may need to modify this to use an API token: https://pypi.org/help/#apitoken
- twine upload --username token --password pypi- dist/*
- log in to PyPi.org as admin and grab the sha256 hash from the download page for later use
- Install setuptools_scm and build tools, if needed
-
conda-forge: Send a PR with the new version number and sha256 hash of the source release to https://github.com/conda-forge/control-feedstock.
- Fork control-feedstock to your account and make changes in your fork
- If you already have the forked code, then 'git pull upstream main'
- Update
recipe/meta.yml
: change the version number, sha256 hash, and reset the build number to 0 - If there have been changes to the conda build process, you may need to do more extensive edits to
meta.yaml
- Push changes back to your github account and generate a pull request.
- Once checks are complete (and successful), merge pull request
- Fork control-feedstock to your account and make changes in your fork
-
readthedocs: Log in to the python-control project page and go to the
Admin
tab and chooseVersions
from the sidebar. Make sure the release version is "active" and "public" and that it builds properly (new build will trigger when release version is marked as active). One the build is complete and looks OK, set the the default version (Admin -> Advanced Projects Setting) to be the version just released and remove "active" setting from older versions.- Update the stable branch to match the latest release (required as long as major version is < 1):
git checkout stable git merge 0.x.y git push
- If math images don't render properly, try this:
- Set up an exact redirect from
/en/<ver>/generated/_images/*
to/en/<ver>/_images/:splat
to fix a bug in the way math images are handled in generated pages. - Set up an exact redirect from
/en/<ver>/examples/_images/math/*
to/en/<ver>/_images/math/:splat
to handle math created in Jupyter notebooks
- Set up an exact redirect from
- Currently maintaining the last version (0.x), last major release (0.x.y), and last minor releases (0.x.y.z)
- Confirm that source code links work and send you to the right version of the code
- Update the stable branch to match the latest release (required as long as major version is < 1):
- Update release notes page:
- Move release description from
Current release
toPast releases
- Move release documentation for specified release from
Upcoming releases
toCurrent release
- Copy release notes from GitHub releases page
- If
Upcoming releases
is empty, create a new entry titledpython-control TBD
- Move release description from
- Verify ability to install
slycot
andcontrol
via pip and conda on your local machine (just to make sure everything "took")- It can sometimes take a while (minutes to hours) for the
control
package to show up on conda-forge
- It can sometimes take a while (minutes to hours) for the
- python-control-announce: Send release announcements to python-control-announce@sourceforge.com