From edbe9a73f8b45653d0c244691474576d75356065 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Luis=20Cano=20Rodr=C3=ADguez?= Date: Tue, 29 Jan 2019 10:43:16 +0100 Subject: [PATCH 1/4] Fix DeprecationWarning with ipywidgets >= 7 --- plotly/basewidget.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plotly/basewidget.py b/plotly/basewidget.py index 2a6357086a..6b119b308c 100644 --- a/plotly/basewidget.py +++ b/plotly/basewidget.py @@ -15,7 +15,7 @@ from .serializers import custom_serializers from .version import __frontend_version__ -@widgets.register() +@widgets.register class BaseFigureWidget(BaseFigure, widgets.DOMWidget): """ Base class for FigureWidget. The FigureWidget class is code-generated as a From 36490f1d2df2973c3a955bd7557b74cb29f4b883 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Luis=20Cano=20Rodr=C3=ADguez?= Date: Tue, 29 Jan 2019 10:44:53 +0100 Subject: [PATCH 2/4] Fix DeprecationWarning with Python 3.7 --- plotly/grid_objs/grid_objs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plotly/grid_objs/grid_objs.py b/plotly/grid_objs/grid_objs.py index d373d39d2e..67ef91da9a 100644 --- a/plotly/grid_objs/grid_objs.py +++ b/plotly/grid_objs/grid_objs.py @@ -5,7 +5,7 @@ """ from __future__ import absolute_import -from collections import MutableSequence +from collections.abc import MutableSequence from requests.compat import json as _json From 0968f23ec73fbf737e3c36d360bebc6c4d77dc2b Mon Sep 17 00:00:00 2001 From: Jon Mease Date: Fri, 1 Feb 2019 06:31:44 -0500 Subject: [PATCH 3/4] Fallback to collections.MutableSequence for Python 2 --- plotly/grid_objs/grid_objs.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plotly/grid_objs/grid_objs.py b/plotly/grid_objs/grid_objs.py index 67ef91da9a..477b68ba43 100644 --- a/plotly/grid_objs/grid_objs.py +++ b/plotly/grid_objs/grid_objs.py @@ -5,7 +5,10 @@ """ from __future__ import absolute_import -from collections.abc import MutableSequence +try: + from collections.abc import MutableSequence +except ModuleNotFoundError: + from collections import MutableSequence from requests.compat import json as _json From 8d49d38894ee2a866041c1255d63a232f03cf8fd Mon Sep 17 00:00:00 2001 From: Jon Mease Date: Fri, 1 Feb 2019 06:35:01 -0500 Subject: [PATCH 4/4] ModuleNotFoundError -> ImportError for Python 2 --- plotly/grid_objs/grid_objs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plotly/grid_objs/grid_objs.py b/plotly/grid_objs/grid_objs.py index 477b68ba43..dabf49582b 100644 --- a/plotly/grid_objs/grid_objs.py +++ b/plotly/grid_objs/grid_objs.py @@ -7,7 +7,7 @@ try: from collections.abc import MutableSequence -except ModuleNotFoundError: +except ImportError: from collections import MutableSequence from requests.compat import json as _json