From b2997a652ea2c8a756f31e34263fc6d6de8eaade Mon Sep 17 00:00:00 2001 From: Takayuki Shimizukawa Date: Wed, 29 May 2013 09:16:14 +0000 Subject: [PATCH] Fix Python version compatibility with Jinja2 2.7. closes #1173 --- CHANGES | 2 ++ setup.py | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index ac8a9ce39..e20909f83 100644 --- a/CHANGES +++ b/CHANGES @@ -9,6 +9,8 @@ Features added Bugs fixed ---------- +* #1173: Newest Jinja2 2.7 breaks Python version compatibilities because the + Jinja2 2.7 drops support for Python 2.5, 3.1, 3.2. Thanks to Alexander Dupuy. * #1160: Citation target missing cause AssertionError. * #1157: Combination of 'globaltoc.html' and hidden toctree cause exception. * Fix: 'make gettext' cause UnicodeDecodeError when templates contain utf-8 diff --git a/setup.py b/setup.py index 03f8e8e14..e066ec78a 100644 --- a/setup.py +++ b/setup.py @@ -44,10 +44,15 @@ A development egg can be found `here `_. ''' -requires = ['Pygments>=1.2', 'Jinja2>=2.3', 'docutils>=0.7'] +requires = ['Pygments>=1.2', 'docutils>=0.7'] if sys.version_info[:3] >= (3, 3, 0): - requires[2] = 'docutils>=0.10' + requires[1] = 'docutils>=0.10' + +if sys.version_info < (2, 6) or (3, 0) <= sys.version_info < (3, 3): + requires.append('Jinja2>=2.3,<2.7') +else: + requires.append('Jinja2>=2.3') if sys.version_info < (2, 5): print('ERROR: Sphinx requires at least Python 2.5 to run.')