Skip to content

Commit 1fa7400

Browse files
committed
Merge pull request #2381 from mrterry/dateutil_py33
don't install python-dateutil==2.1 on python 3.3
2 parents 5f8624d + 9e662f1 commit 1fa7400

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

setupext.py

+15-1
Original file line numberDiff line numberDiff line change
@@ -913,10 +913,21 @@ def get_extension(self):
913913
class Dateutil(SetupPackage):
914914
name = "dateutil"
915915

916+
def __init__(self, version=None):
917+
self.version = version
918+
916919
def check(self):
917920
try:
918921
import dateutil
919922
except ImportError:
923+
# dateutil 2.1 has a file encoding bug that breaks installation on
924+
# python 3.3
925+
# https://github.com/matplotlib/matplotlib/issues/2373
926+
# hack around the problem by installing the the (working) v2.0
927+
major, minor1, _, _, _ = sys.version_info
928+
if self.version is None and (major, minor1) == (3, 3):
929+
self.version = '!=2.1'
930+
920931
return (
921932
"dateutil was not found. It is required for date axis "
922933
"support. pip/easy_install may attempt to install it "
@@ -925,7 +936,10 @@ def check(self):
925936
return "using dateutil version %s" % dateutil.__version__
926937

927938
def get_install_requires(self):
928-
return ['python-dateutil']
939+
dateutil = 'python-dateutil'
940+
if self.version is not None:
941+
dateutil += self.version
942+
return [dateutil]
929943

930944

931945
class Tornado(SetupPackage):

0 commit comments

Comments
 (0)