|
| 1 | +## Releasing `ipydatagrid` |
| 2 | + |
| 3 | +### Tagging and creating a publishing environment |
| 4 | + |
| 5 | +1. Create a new release branch: `git checkout -n release_1.0.x` (**replace .x with the actual version**). |
| 6 | +2. Bump the version in `package.json` and `ipydatagrid/._version.py`. |
| 7 | +3. Save, sign and commit your changes: `git commit -s -m "Release 1.0.x"`. |
| 8 | +4. Open a PR with your release branch: `git push -u origin release_1.0.x`. |
| 9 | +5. Once your PR has been merged (!), pull the new main branch `git checkout main && git pull upstream main`. |
| 10 | +6. Add a new release tag: `git tag -a 1.0.x -m "Release 1.0.x"`. |
| 11 | +7. Push the new tag to GitHub: `git push upstream --tags`. |
| 12 | +8. Create a new conda environment: `conda create -n release_grid -c conda-forge python=3.8 python-build`. |
| 13 | +9. Activate the environment: `conda activate release_grid`. |
| 14 | + |
| 15 | +### Releasing on pypi |
| 16 | + |
| 17 | +8. Make sure the `dist` folder under the `ipydatagrid` root folder is empty - delete previous release tarballs if they're present. |
| 18 | +9. Build the Python release by running `python -m build` in the root directory. |
| 19 | +10. Check the `dist` folder for the output from the build process. You should see the following files: |
| 20 | + - ipydatagrid-1.0.x-py3-none-any.whl |
| 21 | + - ipydatagrid-1.0.x.tar.gz |
| 22 | + - index.js |
| 23 | + - index.js.map |
| 24 | + - index.js.LICENSE.txt |
| 25 | +11. Delete all \*.js, \*.map and \*.txt files: `rm *.js *.map *.txt`. Only the wheel and tarball files should remain. |
| 26 | +12. Inspect the contents of the tarball to see everything is in check: `tar -tvf ipydatagrid-1.0.x.tar.gz`. |
| 27 | +13. Install `twine` by running `pip install twine`. |
| 28 | +14. Once `twine` is installed, upload the Python release to pypi: `twine upload dist/*`. You will need to have upload credentials for `ipydatagrid` on pypi for this step to work. If the step was successful, you should see an output similar to the one below: |
| 29 | + |
| 30 | +```bash |
| 31 | +Uploading ipydatagrid-1.0.x-py3-none-any.whl |
| 32 | +100%|████████████████████████████████████████████████████████████████████████████████████████████| 3.38M/3.38M [00:04<00:00, 720kB/s] |
| 33 | +Uploading ipydatagrid-1.0.x.tar.gz |
| 34 | +100%|███████████████████████████████████████████████████████████████████████████████████████████| 22.4M/22.4M [00:07<00:00, 3.22MB/s] |
| 35 | + |
| 36 | +View at: |
| 37 | +https://pypi.org/project/ipydatagrid/1.0.x/ |
| 38 | +``` |
| 39 | + |
| 40 | +### Releasing on npm |
| 41 | + |
| 42 | +15. In the root folder of the `ipydatagrid`, run `npm publish --dry-run`. This will perform a dry run release so you can check everything looks right before an actual release. It should generate an output similar to the one below: |
| 43 | + |
| 44 | +```bash |
| 45 | +webpack 5.34.0 compiled with 3 warnings in 93596 ms |
| 46 | +npm notice |
| 47 | + |
| 48 | +npm notice === Tarball Contents === |
| 49 | +npm notice 4.5kB style/feathergrid.css |
| 50 | +npm notice 56B style/jupyter-widget.css |
| 51 | +npm notice 4.5kB lib/core/barrenderer.js |
| 52 | +npm notice 11.1kB lib/cellrenderer.js |
| 53 | +npm notice 165.1kB lib/core/datagrid.js |
| 54 | +npm notice 19.5kB lib/datagrid.js |
| 55 | +npm notice 1.3kB lib/extension.js |
| 56 | +npm notice 30.4kB lib/feathergrid.js |
| 57 | +npm notice 45.1kB lib/core/filterMenu.js |
| 58 | +npm notice 13.7kB lib/core/graphicscontext.js |
| 59 | +npm notice 5.2kB lib/core/gridContextMenu.js |
| 60 | +npm notice 13.6kB lib/core/headerRenderer.js |
| 61 | +npm notice 1.1MB dist/index.js |
| 62 | +npm notice 930B lib/index.js |
| 63 | +npm notice 1.4kB lib/keyhandler.js |
| 64 | +npm notice 3.1kB lib/plugin.js |
| 65 | +npm notice 114B lib/core/transform.js |
| 66 | +npm notice 10.8kB lib/core/transformExecutors.js |
| 67 | +npm notice 7.1kB lib/core/transformStateManager.js |
| 68 | +npm notice 6.2kB lib/utils.js |
| 69 | +npm notice 4.6kB lib/core/valueRenderer.js |
| 70 | +npm notice 3.8kB lib/vegaexpr.js |
| 71 | +npm notice 584B lib/version.js |
| 72 | +npm notice 7.8kB lib/core/view.js |
| 73 | +npm notice 16.7kB lib/core/viewbasedjsonmodel.js |
| 74 | +npm notice 4.0kB package.json |
| 75 | +npm notice 3.1kB lib/core/barrenderer.js.map |
| 76 | +npm notice 7.7kB lib/cellrenderer.js.map |
| 77 | +npm notice 128.2kB lib/core/datagrid.js.map |
| 78 | +npm notice 15.8kB lib/datagrid.js.map |
| 79 | +npm notice 368B lib/extension.js.map |
| 80 | +npm notice 22.8kB lib/feathergrid.js.map |
| 81 | +npm notice 31.4kB lib/core/filterMenu.js.map |
| 82 | +npm notice 13.1kB lib/core/graphicscontext.js.map |
| 83 | +npm notice 2.8kB lib/core/gridContextMenu.js.map |
| 84 | +npm notice 10.6kB lib/core/headerRenderer.js.map |
| 85 | +npm notice 4.3MB dist/index.js.map |
| 86 | +npm notice 189B lib/index.js.map |
| 87 | +npm notice 689B lib/keyhandler.js.map |
| 88 | +npm notice 1.6kB lib/plugin.js.map |
| 89 | +npm notice 117B lib/core/transform.js.map |
| 90 | +npm notice 8.4kB lib/core/transformExecutors.js.map |
| 91 | +npm notice 4.9kB lib/core/transformStateManager.js.map |
| 92 | +npm notice 4.1kB lib/utils.js.map |
| 93 | +npm notice 3.7kB lib/core/valueRenderer.js.map |
| 94 | +npm notice 2.7kB lib/vegaexpr.js.map |
| 95 | +npm notice 287B lib/version.js.map |
| 96 | +npm notice 4.1kB lib/core/view.js.map |
| 97 | +npm notice 9.9kB lib/core/viewbasedjsonmodel.js.map |
| 98 | +npm notice 4.6kB README.md |
| 99 | +npm notice 416B style/icons/arrow-down-short-dark.svg |
| 100 | +npm notice 416B style/icons/arrow-down-short.svg |
| 101 | +npm notice 400B style/icons/arrow-up-short-dark.svg |
| 102 | +npm notice 400B style/icons/arrow-up-short.svg |
| 103 | +npm notice 349B style/icons/filter-dark.svg |
| 104 | +npm notice 349B style/icons/filter.svg |
| 105 | +npm notice 3.8kB lib/core/barrenderer.d.ts |
| 106 | +npm notice 4.5kB lib/cellrenderer.d.ts |
| 107 | +npm notice 38.0kB lib/core/datagrid.d.ts |
| 108 | +npm notice 2.6kB lib/datagrid.d.ts |
| 109 | +npm notice 25B lib/extension.d.ts |
| 110 | +npm notice 3.9kB lib/feathergrid.d.ts |
| 111 | +npm notice 10.0kB lib/core/filterMenu.d.ts |
| 112 | +npm notice 5.5kB lib/core/graphicscontext.d.ts |
| 113 | +npm notice 3.3kB lib/core/gridContextMenu.d.ts |
| 114 | +npm notice 2.5kB lib/core/headerRenderer.d.ts |
| 115 | +npm notice 103B lib/index.d.ts |
| 116 | +npm notice 584B lib/keyhandler.d.ts |
| 117 | +npm notice 231B lib/plugin.d.ts |
| 118 | +npm notice 1.6kB lib/core/transform.d.ts |
| 119 | +npm notice 3.2kB lib/core/transformExecutors.d.ts |
| 120 | +npm notice 2.7kB lib/core/transformStateManager.d.ts |
| 121 | +npm notice 1.4kB lib/utils.d.ts |
| 122 | +npm notice 1.4kB lib/core/valueRenderer.d.ts |
| 123 | +npm notice 1.4kB lib/vegaexpr.d.ts |
| 124 | +npm notice 262B lib/version.d.ts |
| 125 | +npm notice 4.7kB lib/core/view.d.ts |
| 126 | +npm notice 11.8kB lib/core/viewbasedjsonmodel.d.ts |
| 127 | +npm notice 1.5kB LICENSE.txt |
| 128 | +npm notice === Tarball Details === |
| 129 | +npm notice name: ipydatagrid |
| 130 | +npm notice version: 1.0.5 |
| 131 | +npm notice package size: 1.3 MB |
| 132 | +npm notice unpacked size: 6.2 MB |
| 133 | +npm notice shasum: f8743bf45c0667b2f99631b73f5df465534549fc |
| 134 | +npm notice integrity: sha512-4E1xna+4Sy33k[...]eQx2mpnwvYKOw== |
| 135 | +npm notice total files: 79 |
| 136 | +npm notice |
| 137 | + |
| 138 | +``` |
| 139 | + |
| 140 | +One specific item to watch for is the inclusion of `dist/index.js` in the output generated by the console, as that's the file being used by CDNs, which `voila` relies on as a fallback. |
| 141 | + |
| 142 | +16. If everything looks right, you can now publish to NPM. Login to NPM: `npm login` and enter your credentials. |
| 143 | +17. Run `npm publish` in the root directory of `ipydatagrid`. You will need to have upload credentials for `ipydatagrid` on NPM for this step to work. If the publishing step was successful, you will see an output on your console which is similar to the one from step (15). |
| 144 | + |
| 145 | +### Cleaning up the release environment |
| 146 | + |
| 147 | +18. Deactivate the release environment: `conda deactivate`. |
| 148 | +19. Delete the release environment: `conda env remove -n release_grid`. |
| 149 | + |
| 150 | +Congratulations! You successfully published `ipydatagrid`! |
0 commit comments