Browse files

consolidate package listing and version info into neuroimaging package

  • Loading branch information...
1 parent aacd0e4 commit a9cf398064d507c935a96d3d0d637cf3931ee875 brian.hawthorne committed Apr 6, 2006
Showing with 34 additions and 45 deletions.
  1. +26 −0 lib/neuroimaging/__init__.py
  2. +2 −13 lib/neuroimaging/tests/__init__.py
  3. +6 −32 setup.py
View
26 lib/neuroimaging/__init__.py
@@ -3,5 +3,31 @@
import fmri
import statistics
import visualization
+import re
+__version__ = "0.01a"
+packages = (
+ 'neuroimaging',
+ 'neuroimaging.tests',
+ 'neuroimaging.statistics',
+ 'neuroimaging.statistics.tests',
+ 'neuroimaging.image',
+ 'neuroimaging.image.tests',
+ 'neuroimaging.reference',
+ 'neuroimaging.reference.tests',
+ 'neuroimaging.data',
+ 'neuroimaging.data.tests',
+ 'neuroimaging.image.formats',
+ 'neuroimaging.image.formats.tests',
+ 'neuroimaging.image.formats.analyze',
+ 'neuroimaging.fmri',
+ 'neuroimaging.fmri.tests',
+ 'neuroimaging.fmri.fmristat',
+ 'neuroimaging.fmri.fmristat.tests',
+ 'neuroimaging.visualization',
+ 'neuroimaging.visualization.cmap',
+ 'neuroimaging.visualization.tests')
+
+testmatch = re.compile(".*tests").search
+nontest_packages = [p for p in packages if not testmatch(p)]
View
15 lib/neuroimaging/tests/__init__.py
@@ -3,18 +3,7 @@
from glob import glob
from os.path import join, dirname, basename
-packages = (
- 'neuroimaging',
- 'neuroimaging.statistics',
- 'neuroimaging.image',
- 'neuroimaging.reference',
- 'neuroimaging.data',
- 'neuroimaging.image.formats',
- 'neuroimaging.image.formats.analyze',
- 'neuroimaging.fmri',
- 'neuroimaging.fmri.fmristat',
- 'neuroimaging.visualization',
- 'neuroimaging.visualization.cmap')
+from neuroimaging import nontest_packages
#-----------------------------------------------------------------------------
def import_from(modulename, objectname):
@@ -69,5 +58,5 @@ def test_package(packname, testname=None):
#-----------------------------------------------------------------------------
def test_all():
- for packname in packages: test_package(packname)
+ for packname in nontest_packages: test_package(packname)
View
38 setup.py
@@ -1,34 +1,13 @@
import os, glob, string, shutil
+import sys
+sys.path.insert(0,"lib")
from distutils.core import setup
-
-# Packages
-
-packages = ['neuroimaging',
- 'neuroimaging.tests',
- 'neuroimaging.statistics',
- 'neuroimaging.statistics.tests',
- 'neuroimaging.image',
- 'neuroimaging.image.tests',
- 'neuroimaging.reference',
- 'neuroimaging.reference.tests',
- 'neuroimaging.data',
- 'neuroimaging.data.tests',
- 'neuroimaging.image.formats',
- 'neuroimaging.image.formats.tests',
- 'neuroimaging.image.formats.analyze',
- 'neuroimaging.fmri',
- 'neuroimaging.fmri.tests',
- 'neuroimaging.fmri.fmristat',
- 'neuroimaging.fmri.fmristat.tests',
- 'neuroimaging.visualization',
- 'neuroimaging.visualization.cmap',
- 'neuroimaging.visualization.tests']
-
+from neuroimaging import packages, __version__
def main():
- setup (name = 'neuroimaging',
- version = '0.01a',
+ setup( name = 'neuroimaging',
+ version = __version__,
description = 'This is a neuroimaging python package',
author = 'Various, one of whom is Jonathan Taylor',
author_email = 'jonathan.taylor@stanford.edu',
@@ -40,10 +19,5 @@ def main():
'''
''')
-
-
-if __name__ == "__main__":
- main()
-
-
+if __name__ == "__main__": main()

0 comments on commit a9cf398

Please sign in to comment.