File tree Expand file tree Collapse file tree 5 files changed +50
-14
lines changed Expand file tree Collapse file tree 5 files changed +50
-14
lines changed Original file line number Diff line number Diff line change @@ -126,3 +126,23 @@ A symptomatic output looks like: ::
126
126
127
127
If you would like to run *fMRIPrep * in parallel on multiple subjects please use
128
128
`this method <https://neurostars.org/t/fmriprep-workaround-for-running-subjects-in-parallel/4449 >`__.
129
+
130
+
131
+ .. _upgrading :
132
+
133
+ A new version of *fMRIPrep * has been published, when should I upgrade?
134
+ ----------------------------------------------------------------------
135
+
136
+ We follow a philosophy of releasing very often, although the pace is slowing down
137
+ with the maturation of the software.
138
+ It is very likely that your version gets outdated over the extent of your study.
139
+ If that is the case (an ongoing study), then we discourage changing versions.
140
+ In other words, **the whole dataset should be processed with the same version (and
141
+ same container build if they are being used) of *fMRIPrep*. **
142
+
143
+ On the other hand, if the project is about to start, then we strongly recommend
144
+ using the latest version of the tool.
145
+
146
+ In any case, if you can find your release listed as *flagged * in `this file
147
+ of our repo <https://github.com/poldracklab/fmriprep/blob/master/.versions.json> `__,
148
+ then please update as soon as possible.
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ def get_parser():
43
43
from packaging .version import Version
44
44
from ..__about__ import __version__
45
45
from ..workflows .bold .resampling import NONSTANDARD_REFERENCES
46
- from ._version import check_latest , is_flagged
46
+ from .version import check_latest , is_flagged
47
47
48
48
verstr = 'fmriprep v{}' .format (__version__ )
49
49
@@ -281,10 +281,9 @@ def get_parser():
281
281
282
282
if latest is not None and currentv < latest :
283
283
print ("""\
284
- WARNING: The current version of fMRIPrep (%s) is outdated.
285
- Please consider upgrading to the latest version %s.
286
- Before upgrading, please consider that mixing fMRIPrep versions
287
- within a single study is strongly discouraged.""" % (
284
+ You are using fMRIPrep-%s, and a newer version of fMRIPrep is available: %s.
285
+ Please check out our documentation about how and when to upgrade:
286
+ https://fmriprep.readthedocs.io/en/latest/faq.html#upgrading""" % (
288
287
__version__ , latest ), file = sys .stderr )
289
288
290
289
_blist = is_flagged ()
Original file line number Diff line number Diff line change 1
1
"""Test CLI."""
2
2
from packaging .version import Version
3
3
import pytest
4
- from .. import _version
4
+ from .. import version as _version
5
5
from ... import __about__
6
6
from ..run import get_parser
7
7
@@ -24,10 +24,9 @@ def _mock_check_latest(*args, **kwargs):
24
24
captured = capsys .readouterr ().err
25
25
26
26
msg = """\
27
- WARNING: The current version of fMRIPrep (%s) is outdated.
28
- Please consider upgrading to the latest version %s.
29
- Before upgrading, please consider that mixing fMRIPrep versions
30
- within a single study is strongly discouraged.""" % (current , latest )
27
+ You are using fMRIPrep-%s, and a newer version of fMRIPrep is available: %s.
28
+ Please check out our documentation about how and when to upgrade:
29
+ https://fmriprep.readthedocs.io/en/latest/faq.html#upgrading""" % (current , latest )
31
30
32
31
assert (msg in captured ) is expectation
33
32
Original file line number Diff line number Diff line change 3
3
from pathlib import Path
4
4
from packaging .version import Version
5
5
import pytest
6
- from .. import _version
7
- from .._version import check_latest , DATE_FMT , requests , is_flagged
6
+ from .. import version as _version
7
+ from ..version import check_latest , DATE_FMT , requests , is_flagged
8
8
9
9
10
10
class MockResponse :
@@ -64,6 +64,24 @@ def mock_get(*args, **kwargs):
64
64
assert isinstance (v , Version )
65
65
assert v == Version ('1.1.0' )
66
66
67
+ # Mock timeouts
68
+ def mock_get (* args , ** kwargs ):
69
+ raise requests .exceptions .Timeout
70
+ monkeypatch .setattr (requests , "get" , mock_get )
71
+
72
+ cachefile .write_text ('|' .join (('1.0.0' , cachefile .read_text ().split ('|' )[1 ])))
73
+ v = check_latest ()
74
+ assert isinstance (v , Version )
75
+ assert v == Version ('1.0.0' )
76
+
77
+ cachefile .write_text ('2.0.0|20180121' )
78
+ v = check_latest ()
79
+ assert v is None
80
+
81
+ cachefile .unlink ()
82
+ v = check_latest ()
83
+ assert v is None
84
+
67
85
68
86
@pytest .mark .parametrize (('result' , 'code' , 'json' ), [
69
87
(None , 404 , None ),
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ def check_latest():
39
39
try :
40
40
response = requests .get (url = 'https://pypi.org/pypi/fmriprep/json' , timeout = 1.0 )
41
41
except Exception :
42
- pass
42
+ response = None
43
43
44
44
if response and response .status_code == 200 :
45
45
versions = [Version (rel ) for rel in response .json ()['releases' ].keys ()]
@@ -66,7 +66,7 @@ def is_flagged():
66
66
response = requests .get (url = """\
67
67
https://raw.githubusercontent.com/poldracklab/fmriprep/master/.versions.json""" , timeout = 1.0 )
68
68
except Exception :
69
- pass
69
+ response = None
70
70
71
71
if response and response .status_code == 200 :
72
72
flagged = response .json ().get ('flagged' , {}) or {}
You can’t perform that action at this time.
0 commit comments