Permalink
Browse files

Python 2.6 doesn't support OrderedDict from stdlib

So I had to add support for the back-port version. Addresses #441.
1 parent 45eb89a commit ae292f42a6ea92a447b194aaf17d8447b859b0ab @nicolaiarocci committed Sep 5, 2014
Showing with 29 additions and 13 deletions.
  1. +6 −1 eve/render.py
  2. +2 −0 py26-requirements.txt
  3. +21 −12 setup.py
View
@@ -19,7 +19,12 @@
from eve.utils import date_to_str, date_to_rfc1123, config, request_method, \
debug_error_message
from flask import make_response, request, Response, current_app as app, abort
-from collections import OrderedDict
+
+try:
+ from collections import OrderedDict # noqa
+except ImportError:
+ # Python 2.6 needs this back-port
+ from ordereddict import OrderedDict
# mapping between supported mime types and render functions.
_MIME_TYPES = [
@@ -0,0 +1,2 @@
+-r requirements.txt
+ordereddict
View
@@ -9,6 +9,26 @@
with open('LICENSE') as f:
LICENSE = f.read()
+install_requires = [
+ 'cerberus>=0.7,<0.8',
+ 'events>=0.2.1,<0.3',
+ 'simplejson>=3.3.0,<0.4',
+ 'werkzeug>=0.9.4,<0.10',
+ 'markupsafe>=0.23,<1.0',
+ 'jinja2>=2.7.2,<3.0',
+ 'itsdangerous>=0.22,<1.0',
+ 'flask>=0.10.1,<0.11',
+ 'pymongo>=2.7.1,<3.0',
+ 'flask-pymongo>=0.3.0,<0.4',
+]
+
+try:
+ from collections import OrderedDict # noqa
+except ImportError:
+ # Python 2.6 needs this back-port
+ install_requires.append('ordereddict')
+
+
setup(
name='Eve',
version='0.5-dev',
@@ -21,18 +41,7 @@
platforms=["any"],
packages=find_packages(),
test_suite="eve.tests",
- install_requires=[
- 'cerberus>=0.7,<0.8',
- 'events>=0.2.1,<0.3',
- 'simplejson>=3.3.0,<0.4',
- 'werkzeug>=0.9.4,<0.10',
- 'markupsafe>=0.23,<1.0',
- 'jinja2>=2.7.2,<3.0',
- 'itsdangerous>=0.22,<1.0',
- 'flask>=0.10.1,<0.11',
- 'pymongo>=2.7.1,<3.0',
- 'flask-pymongo>=0.3.0,<0.4',
- ],
+ install_requires=install_requires,
tests_require=['redis'],
classifiers=[
'Development Status :: 4 - Beta',

0 comments on commit ae292f4

Please sign in to comment.