From 14db341cb4167cb1bc1a498636805df633709f03 Mon Sep 17 00:00:00 2001 From: Ian Thomas Date: Thu, 2 Jan 2025 11:15:33 +0000 Subject: [PATCH 1/2] Remove workaround for matplotlib < 3.4 (#577) --- ipympl/backend_nbagg.py | 65 ----------------------------------------- 1 file changed, 65 deletions(-) diff --git a/ipympl/backend_nbagg.py b/ipympl/backend_nbagg.py index 24f6e9e3..4dd2b6de 100644 --- a/ipympl/backend_nbagg.py +++ b/ipympl/backend_nbagg.py @@ -384,71 +384,6 @@ def _ipython_display_(self, **kwargs): data = self._repr_mimebundle_(**kwargs) display(data, raw=True) - if matplotlib.__version__ < '3.4': - # backport the Python side changes to match the js changes - def _handle_key(self, event): - _SPECIAL_KEYS_LUT = { - 'Alt': 'alt', - 'AltGraph': 'alt', - 'CapsLock': 'caps_lock', - 'Control': 'control', - 'Meta': 'meta', - 'NumLock': 'num_lock', - 'ScrollLock': 'scroll_lock', - 'Shift': 'shift', - 'Super': 'super', - 'Enter': 'enter', - 'Tab': 'tab', - 'ArrowDown': 'down', - 'ArrowLeft': 'left', - 'ArrowRight': 'right', - 'ArrowUp': 'up', - 'End': 'end', - 'Home': 'home', - 'PageDown': 'pagedown', - 'PageUp': 'pageup', - 'Backspace': 'backspace', - 'Delete': 'delete', - 'Insert': 'insert', - 'Escape': 'escape', - 'Pause': 'pause', - 'Select': 'select', - 'Dead': 'dead', - 'F1': 'f1', - 'F2': 'f2', - 'F3': 'f3', - 'F4': 'f4', - 'F5': 'f5', - 'F6': 'f6', - 'F7': 'f7', - 'F8': 'f8', - 'F9': 'f9', - 'F10': 'f10', - 'F11': 'f11', - 'F12': 'f12', - } - - def handle_key(key): - """Handle key values""" - value = key[key.index('k') + 1 :] - if 'shift+' in key: - if len(value) == 1: - key = key.replace('shift+', '') - if value in _SPECIAL_KEYS_LUT: - value = _SPECIAL_KEYS_LUT[value] - key = key[: key.index('k')] + value - return key - - key = handle_key(event['key']) - e_type = event['type'] - guiEvent = event.get('guiEvent', None) - if e_type == 'key_press': - self.key_press_event(key, guiEvent=guiEvent) - elif e_type == 'key_release': - self.key_release_event(key, guiEvent=guiEvent) - - handle_key_press = handle_key_release = _handle_key - class FigureManager(FigureManagerWebAgg): if matplotlib.__version__ < "3.6": From fa3d346772b12cb42f6ad7276f545478e2ee7669 Mon Sep 17 00:00:00 2001 From: Ian Thomas Date: Thu, 2 Jan 2025 11:18:21 +0000 Subject: [PATCH 2/2] Release 0.9.6 --- README.md | 5 ++--- docs/installing.md | 5 ++--- ipympl/_version.py | 2 +- package.json | 2 +- pyproject.toml | 2 +- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index fcc6eadc..dbda5a12 100644 --- a/README.md +++ b/README.md @@ -66,9 +66,8 @@ Versions lookup table: | `ipympl` | `jupyter-matplotlib` | `JupyterLab` | `Matplotlib` | |----------|----------------------|--------------|--------------| -| 0.9.5 | 0.11.5 | >=2,<5 | >=3.5.0 | -| 0.9.4 | 0.11.4 | >=2,<5 | 3.4.0>= | -| 0.9.3 | 0.11.3 | >=2,<5 | 3.4.0>= | +| 0.9.5-6 | 0.11.5-6 | >=2,<5 | >=3.5.0 | +| 0.9.3-4 | 0.11.3-4 | >=2,<5 | 3.4.0>= | | 0.9.0-2 | 0.11.0-2 | >=2,<5 | 3.4.0>= <3.7| | 0.8.8 | 0.10.x | >=2,<5 | 3.3.1>= <3.7| | 0.8.0-7 | 0.10.x | >=2,<5 | 3.3.1>=, <3.6| diff --git a/docs/installing.md b/docs/installing.md index 36164f78..727e76bb 100644 --- a/docs/installing.md +++ b/docs/installing.md @@ -49,9 +49,8 @@ Not all versions of `ipympl` are compatible with different version of Jupyterlab | `ipympl` | `jupyter-matplotlib` | `JupyterLab` | `Matplotlib` | |----------|----------------------|--------------|--------------| -| 0.9.5 | 0.11.5 | >=2,<5 | >=3.5.0 | -| 0.9.4 | 0.11.4 | >=2,<5 | 3.4.0>= | -| 0.9.3 | 0.11.3 | >=2,<5 | 3.4.0>= | +| 0.9.5-6 | 0.11.5-6 | >=2,<5 | >=3.5.0 | +| 0.9.3-4 | 0.11.3-4 | >=2,<5 | 3.4.0>= | | 0.9.0-2 | 0.11.0-2 | >=2,<5 | 3.4.0>= <3.7| | 0.8.8 | 0.10.x | 3 or 2 | 3.3.1>= <3.7| | 0.8.0-7 | 0.10.x | 3 or 2 | 3.3.1>=, <3.6| diff --git a/ipympl/_version.py b/ipympl/_version.py index e52d8fcb..72b00247 100644 --- a/ipympl/_version.py +++ b/ipympl/_version.py @@ -1,3 +1,3 @@ -version_info = (0, 9, 5) +version_info = (0, 9, 6) __version__ = '.'.join(map(str, version_info)) js_semver = '^0.11' diff --git a/package.json b/package.json index 0b873b8c..870f1fad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jupyter-matplotlib", - "version": "0.11.5", + "version": "0.11.6", "description": "Matplotlib Jupyter Interactive Widget", "author": "Matplotlib Development team", "license": "BSD-3-Clause", diff --git a/pyproject.toml b/pyproject.toml index 3291c978..27e5712f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,7 +44,7 @@ classifiers = [ dependencies = [ "ipython<9", "ipywidgets>=7.6.0,<9", - "matplotlib>=3.4.0,<4", + "matplotlib>=3.5.0,<4", "numpy", "pillow", "traitlets<6",