Skip to content

Commit

Permalink
Merge pull request #2381 from mrterry/dateutil_py33
Browse files Browse the repository at this point in the history
don't install python-dateutil==2.1 on python 3.3
  • Loading branch information
mdboom committed Sep 4, 2013
2 parents 5f8624d + 9e662f1 commit 1fa7400
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion setupext.py
Expand Up @@ -913,10 +913,21 @@ def get_extension(self):
class Dateutil(SetupPackage):
name = "dateutil"

def __init__(self, version=None):
self.version = version

def check(self):
try:
import dateutil
except ImportError:
# dateutil 2.1 has a file encoding bug that breaks installation on
# python 3.3
# https://github.com/matplotlib/matplotlib/issues/2373
# hack around the problem by installing the the (working) v2.0
major, minor1, _, _, _ = sys.version_info
if self.version is None and (major, minor1) == (3, 3):
self.version = '!=2.1'

return (
"dateutil was not found. It is required for date axis "
"support. pip/easy_install may attempt to install it "
Expand All @@ -925,7 +936,10 @@ def check(self):
return "using dateutil version %s" % dateutil.__version__

def get_install_requires(self):
return ['python-dateutil']
dateutil = 'python-dateutil'
if self.version is not None:
dateutil += self.version
return [dateutil]


class Tornado(SetupPackage):
Expand Down

0 comments on commit 1fa7400

Please sign in to comment.