@@ -57,93 +57,97 @@ class BuildWithCommitInfoCommand(build_py):
5757 information at the terminal. See the ``pkg_info.py`` module in the nipy
5858 package for an example.
5959 """
60+
6061 def run (self ):
6162 import subprocess
6263 import configparser
6364
6465 build_py .run (self )
65- proc = subprocess .Popen ('git rev-parse --short HEAD' ,
66- stdout = subprocess .PIPE ,
67- stderr = subprocess .PIPE ,
68- shell = True )
66+ proc = subprocess .Popen (
67+ "git rev-parse --short HEAD" ,
68+ stdout = subprocess .PIPE ,
69+ stderr = subprocess .PIPE ,
70+ shell = True ,
71+ )
6972 repo_commit = proc .communicate ()[0 ].decode ()
7073
7174 # We write the installation commit even if it's empty
7275 cfg_parser = configparser .RawConfigParser ()
73- cfg_parser .read (pjoin (' nipype' , ' COMMIT_INFO.txt' ))
74- cfg_parser .set (' commit hash' , ' install_hash' , repo_commit .strip ())
75- out_pth = pjoin (self .build_lib , ' nipype' , ' COMMIT_INFO.txt' )
76- cfg_parser .write (open (out_pth , 'wt' ))
76+ cfg_parser .read (pjoin (" nipype" , " COMMIT_INFO.txt" ))
77+ cfg_parser .set (" commit hash" , " install_hash" , repo_commit .strip ())
78+ out_pth = pjoin (self .build_lib , " nipype" , " COMMIT_INFO.txt" )
79+ cfg_parser .write (open (out_pth , "wt" ))
7780
7881
7982def main ():
8083 from setuptools import setup , find_packages
8184
8285 thispath , _ = os .path .split (__file__ )
8386
84- testdatafiles = [pjoin ( 'testing' , 'data' , val )
85- for val in os . listdir ( pjoin (thispath , 'nipype' , 'testing' ,
86- ' data' ))
87- if not os .path .isdir (pjoin (thispath , ' nipype' , ' testing' ,
88- 'data' , val )) ]
87+ testdatafiles = [
88+ pjoin ("testing" , "data" , val )
89+ for val in os . listdir ( pjoin ( thispath , "nipype" , "testing" , " data" ))
90+ if not os .path .isdir (pjoin (thispath , " nipype" , " testing" , "data" , val ))
91+ ]
8992
9093 testdatafiles += [
91- pjoin (' testing' , ' data' , ' dicomdir' , '*' ),
92- pjoin (' testing' , ' data' , ' bedpostxout' , '*' ),
93- pjoin (' testing' , ' data' , ' tbss_dir' , '*' ),
94- pjoin (' testing' , ' data' , ' brukerdir' , ' fid' ),
95- pjoin (' testing' , ' data' , ' brukerdir' , ' pdata' , '1' , '*' ),
96- pjoin (' testing' , ' data' , ' ds005' , '*' ),
97- pjoin (' testing' , ' data' , ' realign_json.json' ),
98- pjoin (' workflows' , ' data' , '*' ),
99- pjoin (' pipeline' , ' engine' , ' report_template.html' ),
100- pjoin (' external' , ' d3.js' ),
101- pjoin (' interfaces' , ' fsl' , ' model_templates' , '*' ),
102- pjoin (' interfaces' , ' tests' , ' use_resources' ),
103- ' pytest.ini' ,
104- ' conftest.py' ,
94+ pjoin (" testing" , " data" , " dicomdir" , "*" ),
95+ pjoin (" testing" , " data" , " bedpostxout" , "*" ),
96+ pjoin (" testing" , " data" , " tbss_dir" , "*" ),
97+ pjoin (" testing" , " data" , " brukerdir" , " fid" ),
98+ pjoin (" testing" , " data" , " brukerdir" , " pdata" , "1" , "*" ),
99+ pjoin (" testing" , " data" , " ds005" , "*" ),
100+ pjoin (" testing" , " data" , " realign_json.json" ),
101+ pjoin (" workflows" , " data" , "*" ),
102+ pjoin (" pipeline" , " engine" , " report_template.html" ),
103+ pjoin (" external" , " d3.js" ),
104+ pjoin (" interfaces" , " fsl" , " model_templates" , "*" ),
105+ pjoin (" interfaces" , " tests" , " use_resources" ),
106+ " pytest.ini" ,
107+ " conftest.py" ,
105108 ]
106109
107110 # Python 3: use a locals dictionary
108111 # http://stackoverflow.com/a/1463370/6820620
109112 ldict = locals ()
110113 # Get version and release info, which is all stored in nipype/info.py
111- ver_file = os .path .join (thispath , ' nipype' , ' info.py' )
114+ ver_file = os .path .join (thispath , " nipype" , " info.py" )
112115 with open (ver_file ) as infofile :
113116 exec (infofile .read (), globals (), ldict )
114117
115- SETUP_REQUIRES = [' future' ]
118+ SETUP_REQUIRES = [" future" ]
116119 if sys .version_info <= (3 , 4 ):
117- SETUP_REQUIRES .append (' configparser' )
120+ SETUP_REQUIRES .append (" configparser" )
118121 setup (
119- name = ldict [' NAME' ],
120- maintainer = ldict [' MAINTAINER' ],
121- maintainer_email = ldict [' MAINTAINER_EMAIL' ],
122- description = ldict [' DESCRIPTION' ],
123- long_description = ldict [' LONG_DESCRIPTION' ],
124- url = ldict [' URL' ],
125- download_url = ldict [' DOWNLOAD_URL' ],
126- license = ldict [' LICENSE' ],
127- classifiers = ldict [' CLASSIFIERS' ],
128- author = ldict [' AUTHOR' ],
129- author_email = ldict [' AUTHOR_EMAIL' ],
130- platforms = ldict [' PLATFORMS' ],
131- version = ldict [' VERSION' ],
132- python_requires = ldict [' PYTHON_REQUIRES' ],
133- install_requires = ldict [' REQUIRES' ],
122+ name = ldict [" NAME" ],
123+ maintainer = ldict [" MAINTAINER" ],
124+ maintainer_email = ldict [" MAINTAINER_EMAIL" ],
125+ description = ldict [" DESCRIPTION" ],
126+ long_description = ldict [" LONG_DESCRIPTION" ],
127+ url = ldict [" URL" ],
128+ download_url = ldict [" DOWNLOAD_URL" ],
129+ license = ldict [" LICENSE" ],
130+ classifiers = ldict [" CLASSIFIERS" ],
131+ author = ldict [" AUTHOR" ],
132+ author_email = ldict [" AUTHOR_EMAIL" ],
133+ platforms = ldict [" PLATFORMS" ],
134+ version = ldict [" VERSION" ],
135+ python_requires = ldict [" PYTHON_REQUIRES" ],
136+ install_requires = ldict [" REQUIRES" ],
134137 setup_requires = SETUP_REQUIRES ,
135- provides = ldict [' PROVIDES' ],
138+ provides = ldict [" PROVIDES" ],
136139 packages = find_packages (),
137- package_data = {' nipype' : testdatafiles },
138- cmdclass = {' build_py' : BuildWithCommitInfoCommand },
139- tests_require = ldict [' TESTS_REQUIRES' ],
140+ package_data = {" nipype" : testdatafiles },
141+ cmdclass = {" build_py" : BuildWithCommitInfoCommand },
142+ tests_require = ldict [" TESTS_REQUIRES" ],
140143 zip_safe = False ,
141- extras_require = ldict [' EXTRA_REQUIRES' ],
142- entry_points = '''
144+ extras_require = ldict [" EXTRA_REQUIRES" ],
145+ entry_points = """
143146 [console_scripts]
144147 nipypecli=nipype.scripts.cli:cli
145- '''
148+ """ ,
146149 )
147150
151+
148152if __name__ == "__main__" :
149153 main ()
0 commit comments