From fa5937a2554cf010335d1d51476314bf9dd67481 Mon Sep 17 00:00:00 2001 From: Andrew Seier Date: Thu, 26 Feb 2015 16:58:45 -0800 Subject: [PATCH 1/3] Add an extras_require option to setup.py (more) Just like how you can do: pip install ipython[notebook] You can now do: pip install plotly[PY2.6] --- setup.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 4c9f4f884e3..f812d65be9d 100644 --- a/setup.py +++ b/setup.py @@ -41,9 +41,6 @@ def readme(): 'plotly/matplotlylib/mplexporter', 'plotly/matplotlylib/mplexporter/renderers'], package_data={'plotly': ['graph_reference/*.json', 'widgets/*.js']}, - install_requires=['requests', - 'six', - 'pytz', - 'ordereddict', - 'simplejson'], + install_requires=['requests', 'six', 'pytz'], + extras_require={"PY2.6": ['simplejson', 'ordereddict']}, zip_safe=False) From 1dff0566ab6bcd5df4098e63a87719f9daec8268 Mon Sep 17 00:00:00 2001 From: Andrew Seier Date: Thu, 26 Feb 2015 16:59:26 -0800 Subject: [PATCH 2/3] Wrap import to raise a helpful error. --- plotly/graph_objs/graph_objs_tools.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/plotly/graph_objs/graph_objs_tools.py b/plotly/graph_objs/graph_objs_tools.py index 812b29e4764..a40e774866d 100644 --- a/plotly/graph_objs/graph_objs_tools.py +++ b/plotly/graph_objs/graph_objs_tools.py @@ -4,8 +4,16 @@ import os import sys if sys.version[:3] == '2.6': - from ordereddict import OrderedDict - import simplejson as json + try: + from ordereddict import OrderedDict + import simplejson as json + except ImportError: + raise ImportError( + "Looks like you're running Python 2.6. Plotly expects newer " + "standard library versions of ordereddict and json. You can " + "simply upgrade with these 'extras' with the following terminal " + "command:\npip install 'plotly[PY2.6]'" + ) else: from collections import OrderedDict import json From 0b6d38e7573ba773b60859b8865b0c26d698dcca Mon Sep 17 00:00:00 2001 From: Andrew Seier Date: Thu, 26 Feb 2015 17:32:31 -0800 Subject: [PATCH 3/3] =?UTF-8?q?version=20bump=20=E2=80=94>=201.6.10=20(sim?= =?UTF-8?q?plejson/ordereddict=20fix)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plotly/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plotly/version.py b/plotly/version.py index 4c2dc20a737..970bb6f45e7 100644 --- a/plotly/version.py +++ b/plotly/version.py @@ -1 +1 @@ -__version__ = '1.6.9' +__version__ = '1.6.10'