File tree Expand file tree Collapse file tree 3 files changed +9
-10
lines changed
Expand file tree Collapse file tree 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):
4949 pth = os .path .join (pkg_path , COMMIT_INFO_FNAME )
5050 if not os .path .isfile (pth ):
5151 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 ()
5653 with open (pth , encoding = 'utf-8' ) as fp :
5754 cfg_parser .readfp (fp )
5855 archive_subst = cfg_parser .get ('commit hash' , 'archive_subst_hash' )
Original file line number Diff line number Diff line change 11from .. import get_info
2+ from ..info import get_nipype_gitversion
3+ import pytest
24
35
46def test_nipype_info ():
@@ -10,5 +12,8 @@ def test_nipype_info():
1012 assert exception_not_raised
1113
1214
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):
7676 repo_commit = repo_commit .decode ()
7777
7878 # 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 ()
8380 cfg_parser .read (pjoin ('nipype' , 'COMMIT_INFO.txt' ))
8481 cfg_parser .set ('commit hash' , 'install_hash' , repo_commit .strip ())
8582 out_pth = pjoin (self .build_lib , 'nipype' , 'COMMIT_INFO.txt' )
You can’t perform that action at this time.
0 commit comments