RELEASE.md
plotly packageThis is the release process for releasing plotly.py version X.Y.Z, including changelogs, GitHub release and forum announcement.
Review the contents of CHANGELOG.md under the Unreleased header. We try to follow
the keepachangelog guidelines.
Note: You don't need to update the header itself with the new version number, as that will be done automatically as part of the next step.
Use the Added, Changed, Deprecated, Removed, Fixed, and Security
labels for all changes to plotly.py. If the version of plotly.js has
been updated, include this as the first Updated entry. Call out any
notable changes as sub-bullets (new trace types in particular), and provide
a link to the plotly.js CHANGELOG.
Create a release branch git checkout -b release-X.Y.Z from the tip of origin/main.
Ensure that you have npm and uv installed in your environment
Run the command python commands.py bumpversion X.Y.Z, which will update the version to X.Y.Z in the following places
pyproject.tomluv.lockjs/package.jsonjs/package-lock.jsonCHANGELOG.md (Adds a new header for X.Y.Z above the unreleased items)CITATION.cffRun git diff and ensure the above files were all updated correctly.
CHANGELOG.md and CITATION.cff. If you want to use a different date, edit these files manually afterward.pyproject.toml, CHANGELOG.md and CITATION.cffnpm version X.Y.Z to update js/package.json and js/package-lock.jsonuv lock to update uv.lockCommit and push the changed files to the release branch:
$ git add -u
$ git commit -m "version changes for vX.Y.Z"
$ git push
Create a GitHub pull request from release-X.Y.Z to main and wait for CI to be green
On the release branch, create and push a tag for the release:
$ git tag vX.Y.Z
$ git push origin vX.Y.Z
We don't currently have automated tests for Jupyter, so we do this QA step manually.
The full_build job in the release_build workflow in CircleCI produces a tarball of artifacts output.tgz
which you should download and decompress, which will give you a directory called output. The filenames within
will contain version numbers; make sure the version numbers are correct.
Set up an environment with Jupyter, AnyWidget, and Pandas installed (pip install jupyter anywidget pandas). Then:
output.tgzpip uninstall plotlypip install path/to/output/dist/plotly-X.Y.Z-py3-none-any.whlYou'll want to check, in both JupyterLab (launch with jupyter lab) and Jupyter Notebook (launch with jupyter notebook),
that go.Figure() and go.FigureWidget() work as expected.
Notes:
plotly.py/ directory on your machine because Jupyter may be confused
by metadata from previous plotly.py buildsCode for testing go.Figure():
import plotly
import plotly.graph_objects as go
print(plotly.__version__) # Make sure version is correct
fig = go.Figure(data=go.Scatter(x=[1, 2, 3, 4], y=[1, 3, 2, 4]))
fig.show() # Figure should render in notebook
Code for testing go.FigureWidget():
import plotly
import plotly.graph_objects as go
print(plotly.__version__) # Make sure version is correct
fig = go.Figure(data=go.Scatter(x=[1, 2, 3, 4], y=[1, 3, 2, 4]))
figure_widget = go.FigureWidget(fig)
figure_widget # Figure should render in notebook
Once these are verified working, you can move on to publishing the release.
mainvX.Y.Z tag you created already above and make "Release title" the same string as the tag..tar and .whl)The final step is to publish the release to PyPI. You will need special permissions from Plotly leadership to do this..
You must install first install Twine (pip install twine) if not already installed.
Publishing to PyPI:
(plotly_dev) $ cd path/to/output
(plotly_dev) $ twine upload plotly-X.Y.Z*
You will be prompted to enter an API token; this can be generated in your PyPI account settings.
Your account must have permissions to publish to the plotly project on PyPI.
doc/apidoc/conf.pydoc/requirements.txtdoc-prod should already have been merged on a regular basis into main, but
start by doing it first if not. Then merge main into doc-prod to deploy the doc related
to features in the release.graphing-library-docs repo:
_data/pyversion.jsoncd _data && python get_plotschema.py <PLOTLY.JS VERSION> fixing any errors that come up.“missing key in attributes: <attribute-name>. To resolve, add the attribute to the relevant section in /_data/orderings.json in the position you want it to appear in the reference docs.schema index with ALGOLIA_API_KEY=<key> make update_ref_searchpython index with ALGOLIA_API_KEY=<key> make update_python_searchmaster in that repoplotly package(rough notes for a rough/ad hoc process!)
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.
PyPI RC (no special flags, just the rc1 suffix):
(plotly_dev) $ twine upload dist/plotly-X.Y.Zrc1*
The --tag next part ensures that users won't install this version unless
they explicitly ask for the version or for the version with the next tag.