Skip to content
Snippets Groups Projects
Commit 782dcde0 authored by Dan Michael O. Heggø's avatar Dan Michael O. Heggø
Browse files

Don't require unnecessary dependencies

- Require 'ordereddict' only on Python < 2.7
- Don't require 'simplejson'
parent 0cf414ea
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,13 @@ import random ...@@ -7,7 +7,13 @@ import random
import sys import sys
import weakref import weakref
import base64 import base64
from ordereddict import OrderedDict
try:
# Python 2.7+
from collections import OrderedDict
except ImportError:
# Python 2.6
from ordereddict import OrderedDict
try: try:
import json import json
......
...@@ -34,6 +34,10 @@ class PyTest(TestCommand): ...@@ -34,6 +34,10 @@ class PyTest(TestCommand):
here = os.path.abspath(os.path.dirname(__file__)) here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read() README = open(os.path.join(here, 'README.rst')).read()
requirements = ['requests']
if sys.version_info < (2, 7):
requirements.append('ordereddict')
setup(name='mwclient', setup(name='mwclient',
version='0.7.0dev', # Rember to also update __ver__ in client.py version='0.7.0dev', # Rember to also update __ver__ in client.py
description='MediaWiki API client', description='MediaWiki API client',
...@@ -51,5 +55,5 @@ setup(name='mwclient', ...@@ -51,5 +55,5 @@ setup(name='mwclient',
packages=['mwclient'], packages=['mwclient'],
cmdclass={'test': PyTest}, cmdclass={'test': PyTest},
tests_require=['pytest-pep8', 'pytest-cache', 'pytest', 'responses'], tests_require=['pytest-pep8', 'pytest-cache', 'pytest', 'responses'],
install_requires=['simplejson', 'requests', 'ordereddict'] install_requires=requirements
) )
...@@ -5,9 +5,13 @@ import mwclient ...@@ -5,9 +5,13 @@ import mwclient
import logging import logging
import requests import requests
import responses import responses
import simplejson as json
import pkg_resources # part of setuptools import pkg_resources # part of setuptools
try:
import json
except ImportError:
import simplejson as json
class TestClient(unittest.TestCase): class TestClient(unittest.TestCase):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment