From 8ae0e6540a0c7029fbec10e8abd0cbca7da0a120 Mon Sep 17 00:00:00 2001 From: James Murty Date: Fri, 20 Oct 2017 11:14:03 +1100 Subject: [PATCH] Pin DRF dependencies to work with Django 1.8 Pin dependencies `djangorestframework<3.7` and `django-filter<1.1` which are versions that work with Django 1.8. Later versions produce mysterious errors. I had to apply these version constraints in a nasty global way because I could not find a way to specify the versions in setup.py that would actually be respected by setuptools. And I really tried. I also had to apply the pinning in two places: - setup.py for general usage and the go.sh environment - requirements.txt for Travis CI builds. --- requirements.txt | 1 + setup.py | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/requirements.txt b/requirements.txt index b5ace8ee..b998995e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ djangorestframework<3.7 # Avoid JSONField errors with Django 1.8 +django-filter<1.1 # Avoid get_filter_name() errors with Django 1.8 -e .[api,brightcove,dev,docs,django18,forms,project,search,test,events,collections] diff --git a/setup.py b/setup.py index d83a4012..75b76cc7 100644 --- a/setup.py +++ b/setup.py @@ -68,6 +68,13 @@ def find_packages(*paths): 'requests', 'unidecode', 'bleach<2', # Bleach 2 adds a dependency on html5lib>=0.99999999, which breaks our above requirement of html5lib==0.999 + + # Django 1.8-specific version dependencies that must be here to be + # respected. Ideally these restrictions would go below in the + # 'django18' section but setuptools does not respect them there. + # TODO Remove these once GLAMkit uses Django > 1.8 by default. + 'djangorestframework<3.7' # Avoid JSONField errors with Django 1.8 + 'django-filter<1.1', # Avoid get_filter_name() errors with Django 1.8 ], extras_require={ 'api': [