11
22# How to release plotly packages
33
4- ## Release process - plotly package
4+ There are 3 Python packages (` plotly ` , ` plotly-geo ` and ` chart-studio ` ) which need to be
5+ published to PyPI and conda, and 2 JS packages (` jupyterlab-plotly ` and ` plotlywdiget ` )
6+ which need to be published to NPM. In addition, there are various changelogs, github
7+ releases and forum announcements to do :)
8+
9+ ## Release process - ` plotly ` package and extensions
510
611This is the release process for releasing ` plotly.py ` version ` X.Y.Z ` with
712` plotlywidget ` /` jupyterlab-plotly ` with matching versions.
@@ -10,11 +15,13 @@ Note: it's easier to lock all three versions together, even if it means we occas
1015push no-change versions to NPM/PyPI/Conda.
1116
1217### Create a release branch
18+
1319After all of the functionality for the release has been merged into master,
1420create a branch named ` release_X.Y.Z ` . This branch will become the
1521final version
1622
1723### Finalize changelog
24+
1825Review the contents of ` packages/python/plotly/CHANGELOG.md ` . We try to follow
1926the [ keepachangelog] ( https://keepachangelog.com/en/1.0.0/ ) guidelines.
2027Make sure the changelog includes the version being published at the top, along
@@ -50,18 +57,19 @@ Update the `doc/python/getting-started.md` file with the same version numbers.
5057Commit Changelog, README and getting-started updates.
5158
5259### Bump to release candidate version
53- 1 ) Manually update the plotlywidget version to ` X.Y.Z-rc.1 ` in the files
60+
61+ 1 ) Manually update the versions to ` X.Y.Z-rc.1 ` in the files
5462specified below.
5563
5664 - ` packages/python/plotly/plotly/_widget_version.py ` :
5765 + Update ` __frontend_version__ ` to ` ^X.Y.Z-rc.1 ` (Note the ` ^ ` prefix)
5866 - ` packages/javascript/plotlywidget/package.json `
5967 + Update ` "version" ` to ` X.Y.Z-rc.1 `
60- + Ensure you're using ` node ` version 8 and ` npm ` version 6 to minimize diffs to ` package-lock.json `
68+ + Ensure you're using ` node ` version 12 and ` npm ` version 6 to minimize diffs to ` package-lock.json `
6169 + Run ` rm -rf node_modules && npm install && npm run build `
6270 - ` packages/javascript/jupyterlab-plotly/package.json `
6371 + Update ` "version" ` to ` X.Y.Z-rc.1 `
64- + Ensure you're using ` node ` version 8 and ` npm ` version 6 to minimize diffs to ` package-lock.json `
72+ + Ensure you're using ` node ` version 12 and ` npm ` version 6 to minimize diffs to ` package-lock.json `
6573 + Run ` rm -rf node_modules && npm install && npm run build `
6674
6775 2 ) Commit the changes
@@ -82,13 +90,13 @@ that their bug reports are in fact resolved before we pull the trigger
8290on the official release.
8391
8492### Publish release candidate to PyPI
93+
8594To upload to PyPI you'll also need to have ` twine ` installed:
8695``` bash
8796(plotly_dev) $ pip install twine
8897```
8998
90- And, you'll need the credentials file ` ~/.pypirc ` . Request access from
91- @jonmmease and @chriddyp . Then, from inside the repository:
99+ And, you'll need to be a maintainer on PyPI. Then, from inside the repository:
92100
93101``` bash
94102(plotly_dev) $ cd packages/python/plotly
@@ -104,8 +112,9 @@ Note: this will intentionally fail if your current git tree is dirty, because we
104112to reflect what is being released, and the version number comes from the tag and the dirty-state.
105113
106114
107- ### Publish release candidate of ` plotlywidget ` and ` jupyterlab-plotly ` to NPM
108- Now, publish the release candidate of the ` plotlywidget ` NPM package.
115+ ### Publish release candidate of JS Extensions to NPM
116+
117+ Now, publish the release candidate of the extensions to NPM.
109118
110119``` bash
111120cd ./packages/javascript/plotlywidget
@@ -118,6 +127,7 @@ they explicitly ask for the version or for the version wtih the `next` tag.
118127Do the same in the ` jupyterlab-plotly ` directory.
119128
120129### Publish release candidate to plotly anaconda channel
130+
121131To publish package to the plotly anaconda channel you'll need to have the
122132anaconda or miniconda distribution installed, and you'll need to have the
123133` anaconda-client ` package installed.
@@ -141,6 +151,7 @@ $ anaconda upload --label test /path/to/anaconda3/conda-bld/noarch/plotly-*.tar.
141151Then logout with ` anaconda logout `
142152
143153### Manually test the release candidate
154+
144155Create a fresh virtual environment (or conda environment) and install
145156the release candidate by following the new ` README.md ` instructions
146157(the instructions updated above to include the release candidate versions)
@@ -158,6 +169,7 @@ branch and then publish another release candidate with the candidate number
158169incremented.
159170
160171### Finalize CHANGELOG and README
172+
161173Update CHANGELOG with release date and update README with final versions.
162174
163175In the conda installation instructions, be sure to change the
@@ -168,24 +180,26 @@ Update the doc/python/getting-started.md file with the same version numbers.
168180Commit Changelog, README and getting-started updates.
169181
170182### Finalize versions
183+
171184When no problems are identified in the release candidate, remove the
172185release candidate suffix from the following version strings:
173186
174187 - ` plotly/_widget_version.py ` :
175188 + Update ` __frontend_version__ ` to ` ^X.Y.Z ` (Note the ` ^ ` prefix)
176189 - ` packages/javascript/plotlywidget/package.json `
177190 + Update ` "version" ` to ` X.Y.Z `
178- + Ensure you're using ` node ` version 8 and ` npm ` version 6 to minimize diffs to ` package-lock.json `
191+ + Ensure you're using ` node ` version 12 and ` npm ` version 6 to minimize diffs to ` package-lock.json `
179192 + Run ` rm -rf node_modules && npm install && npm run build `
180193 - ` packages/javascript/jupyterlab-plotly/package.json `
181194 + Update ` "version" ` to ` X.Y.Z `
182- + Ensure you're using ` node ` version 8 and ` npm ` version 6 to minimize diffs to ` package-lock.json `
195+ + Ensure you're using ` node ` version 12 and ` npm ` version 6 to minimize diffs to ` package-lock.json `
183196 + Run ` rm -rf node_modules && npm install && npm run build `
184197 - Run ` git diff ` and ensure that only the files you modified and the build artifacts have changed
185198 - Ensure that the diff in ` package-lock.json ` seems sane
186199 - Commit and push to the release branch.
187200
188201### Merge release into master
202+
189203Make sure the integration tests are passing on the release branch, then merge
190204it into master on GitHub.
191205
@@ -202,7 +216,7 @@ push the tag.
202216(plotly_dev) $ git push origin vX.Y.Z
203217```
204218
205- ### Publishing to PYPI
219+ ### Publishing to PyPI
206220
207221Publish the final version to PyPI
208222
@@ -224,10 +238,9 @@ $ pip install plotly --upgrade
224238
225239And ask one of your friends to do it too. Our tests should catch any issues, but you never know.
226240
227- <3 Team Plotly
241+ ### Publish JS Extensions to NPM
228242
229- ### Publish widget library to npm
230- Finally, publish the final version of the widget library to npm with:
243+ Finally, publish the final version of the extensions to NPM with:
231244
232245``` bash
233246cd packages/javascript/jupyterlab-plotly
@@ -237,6 +250,7 @@ npm run build && npm publish --access public
237250```
238251
239252### Publishing to the plotly conda channel
253+
240254Follow the anaconda upload instructions as described for the release candidate
241255above, except:
242256
@@ -247,6 +261,7 @@ $ anaconda upload /path/to/anaconda3/conda-bld/noarch/plotly-*.tar.bz2
247261```
248262
249263### Add GitHub Release entry
264+
250265Go to https://github.com/plotly/plotly.py/releases and "Draft a new release"
251266
252267Enter the vX.Y.Z tag
@@ -269,25 +284,30 @@ start doing it first. Then merge master into doc-prod to deploy the doc related
269284to features in the release.
270285
271286### Post announcement
272- Post a simple announcement to the Plotly Python forum, with links to the
287+
288+ Post an announcement to the Plotly Python forum, with links to the
273289README installation instructions and to the CHANGELOG.
274290
275- ## Release process - plotly-geo package
291+ ## Release process - ` plotly-geo ` package
292+
276293The ` plotly-geo ` package contains the shape file resources used by plotly.py.
277294These files are relatively large and change infrequently so it is useful
278295to release them in a separate package.
279296
280297### Update version
298+
281299Update the version of the ` plotly-geo ` package in
282300` packages/python/plotly-geo/setup.py ` .
283301
284302This version is not intended to match the version of plotly.py.
285303
286304### Update CHANGELOG
305+
287306Add a new entry to the CHANGELOG at ` packages/python/plotly-geo/CHANGELOG.md `
288307and commit the changes.
289308
290309### Tag Release
310+
291311Create a new tag for the release
292312
293313``` bash
@@ -299,6 +319,7 @@ Create a new tag for the release
299319```
300320
301321### Publishing to PYPI
322+
302323Publish the final version to PyPI
303324
304325``` bash
@@ -309,28 +330,33 @@ Publish the final version to PyPI
309330```
310331
311332### Publish to plotly anaconda channel
333+
312334From ` packages/python/plotly-geo ` , build the conda packge
313335``` bash
314336(plotly_dev) $ conda build recipe/
315337```
316338
317339Then upload to the plotly anaconda channel as described above
318340
319- ## Release process - chart-studio package
341+ ## Release process - ` chart-studio ` package
342+
320343The ` chart-studio ` package contains the utilities for interacting with
321344Chart Studio (both Cloud or On-Prem).
322345
323346### Update version
347+
324348Update the version of the ` chart-studio ` package in
325349` packages/python/chart-studio/setup.py ` .
326350
327351This version is not intended to match the version of plotly.py.
328352
329353### Update CHANGELOG
354+
330355Add a new entry to the CHANGELOG at ` packages/python/chart-studio/CHANGELOG.md `
331356and commit the changes.
332357
333358### Tag Release
359+
334360Create a new tag for the release
335361
336362``` bash
@@ -342,6 +368,7 @@ Create a new tag for the release
342368```
343369
344370### Publishing to PYPI
371+
345372Publish the final version to PyPI
346373
347374``` bash
@@ -352,6 +379,7 @@ Publish the final version to PyPI
352379```
353380
354381### Publish to plotly anaconda channel
382+
355383From ` packages/python/plotly-geo ` , build the conda packge
356384``` bash
357385(plotly_dev) $ conda build recipe/
0 commit comments