File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 24
24
25
25
from contextlib import suppress
26
26
from datetime import datetime , timezone
27
- from pathlib import Path
28
27
29
28
import requests
30
29
31
- from mriqc import __version__
30
+ from mriqc import __version__ , config
32
31
33
32
RELEASE_EXPIRY_DAYS = 14
34
33
DATE_FMT = '%Y%m%d'
@@ -42,7 +41,7 @@ def check_latest():
42
41
latest = None
43
42
date = None
44
43
outdated = None
45
- cachefile = Path . home () / '.cache' / 'mriqc' / 'latest'
44
+ cachefile = config . environment . cache_path / 'latest'
46
45
try :
47
46
cachefile .parent .mkdir (parents = True , exist_ok = True )
48
47
except OSError :
Original file line number Diff line number Diff line change 212
212
else '18480913-163000_PhineasG-ageh-adhi-sacc-ident9b1ab0f'
213
213
)
214
214
215
+ _mriqc_cache = Path (
216
+ os .getenv ('MRIQC_CACHE_PATH' , str (Path .home () / '.cache' / 'mriqc' ))
217
+ ).absolute ()
218
+
215
219
216
220
class _Config :
217
221
"""An abstract class forbidding instantiation."""
@@ -283,6 +287,8 @@ class environment(_Config):
283
287
284
288
"""
285
289
290
+ cache_path = _mriqc_cache
291
+ """Path to the location of the cache directory."""
286
292
cpu_count = os .cpu_count ()
287
293
"""Number of available CPUs."""
288
294
exec_docker_version = _docker_ver
You can’t perform that action at this time.
0 commit comments