@@ -89,10 +89,6 @@ def main():
89
89
90
90
thispath , _ = os .path .split (__file__ )
91
91
92
- # Get version and release info, which is all stored in nipype/info.py
93
- ver_file = os .path .join (thispath , 'nipype' , 'info.py' )
94
- exec (open (ver_file ).read (), locals ())
95
-
96
92
testdatafiles = [pjoin ('testing' , 'data' , val )
97
93
for val in os .listdir (pjoin (thispath , 'nipype' , 'testing' , 'data' ))
98
94
if not os .path .isdir (pjoin (thispath , 'nipype' , 'testing' , 'data' , val ))]
@@ -109,23 +105,31 @@ def main():
109
105
pjoin ('interfaces' , 'tests' , 'use_resources' ),
110
106
]
111
107
108
+ # Python 3: use a locals dictionary
109
+ # http://stackoverflow.com/a/1463370/6820620
110
+ ldict = locals ()
111
+ # Get version and release info, which is all stored in nipype/info.py
112
+ ver_file = os .path .join (thispath , 'nipype' , 'info.py' )
113
+ with open (ver_file ) as infofile :
114
+ exec (infofile .read (), globals (), ldict )
115
+
112
116
setup (
113
- name = NAME ,
114
- maintainer = MAINTAINER ,
115
- maintainer_email = MAINTAINER_EMAIL ,
116
- description = DESCRIPTION ,
117
- long_description = LONG_DESCRIPTION ,
118
- url = URL ,
119
- download_url = DOWNLOAD_URL ,
120
- license = LICENSE ,
121
- classifiers = CLASSIFIERS ,
122
- author = AUTHOR ,
123
- author_email = AUTHOR_EMAIL ,
124
- platforms = PLATFORMS ,
125
- version = VERSION ,
126
- install_requires = REQUIRES ,
117
+ name = ldict [ ' NAME' ] ,
118
+ maintainer = ldict [ ' MAINTAINER' ] ,
119
+ maintainer_email = ldict [ ' MAINTAINER_EMAIL' ] ,
120
+ description = ldict [ ' DESCRIPTION' ] ,
121
+ long_description = ldict [ ' LONG_DESCRIPTION' ] ,
122
+ url = ldict [ ' URL' ] ,
123
+ download_url = ldict [ ' DOWNLOAD_URL' ] ,
124
+ license = ldict [ ' LICENSE' ] ,
125
+ classifiers = ldict [ ' CLASSIFIERS' ] ,
126
+ author = ldict [ ' AUTHOR' ] ,
127
+ author_email = ldict [ ' AUTHOR_EMAIL' ] ,
128
+ platforms = ldict [ ' PLATFORMS' ] ,
129
+ version = ldict [ ' VERSION' ] ,
130
+ install_requires = ldict [ ' REQUIRES' ] ,
127
131
setup_requires = ['configparser' ],
128
- provides = PROVIDES ,
132
+ provides = ldict [ ' PROVIDES' ] ,
129
133
packages = [
130
134
'nipype' ,
131
135
'nipype.algorithms' ,
@@ -250,10 +254,10 @@ def main():
250
254
package_data = {'nipype' : testdatafiles },
251
255
scripts = glob ('bin/*' ),
252
256
cmdclass = { 'build_py' : BuildWithCommitInfoCommand },
253
- tests_require = TESTS_REQUIRES ,
257
+ tests_require = ldict [ ' TESTS_REQUIRES' ] ,
254
258
test_suite = 'nose.collector' ,
255
259
zip_safe = False ,
256
- extras_require = EXTRA_REQUIRES
260
+ extras_require = ldict [ ' EXTRA_REQUIRES' ]
257
261
)
258
262
259
263
if __name__ == "__main__" :
0 commit comments