There are 3 Python packages (plotly, plotly-geo and chart-studio) which need to be
published to PyPI and conda, and 1 JS packages (jupyterlab-plotly)
which need to be published to NPM. In addition, there are various changelogs, github
releases and forum announcements to do :)
This is the release process for releasing plotly.py version X.Y.Z with
jupyterlab-plotly with matching versions.
Note: it's easier to lock the JS extension and Python versions together, even if it means we occasionally push no-change versions to NPM/PyPI/Conda.
Review the contents of packages/python/plotly/CHANGELOG.md. We try to follow
the keepachangelog guidelines.
Make sure the changelog includes the version being published at the top, along
with the expected publication date.
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 branch git checkout -b release-X.Y.Z from the tip of origin/master.
Manually update the versions to X.Y.Z in the files specified below.
CHANGELOG.md- update the release date
packages/python/plotly/README.md- this must be done at this point because the README gets baked into PyPI
plotly/_widget_version.py:- Update
__frontend_version__to^X.Y.Z(Note the^prefix)
- Update
packages/javascript/jupyterlab-plotly/package.json- Update
"version"toX.Y.Z
- Update
packages/javascript/jupyterlab-plotly/package-lock.json- Update
"version"toX.Y.Z
- Update
- Commit your changes on the branch:
git commit -a -m "version changes for vX.Y.Z"
- Commit and add this specific tag which
versioneerwill pick up, and push to Github so that CI will build the release artifacts. This is an atomic push so that CI will read the tag on the commit:git tag vX.Y.Zgit push --atomic origin release-X.Y.Z vX.Y.Z
- Create a Github pull request from
release-X.Y.Ztomasterand wait for CI to be green - If something goes wrong below, you'll need to trigger the build process again after a fix. You'll need to commit your changes in the release branch, move the tag and atomically force push:
git commit ....git tag -f vX.Y.Zgit push --force --atomic origin release-X.Y.Z vX.Y.Z
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 contained within will contain version numbers.
Note: if any of the version numbers are not simply X.Y.Z but include some kind of git hash, then this is a dirty build and you'll need to clean up whatever is dirtying the tree and follow the instructions above to trigger the build again. (That said, you can do QA on dirty builds, you just can't publish them.)
To locally install the PyPI dist, make sure you have an environment with JupyterLab 3 installed:
tar xzf all.tgzpip uninstall plotlyconda uninstall plotly(just in case!)pip install path/to/output/dist/plotly-X.Y.X-py2.py3-none-any.whl
To locally install the Conda dist (generally do this in a different, clean environment from the one above!):
conda uninstall plotlypip uninstall plotly(just in case!)conda install path/to/output/plotly-X.Y.Z.tar.bz2
It's more complicated to locally install the NPM bundle, as you'll need to have a JupyterLab 2 environment installed... Undocumented for now 🙈.
You'll want to check, in both Lab and Notebook, in a brand new notebook in each so that there is no caching of previous results, that go.Figure() and go.FigureWidget() work without error.
If something is broken, you'll need to fix it and trigger the build again (see above section).
Once you're satisfied that things render in Lab and Notebook in Widget and regular mode, you can publish the artifacts. You will need special credentials from Plotly leadership to do this..
Publishing to PyPI:
(plotly_dev) $ cd path/to/output/dist
(plotly_dev) $ twine upload plotly-X.Y.Z*Publishing to NPM:
(plotly_dev) $ cd path/to/output
(plotly_dev) $ npm publish jupyterlab-plotly-X.Y.Z.tgzPublishing to plotly conda channel (make sure you have run conda install anaconda-client to get the anaconda command):
(plotly_dev) $ cd path/to/output
(plotly_dev) $ anaconda upload plotly-X.Y.Z.tar.bz2
- Merge the pull request you created above into
master - Go to https://github.com/plotly/plotly.py/releases and "Draft a new release"
- Enter the
vX.Y.Ztag you created already above and make "Release title" the same string as the tag. - Copy the changelog section for this version as the "Describe this release"
- Search for the previous version string in the docs and replace it with the new version string, including but not necessarily limited to the following files:
doc/python/getting-started.mddoc/apidoc/conf.pydoc/requirements.txtbinder/requirements.txt
doc-prodshould already have been merged on a regular basis intomaster, but start by doing it first if not. Then mergemasterintodoc-prodto deploy the doc related to features in the release.- in a clone of the
graphing-library-docsrepo:- bump the version of Plotly.py in
_data/pyversion.json - bump the version of Plotly.js with
cd _data && python get_plotschema.py <PLOTLY.JS VERSION>fixing any errors that come up - rebuild the Algolia
schemaindex withALGOLIA_API_KEY=<key> make update_ref_search - Rebuild the Algolia
pythonindex withALGOLIA_API_KEY=<key> make update_python_search - Commit and push the changes to
masterin that repo
- bump the version of Plotly.py in
- Post an announcement to the Plotly Python forum, with links to the README installation instructions and to the CHANGELOG.
- Update the previous announcement to point to this one
- Update the Github Release entry and CHANGELOG entry to have the nice title and a link to the announcement
- Follow up on issues resolved in this release or forum posts with better answers as of this release
(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*NPM RC:
npm publish --access public --tag next jupyterlab-plotly.*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.
Conda RC:
$ anaconda upload --label test plotly-*.tar.bz2
The --label test part ensures that users won't install this version unless
they explicitly ask for the version or for the version with the next tag.
The plotly-geo package contains the shape file resources used by plotly.py.
These files are relatively large and change infrequently so it is useful
to release them in a separate package.
Update the version of the plotly-geo package in
packages/python/plotly-geo/setup.py.
This version is not intended to match the version of plotly.py.
Add a new entry to the CHANGELOG at packages/python/plotly-geo/CHANGELOG.md
and commit the changes.
Create a new tag for the release
(plotly_dev) $ git checkout master
(plotly_dev) $ git stash
(plotly_dev) $ git pull origin master
(plotly_dev) $ git tag plotly-geo-vX.Y.Z
(plotly_dev) $ git push origin plotly-geo-vX.Y.ZPublish the final version to PyPI
(plotly_dev) $ cd packages/python/plotly-geo
(plotly_dev) $ python setup.py sdist bdist_wheel
(plotly_dev) $ twine upload dist/plotly-geo-X.Y.Z.tar.gz
(plotly_dev) $ twine upload dist/plotly_geo-X.Y.Z-py3-none-any.whlFrom packages/python/plotly-geo, build the conda package
(plotly_dev) $ conda build recipe/Then upload to the plotly anaconda channel as described above
The chart-studio package contains the utilities for interacting with
Chart Studio (both Cloud or On-Prem).
Update the version of the chart-studio package in
packages/python/chart-studio/setup.py.
This version is not intended to match the version of plotly.py.
Add a new entry to the CHANGELOG at packages/python/chart-studio/CHANGELOG.md
and commit the changes.
Create a new tag for the release
(plotly_dev) $ git checkout master
(plotly_dev) $ git stash
(plotly_dev) $ git pull origin master
(plotly_dev) $ git tag chart-studio-vX.Y.Z
(plotly_dev) $ git push origin chart-studio-vX.Y.ZPublish the final version to PyPI
(plotly_dev) $ cd packages/python/chart-studio
(plotly_dev) $ python setup.py sdist bdist_wheel
(plotly_dev) $ twine upload dist/chart-studio-X.Y.Z.tar.gz
(plotly_dev) $ twine upload dist/chart_studio-X.Y.Z-py3-none-any.whlFrom packages/python/plotly-geo, build the conda package
(plotly_dev) $ conda build recipe/Then upload to the plotly anaconda channel as described above.