This file provides the procedures for releasing a new version of CVXPY. The process involves defining a new release in the commit history, packaging and deploying the updated source code, and deploying updated web documentation.
CVXPY's setup.py file defines the following versioning data
MAJOR : an int
MINOR : an int
MICRO : an int
IS_RELEASED : a bool
IS_RELEASE_BRANCH : a bool
Here we give the procedure for maintaining these values as one makes new minor and micro releases.
Let's say we're releasing 1.2.0.
- Starting from
master
, checkout a new branch calledrelease/1.2.x
. - The versioning data in setup.py should already be
Set
MAJOR = 1 MINOR = 2 MICRO = 0 IS_RELEASED = False IS_RELEASE_BRANCH = False
IS_RELEASE_BRANCH = True
andIS_RELEASED = True
. Commit these changes and tag the commit asv1.2.0
. - Lay the groundwork for the next release on this branch.
Do this by setting
MICRO = 1
,IS_RELEASED = False
, and committing those changes. Do not tag the commit as a release. The state of this branch is effectively a pre-release of CVXPY 1.2.1. - Checkout
master
. Change the versioning data fromMINOR = 2
toMINOR = 3
and commit. The state of this branch is effectively a pre-release of CVXPY 1.3.0.
Let's say we're releasing CVXPY 1.2.1
- Starting from
release/1.2.x
, the versioning data in setup.py should already beChangeMAJOR = 1 MINOR = 2 MICRO = 1 IS_RELEASED = False IS_RELEASE_BRANCH = True
IS_RELEASED = True
and commit that change with the tagv1.2.1
. - Lay the groundwork for the next release on this branch.
Do this by setting
MICRO = 2
,IS_RELEASED = False
, and committing those changes. Do not tag the commit as a release. The state of this branch is effectively a pre-release of CVXPY 1.2.2.
Deployments to PyPI are automatically triggered for every tagged commit of the release process described above.
This workflow is defined as a GitHub action and can be found here.
The progress of the deploy can be inspected by opening the workflow run marked with v*
from the actions tab.
After a successful deployment, the result should be verified on PyPI. In particular, for both cvxpy and cvxpy-base source files as well as all expected wheel files should be present.
If the action fails intermittently, e.g., because of time-outs during the installation of the dependencies, it can be retriggered from the actions tab.
If changes are required, the DEPLOY
variable needs to be set manually in the workflow to allow deploys from a non-tagged commit.
The following remarks are based on @h-vetinari's comment on this GitHub Pull Request.
Upon creating a tagged commit in the cvxpy repo, a bot will open an upgrade PR on cvxpy's conda-forge feedstock. All necessary changes will be concentrated in recipe/meta.yaml. The changes include
- updating dependency requirements,
- updating the version number, and
- adding the hash of the sources.
The conda-forge bot will handle (2) and (3) automatically. Any changes to (1) require manual intervention but are rare.
Once the PR is opened the conda-forge bot will build the packages and run the full test suite (except for cross-compiled architectures like osx-arm). If there are failures, then the PR is not mergeable (resp. no artefacts will be uploaded for failing jobs once merged). The updated cvxpy release will be available on conda-forge after the PR is merged. Merging PRs needs maintainership rights on the feedstock (which several cvxpy-people have)
If issues come up then we can ask h-vetinari or conda-forge/core for help, although we should only ping conda-forge/core if h-vetinari is unavailable.
An import note: cvxpy's conda-forge feedstock includes a patch to remove pyproject.toml
,
because it ignores and tramples over the required build dependencies as conda-forge sets them up.
If this file has changed between versions, the old patch will fail to apply and will need to be rebased.
The web documentation is built and deployed using a GitHub action that can be found here.
To deploy the docs for a specific version, navigate to the actions tab and select the docs
workflow.
Under Use workflow from
, select the Tags tab and choose the version you want to deploy the docs for.
This builds the docs and commits them to the gh-pages
branch. This in turn triggers the deployment through the github-pages bot
, which can also be monitored in the actions tab.
After the deployment, make sure that the docs are accessible through the browser, and the version selector displays all expected versions.