From faccbc00dac4cd3e9da1b27febb69d0f21e28f40 Mon Sep 17 00:00:00 2001 From: Gilad Raphaelli Date: Mon, 15 Jun 2015 15:30:34 -0400 Subject: [PATCH] make simplejson optional, except on python < 2.6 --- pydruid/utils/filters.py | 5 ++++- pydruid/utils/having.py | 5 ++++- setup.py | 14 ++++++++++---- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/pydruid/utils/filters.py b/pydruid/utils/filters.py index 053bb4b1..5e848e49 100644 --- a/pydruid/utils/filters.py +++ b/pydruid/utils/filters.py @@ -13,7 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import simplejson as json +try: + import simplejson as json +except ImportError: + import json class Filter: diff --git a/pydruid/utils/having.py b/pydruid/utils/having.py index b6cb7f70..4841935f 100644 --- a/pydruid/utils/having.py +++ b/pydruid/utils/having.py @@ -13,7 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import simplejson as json +try: + import simplejson as json +except ImportError: + import json class Having: diff --git a/setup.py b/setup.py index c008b5e1..f5101294 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,14 @@ +import sys + from setuptools import setup + +install_requires = ["six >= 1.9.0"] + +# only require simplejson on python < 2.6 +if sys.version_info < (2, 6): + install_requires.append("simplejson >= 3.3.0") + setup( name='pydruid', version='0.2.0', @@ -10,8 +19,5 @@ license='LICENSE', description='A Python connector for Druid.', long_description='See https://github.com/metamx/pydruid for more information.', - install_requires=[ - "simplejson >= 3.3.0", - "six >= 1.9.0", - ], + install_requires=install_requires, )