From a16bba42b34cbc076c880efe46b5d7a953dced37 Mon Sep 17 00:00:00 2001 From: ayanamist Date: Sat, 6 Apr 2013 17:32:37 +0800 Subject: [PATCH] Don't introduce simplejson dependency aimlessly. --- setup.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a6bf312..bcc0479 100644 --- a/setup.py +++ b/setup.py @@ -4,6 +4,15 @@ from setuptools import find_packages __author__ = 'Ryan McGrath ' __version__ = '2.7.0' +install_requires = ['requests>=1.0.0, <2.0.0', 'requests_oauthlib==0.3.0'] +try: + import json +except ImportError: + try: + from django.utils import simplejson + except ImportError: + install_requires.append('simplejson') + setup( # Basic package information. name='twython', @@ -14,7 +23,7 @@ setup( include_package_data=True, # Package dependencies. - install_requires=['simplejson', 'requests>=1.0.0, <2.0.0', 'requests_oauthlib==0.3.0'], + install_requires=install_requires, # Metadata for PyPI. author='Ryan McGrath',