File tree Expand file tree Collapse file tree 3 files changed +28
-4
lines changed Expand file tree Collapse file tree 3 files changed +28
-4
lines changed Original file line number Diff line number Diff line change @@ -1405,10 +1405,9 @@ def findfont(prop, fontext='ttf'):
1405
1405
else :
1406
1406
_fmcache = None
1407
1407
1408
- if not 'TRAVIS' in os .environ :
1409
- cachedir = get_cachedir ()
1410
- if cachedir is not None :
1411
- _fmcache = os .path .join (cachedir , 'fontList.json' )
1408
+ cachedir = get_cachedir ()
1409
+ if cachedir is not None :
1410
+ _fmcache = os .path .join (cachedir , 'fontList.json' )
1412
1411
1413
1412
fontManager = None
1414
1413
@@ -1419,8 +1418,14 @@ def findfont(prop, fontext='ttf'):
1419
1418
1420
1419
def _rebuild ():
1421
1420
global fontManager
1421
+ import lockfile
1422
+
1422
1423
fontManager = FontManager ()
1424
+
1423
1425
if _fmcache :
1426
+ with lockfile .Lockfile (_fmcache ):
1427
+ json_dump (fontManager , _fmcache )
1428
+
1424
1429
json_dump (fontManager , _fmcache )
1425
1430
verbose .report ("generated new fontManager" )
1426
1431
Original file line number Diff line number Diff line change 68
68
setupext .Numpy (),
69
69
setupext .Dateutil (),
70
70
setupext .Pytz (),
71
+ setupext .Lockfile (),
71
72
setupext .Cycler (),
72
73
setupext .Tornado (),
73
74
setupext .Pyparsing (),
Original file line number Diff line number Diff line change @@ -1171,6 +1171,24 @@ def get_install_requires(self):
1171
1171
return ['pytz' ]
1172
1172
1173
1173
1174
+ class LockFile (SetupPackage ):
1175
+ name = 'lockfile'
1176
+
1177
+ def check (self ):
1178
+ try :
1179
+ import lockfile
1180
+ except ImportError :
1181
+ return (
1182
+ 'lockfile was not found. '
1183
+ 'pip will attempt to install it '
1184
+ 'after matplotlib.' )
1185
+
1186
+ return 'using lockfile version %s' % lockfile .__version__
1187
+
1188
+ def get_install_requires (self ):
1189
+ return ['lockfile' ]
1190
+
1191
+
1174
1192
class Cycler (SetupPackage ):
1175
1193
name = "cycler"
1176
1194
You can’t perform that action at this time.
0 commit comments