diff --git a/RELEASE.md b/RELEASE.md index 6b674f5c..4a12ec7e 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,18 +1,20 @@ -- To release a new version of ipympl on PyPI: + To release a new version of ipympl on PyPI: -# nuke the `dist` and `node_modules` -git clean -fdx +In your local copy of the repo -Update _version.py (set release version, remove 'dev') -git add and git commit -python setup.py sdist upload -python setup.py bdist_wheel upload -git tag -a X.X.X -m 'comment' -Update _version.py (add 'dev' and increment minor) -git add and git commit -git push -git push --tags +1. Switch to the `main` branch +2. Update relevant files + - `ipympl/_version.py` + - `src/version.ts` + - The table in the README + - The table in `docs/installing.md` +3. `git commit -m "release X.Y.Z"` +4. `git push upstream main` -- To release a new version of jupyter-matplotlib on NPM: -npm install -npm publish +Then go to github and draft a new release: https://github.com/matplotlib/ipympl/releases/new + +In the "Choose a tag" dropdown enter the to be released version and allow it to auto create the tag. + +Give the release a title + fill in release details. + +Publish - it should now upload automatically to both pypi and npm. diff --git a/ipympl/_version.py b/ipympl/_version.py index f3b6f97e..4671be22 100644 --- a/ipympl/_version.py +++ b/ipympl/_version.py @@ -1,9 +1,3 @@ -version_info = (0, 9, 0) +version_info = (0, 9, 1) __version__ = '.'.join(map(str, version_info)) - - -# The versions of protocol of communication with the frontend that this python verison knows -# how to speak. See counterpart in the src/version.ts file. -# These should not be changed unless we introduce changes to communication between -# frontend and backend. -__MODEL_VERSION__ = "1.0.0" +js_semver = '^0.11' diff --git a/ipympl/backend_nbagg.py b/ipympl/backend_nbagg.py index f2eda2d3..e740cef8 100644 --- a/ipympl/backend_nbagg.py +++ b/ipympl/backend_nbagg.py @@ -58,7 +58,7 @@ observe, ) -from ._version import __MODEL_VERSION__ +from ._version import js_semver cursors_str = { cursors.HAND: 'pointer', @@ -93,11 +93,11 @@ def connection_info(): class Toolbar(DOMWidget, NavigationToolbar2WebAgg): _model_module = Unicode('jupyter-matplotlib').tag(sync=True) - _model_module_version = Unicode(__MODEL_VERSION__).tag(sync=True) + _model_module_version = Unicode(js_semver).tag(sync=True) _model_name = Unicode('ToolbarModel').tag(sync=True) _view_module = Unicode('jupyter-matplotlib').tag(sync=True) - _view_module_version = Unicode(__MODEL_VERSION__).tag(sync=True) + _view_module_version = Unicode(js_semver).tag(sync=True) _view_name = Unicode('ToolbarView').tag(sync=True) toolitems = List().tag(sync=True) @@ -180,11 +180,11 @@ def _on_orientation_collapsed_changed(self, change): class Canvas(DOMWidget, FigureCanvasWebAggCore): _model_module = Unicode('jupyter-matplotlib').tag(sync=True) - _model_module_version = Unicode(__MODEL_VERSION__).tag(sync=True) + _model_module_version = Unicode(js_semver).tag(sync=True) _model_name = Unicode('MPLCanvasModel').tag(sync=True) _view_module = Unicode('jupyter-matplotlib').tag(sync=True) - _view_module_version = Unicode(__MODEL_VERSION__).tag(sync=True) + _view_module_version = Unicode(js_semver).tag(sync=True) _view_name = Unicode('MPLCanvasView').tag(sync=True) toolbar = Instance(Toolbar, allow_none=True).tag(sync=True, **widget_serialization) diff --git a/package.json b/package.json index 4e6ecfbf..85338166 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jupyter-matplotlib", - "version": "0.11.0", + "version": "0.11.1", "description": "Matplotlib Jupyter Interactive Widget", "author": "Matplotlib Development team", "license": "BSD-3-Clause", diff --git a/src/mpl_widget.ts b/src/mpl_widget.ts index 81d76c31..06841f2b 100644 --- a/src/mpl_widget.ts +++ b/src/mpl_widget.ts @@ -10,7 +10,7 @@ import { import * as utils from './utils'; -import { MODEL_VERSION } from './version'; +import { MODULE_VERSION } from './version'; import { ToolbarView } from './toolbar_widget'; @@ -30,8 +30,8 @@ export class MPLCanvasModel extends DOMWidgetModel { _view_name: 'MPLCanvasView', _model_module: 'jupyter-matplotlib', _view_module: 'jupyter-matplotlib', - _model_module_version: MODEL_VERSION, - _view_module_version: MODEL_VERSION, + _model_module_version: '^' + MODULE_VERSION, + _view_module_version: '^' + MODULE_VERSION, header_visible: true, footer_visible: true, toolbar: null, diff --git a/src/plugin.ts b/src/plugin.ts index a11f697f..1305d7c1 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -4,7 +4,7 @@ import { Widget } from '@phosphor/widgets'; import { IJupyterWidgetRegistry } from '@jupyter-widgets/base'; -import { MODEL_VERSION, MODULE_NAME } from './version'; +import { MODULE_VERSION, MODULE_NAME } from './version'; const EXTENSION_ID = 'matplotlib-jupyter:main'; @@ -31,7 +31,7 @@ function activateWidgetExtension( ): void { registry.registerWidget({ name: MODULE_NAME, - version: MODEL_VERSION, + version: MODULE_VERSION, exports: (): any => import('./index'), }); } diff --git a/src/toolbar_widget.ts b/src/toolbar_widget.ts index 48471e2f..b13637fb 100644 --- a/src/toolbar_widget.ts +++ b/src/toolbar_widget.ts @@ -1,6 +1,6 @@ import { DOMWidgetModel, DOMWidgetView } from '@jupyter-widgets/base'; -import { MODEL_VERSION } from './version'; +import { MODULE_VERSION } from './version'; import '../css/mpl_widget.css'; @@ -12,8 +12,8 @@ export class ToolbarModel extends DOMWidgetModel { _view_name: 'ToolbarView', _model_module: 'jupyter-matplotlib', _view_module: 'jupyter-matplotlib', - _model_module_version: MODEL_VERSION, - _view_module_version: MODEL_VERSION, + _model_module_version: '^' + MODULE_VERSION, + _view_module_version: '^' + MODULE_VERSION, toolitems: [], position: 'left', button_style: '', diff --git a/src/version.ts b/src/version.ts index 4f1690b4..77ab7589 100644 --- a/src/version.ts +++ b/src/version.ts @@ -6,19 +6,10 @@ const data = require('../package.json'); * * The html widget manager assumes that this is the same as the npm package * version number. - * - * See counterparts in the _version.py file - * These should not be changed unless we introduce changes to communication between - * frontend and backend. */ -export const MODEL_VERSION = '1.0.0'; +export const MODULE_VERSION = data.version; /* * The current package name. */ export const MODULE_NAME = data.name; - -/* - * The package version - */ -export const MODULE_VERSION = data.version;