@@ -57,93 +57,97 @@ class BuildWithCommitInfoCommand(build_py):
57
57
information at the terminal. See the ``pkg_info.py`` module in the nipy
58
58
package for an example.
59
59
"""
60
+
60
61
def run (self ):
61
62
import subprocess
62
63
import configparser
63
64
64
65
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
+ )
69
72
repo_commit = proc .communicate ()[0 ].decode ()
70
73
71
74
# We write the installation commit even if it's empty
72
75
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" ))
77
80
78
81
79
82
def main ():
80
83
from setuptools import setup , find_packages
81
84
82
85
thispath , _ = os .path .split (__file__ )
83
86
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
+ ]
89
92
90
93
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" ,
105
108
]
106
109
107
110
# Python 3: use a locals dictionary
108
111
# http://stackoverflow.com/a/1463370/6820620
109
112
ldict = locals ()
110
113
# 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" )
112
115
with open (ver_file ) as infofile :
113
116
exec (infofile .read (), globals (), ldict )
114
117
115
- SETUP_REQUIRES = [' future' ]
118
+ SETUP_REQUIRES = [" future" ]
116
119
if sys .version_info <= (3 , 4 ):
117
- SETUP_REQUIRES .append (' configparser' )
120
+ SETUP_REQUIRES .append (" configparser" )
118
121
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" ],
134
137
setup_requires = SETUP_REQUIRES ,
135
- provides = ldict [' PROVIDES' ],
138
+ provides = ldict [" PROVIDES" ],
136
139
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" ],
140
143
zip_safe = False ,
141
- extras_require = ldict [' EXTRA_REQUIRES' ],
142
- entry_points = '''
144
+ extras_require = ldict [" EXTRA_REQUIRES" ],
145
+ entry_points = """
143
146
[console_scripts]
144
147
nipypecli=nipype.scripts.cli:cli
145
- '''
148
+ """ ,
146
149
)
147
150
151
+
148
152
if __name__ == "__main__" :
149
153
main ()
0 commit comments