17
17
18
18
19
19
PY3min = (sys .version_info [0 ] >= 3 )
20
- PY32min = (PY3min and sys .version_info [1 ] >= 2 or sys .version_info [0 ] > 3 )
21
20
22
21
23
22
def _get_home ():
@@ -90,7 +89,7 @@ def _get_xdg_cache_dir():
90
89
91
90
setup_cfg = os .environ .get ('MPLSETUPCFG' , 'setup.cfg' )
92
91
if os .path .exists (setup_cfg ):
93
- if PY32min :
92
+ if PY3min :
94
93
config = configparser .ConfigParser ()
95
94
else :
96
95
config = configparser .SafeConfigParser ()
@@ -724,7 +723,7 @@ def check(self):
724
723
except ImportError :
725
724
msgs += [bad_nose ]
726
725
727
- if sys . version_info >= ( 3 , 3 ) :
726
+ if PY3min :
728
727
msgs += ['using unittest.mock' ]
729
728
else :
730
729
try :
@@ -849,7 +848,7 @@ class Numpy(SetupPackage):
849
848
850
849
@staticmethod
851
850
def include_dirs_hook ():
852
- if sys . version_info [ 0 ] >= 3 :
851
+ if PY3min :
853
852
import builtins
854
853
if hasattr (builtins , '__NUMPY_SETUP__' ):
855
854
del builtins .__NUMPY_SETUP__
@@ -1047,11 +1046,11 @@ def do_custom_build(self):
1047
1046
pass
1048
1047
1049
1048
if not os .path .isfile (tarball_path ):
1050
-
1051
- if sys .version_info [0 ] == 2 :
1052
- from urllib import urlretrieve
1053
- else :
1049
+ if PY3min :
1054
1050
from urllib .request import urlretrieve
1051
+ else :
1052
+ from urllib import urlretrieve
1053
+
1055
1054
if not os .path .exists ('build' ):
1056
1055
os .makedirs ('build' )
1057
1056
@@ -1370,14 +1369,6 @@ def check(self):
1370
1369
try :
1371
1370
import dateutil
1372
1371
except ImportError :
1373
- # dateutil 2.1 has a file encoding bug that breaks installation on
1374
- # python 3.3
1375
- # https://github.com/matplotlib/matplotlib/issues/2373
1376
- # hack around the problem by installing the (working) v2.0
1377
- major , minor1 , _ , _ , _ = sys .version_info
1378
- if self .version is None and (major , minor1 ) == (3 , 3 ):
1379
- self .version = '!=2.1'
1380
-
1381
1372
return (
1382
1373
"dateutil was not found. It is required for date axis "
1383
1374
"support. pip/easy_install may attempt to install it "
@@ -1396,7 +1387,7 @@ class FuncTools32(SetupPackage):
1396
1387
name = "functools32"
1397
1388
1398
1389
def check (self ):
1399
- if sys . version_info [: 2 ] < ( 3 , 2 ) :
1390
+ if not PY3min :
1400
1391
try :
1401
1392
import functools32
1402
1393
except ImportError :
@@ -1409,7 +1400,7 @@ def check(self):
1409
1400
return "Not required"
1410
1401
1411
1402
def get_install_requires (self ):
1412
- if sys . version_info [: 2 ] < ( 3 , 2 ) :
1403
+ if not PY3min :
1413
1404
return ['functools32' ]
1414
1405
else :
1415
1406
return []
@@ -1419,7 +1410,7 @@ class Subprocess32(SetupPackage):
1419
1410
name = "subprocess32"
1420
1411
1421
1412
def check (self ):
1422
- if sys . version_info [: 2 ] < ( 3 , 2 ) :
1413
+ if not PY3min :
1423
1414
try :
1424
1415
import subprocess32
1425
1416
except ImportError :
@@ -1433,7 +1424,7 @@ def check(self):
1433
1424
return "Not required"
1434
1425
1435
1426
def get_install_requires (self ):
1436
- if sys . version_info [: 2 ] < ( 3 , 2 ) and os .name == 'posix' :
1427
+ if not PY3min and os .name == 'posix' :
1437
1428
return ['subprocess32' ]
1438
1429
else :
1439
1430
return []
0 commit comments