You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9cbf70e
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: RELEASE.md
+29-37Lines changed: 29 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,8 +10,8 @@ This is the release process for releasing plotly.py version `X.Y.Z`, including c
10
10
Ensure you have the following installed:
11
11
12
12
*`uv>=0.12.15`
13
-
*`twine>=7.0.0`
14
13
* A virtual environment: `uv venv`
14
+
* Membership of the `libraries_admin` GitHub team, which approves publishing to PyPI
15
15
16
16
### Prepare local environment
17
17
@@ -63,26 +63,35 @@ a link to the plotly.js CHANGELOG.
63
63
$ git commit -m "version changes for vX.Y.Z"
64
64
$ git push
65
65
```
66
-
- Create a GitHub pull request from `release-X.Y.Z` to `main` and waitfor CI to be green
67
-
- On the release branch, create and push a tag for the release:
66
+
- Create a GitHub pull request from `release-X.Y.Z` to `main`, waitfor CI to be green, and merge it
67
+
- Create and push the tag on the merge commit on `main`. The publish workflow rejects tags that are not reachable from `main`:
68
68
```sh
69
+
$ git switch main && git pull
69
70
$ git tag vX.Y.Z
70
71
$ git push origin vX.Y.Z
71
72
```
72
73
74
+
### Start the publish workflow
75
+
76
+
1. Go to the [Publish to PyPI workflow](https://github.com/plotly/plotly.py/actions/workflows/publish-pypi.yml) and choose "Run workflow".
77
+
2. Leave the branch as `main` (the `pypi` environment only deploys from `main`) and enter the tag, for example `v7.1.0` or `v7.1.0rc0`.
78
+
3. The workflow validates the tag, builds the wheel and sdist from it once, and checks that the wheel and sdist (which are named after the version in`pyproject.toml`) carry the tag's version. It then waits for approval of the `pypi` environment.
79
+
80
+
The accepted tag shapes are `vX.Y.Z`, `vX.Y.ZaN`, `vX.Y.ZbN` and `vX.Y.ZrcN`. Anything else (`.dev`, `.post`, `-rc.1`) is rejected before anything is built.
81
+
73
82
### Manual QA in Jupyter
74
83
75
-
We don't currently have automated tests for Jupyter, so we do this QA step manually.
84
+
We don't currently have automated tests for Jupyter, so we do this QA step manually, while the workflow waits for approval.
76
85
77
-
The `full_build` job in the `release_build` workflow in CircleCI produces a tarball of artifacts `output.tgz`
78
-
which you should download and decompress, which will give you a directory called `output`. The filenames within
79
-
will contain version numbers; make sure the version numbers are correct.
86
+
When the `build` job finishes, open the workflow run and download the `dist` artifact. The filenames
87
+
will contain version numbers; make sure the version numbers are correct. These are the exact files
88
+
that will be uploaded to PyPI and attached to the GitHub release.
80
89
81
90
Set up an environment with Jupyter, AnyWidget, and Pandas installed (`pip install jupyter anywidget pandas`). Then:
You'll want to check, in both JupyterLab (launch with `jupyter lab`) and Jupyter Notebook (launch with `jupyter notebook`),
88
97
that `go.Figure()` and `go.FigureWidget()` work as expected.
@@ -115,29 +124,16 @@ figure_widget # Figure should render in notebook
115
124
116
125
Once these are verified working, you can move on to publishing the release.
117
126
118
-
### Merge the release PR and make a GitHub release
127
+
### Publish the GitHub release
119
128
120
-
- Merge the pull request you created above into `main`
121
-
- Go to https://github.com/plotly/plotly.py/releases and "Draft a new release"
122
-
- Enter the `vX.Y.Z` tag you created already above and make "Release title" the same string as the tag.
123
-
- Copy the changelog section for this version into "Describe this release"
124
-
- Upload the build artifacts downloaded in the previous step (`.tar` and `.whl`)
129
+
**Only members of the `libraries_admin` team can approve publishing to PyPI.**
125
130
126
-
### Publishing to PyPI
131
+
1. In the workflow run, choose "Review deployments", select `pypi`, and approve. To abandon the release, reject instead; nothing is uploaded and no GitHub release is created.
132
+
2. The workflow uploads the QA'd files to PyPI with trusted publishing (no API token needed).
133
+
3. Only after PyPI accepts the files, the workflow creates a draft GitHub release for the tag with the same files attached and the notes copied from the version's section of `CHANGELOG.md`. The pre-release flag is set from the version (`a`, `b` and `rc` versions are pre-releases), and the workflow fails if the flag and the version disagree.
134
+
4. Review the notes on the draft release, then publish it. Publishing the draft triggers nothing further.
127
135
128
-
The final step is to publish the release to PyPI. **You will need special permissions from Plotly leadership to do this.**
129
-
130
-
You must first install [Twine](https://pypi.org/project/twine/) (`pip install twine`) if not already installed.
131
-
132
-
Publishing to PyPI:
133
-
```bash
134
-
(plotly_dev) $ cd path/to/output
135
-
(plotly_dev) $ twine check plotly-X.Y.Z*
136
-
(plotly_dev) $ twine upload plotly-X.Y.Z*
137
-
```
138
-
139
-
You will be prompted to enter an API token; this can be generated in your PyPI account settings.
140
-
Your account must have permissions to publish to the `plotly` project on PyPI.
136
+
If the upload step fails, no GitHub release is created. Fix the cause and re-run the workflow for the same tag; files already on PyPI are skipped. If the GitHub release step fails after PyPI succeeded, delete any partial draft release and re-run.
141
137
142
138
### Update documentation site
143
139
@@ -177,13 +173,9 @@ to features in the release.
177
173
178
174
(rough notes for a rough/ad hoc process!)
179
175
180
-
It's the same process as above except that the `X.Y.Z`version has a suffix and there are special instructions below for publishing an RC: note that the `npm`suffix is `-rc.1` and the PyPI suffix is `rc1`. We also don't update the docs with RC information and we inform a limited number of stakeholders.
176
+
It's the same process as above except that the version has an `a`, `b` or `rc` suffix, for example `python commands.py bumpversion 7.1.0rc0` and tag `v7.1.0rc0`. Alpha and beta versions work the same way. The `npm` form of the version uses a dash (`7.1.0-rc0`) and `npm version` normalizes it automatically during `bumpversion`. We also don't update the docs with RC information and we inform a limited number of stakeholders.
181
177
182
-
PyPI RC (no special flags, just the `rc1` suffix):
183
-
184
-
```bash
185
-
(plotly_dev) $ twine upload dist/plotly-X.Y.Zrc1*
186
-
```
178
+
The publish workflow derives "pre-release" from the version, so no extra flags are needed. A pre-release is uploaded to PyPI as a pre-release and its GitHub release is flagged as a pre-release. A stable version is never flagged as a pre-release, and the other way round.
187
179
188
-
The `rc1` suffix ensures that users won't install this version by default —
189
-
they must explicitly request it (e.g., `pip install plotly==X.Y.Zrc1`).
180
+
Pre-release versions are not installed by default;
181
+
users must explicitly request them (e.g., `pip install plotly==X.Y.ZrcN`).
0 commit comments