File tree 3 files changed +9
-10
lines changed
3 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -49,10 +49,7 @@ def pkg_commit_hash(pkg_path):
49
49
pth = os .path .join (pkg_path , COMMIT_INFO_FNAME )
50
50
if not os .path .isfile (pth ):
51
51
raise IOError ('Missing commit info file %s' % pth )
52
- if PY3 :
53
- cfg_parser = configparser .RawConfigParser ()
54
- else :
55
- cfg_parser = configparser .ConfigParser ()
52
+ cfg_parser = configparser .RawConfigParser ()
56
53
with open (pth , encoding = 'utf-8' ) as fp :
57
54
cfg_parser .readfp (fp )
58
55
archive_subst = cfg_parser .get ('commit hash' , 'archive_subst_hash' )
Original file line number Diff line number Diff line change 1
1
from .. import get_info
2
+ from ..info import get_nipype_gitversion
3
+ import pytest
2
4
3
5
4
6
def test_nipype_info ():
@@ -10,5 +12,8 @@ def test_nipype_info():
10
12
assert exception_not_raised
11
13
12
14
13
- # def test_fail_always():
14
- # assert False
15
+ @pytest .mark .skipif (not get_nipype_gitversion (),
16
+ reason = "not able to get version from get_nipype_gitversion" )
17
+ def test_git_hash ():
18
+ # removing the first "g" from gitversion
19
+ get_nipype_gitversion ()[1 :] == get_info ()['commit_hash' ]
Original file line number Diff line number Diff line change @@ -76,10 +76,7 @@ def run(self):
76
76
repo_commit = repo_commit .decode ()
77
77
78
78
# We write the installation commit even if it's empty
79
- if PY3 :
80
- cfg_parser = configparser .RawConfigParser ()
81
- else :
82
- cfg_parser = configparser .ConfigParser ()
79
+ cfg_parser = configparser .RawConfigParser ()
83
80
cfg_parser .read (pjoin ('nipype' , 'COMMIT_INFO.txt' ))
84
81
cfg_parser .set ('commit hash' , 'install_hash' , repo_commit .strip ())
85
82
out_pth = pjoin (self .build_lib , 'nipype' , 'COMMIT_INFO.txt' )
You can’t perform that action at this time.
0 commit comments