[Scipy-svn] r3006 - in trunk/Lib: odr sandbox/arpack sandbox/exmplpackage sandbox/pysparse sandbox/spline sandbox/xplt

scipy-svn at scipy.org scipy-svn at scipy.org
Tue May 15 07:57:46 EDT 2007


Author: jarrod.millman
Date: 2007-05-15 06:57:40 -0500 (Tue, 15 May 2007)
New Revision: 3006

Modified:
   trunk/Lib/odr/setup.py
   trunk/Lib/sandbox/arpack/setup.py
   trunk/Lib/sandbox/exmplpackage/setup.py
   trunk/Lib/sandbox/pysparse/setup.py
   trunk/Lib/sandbox/spline/setup.py
   trunk/Lib/sandbox/xplt/setup.py
Log:
more cosmetic cleanup of os.path imports for consistency


Modified: trunk/Lib/odr/setup.py
===================================================================
--- trunk/Lib/odr/setup.py	2007-05-15 11:31:51 UTC (rev 3005)
+++ trunk/Lib/odr/setup.py	2007-05-15 11:57:40 UTC (rev 3006)
@@ -1,18 +1,11 @@
 #!/usr/bin/env python
 
 from os.path import join
-from distutils import dep_util
-from glob import glob
-import warnings
 
-from numpy.distutils.core import Extension
-from numpy.distutils.misc_util import get_path, Configuration, dot_join
-
-from numpy.distutils.system_info import get_info,dict_append,\
-     AtlasNotFoundError,LapackNotFoundError,BlasNotFoundError,\
-     LapackSrcNotFoundError,BlasSrcNotFoundError
-
 def configuration(parent_package='', top_path=None):
+    import warnings
+    from numpy.distutils.misc_util import Configuration
+    from numpy.distutils.system_info import get_info, BlasNotFoundError
     config = Configuration('odr', parent_package, top_path)
 
     libodr_files = ['d_odr.f',

Modified: trunk/Lib/sandbox/arpack/setup.py
===================================================================
--- trunk/Lib/sandbox/arpack/setup.py	2007-05-15 11:31:51 UTC (rev 3005)
+++ trunk/Lib/sandbox/arpack/setup.py	2007-05-15 11:57:40 UTC (rev 3006)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-import os
+from os.path import join
 
 def configuration(parent_package='',top_path=None):
     from numpy.distutils.system_info import get_info, NotFoundError
@@ -13,13 +13,13 @@
 
     config = Configuration('arpack', parent_package, top_path)
 
-    arpack_sources=[os.path.join('ARPACK','SRC', '*.f')]
-    arpack_sources.extend([os.path.join('ARPACK','UTIL', '*.f')])
-#    arpack_sources.extend([os.path.join('ARPACK','BLAS', '*.f')])
-    arpack_sources.extend([os.path.join('ARPACK','LAPACK', '*.f')])
+    arpack_sources=[join('ARPACK','SRC', '*.f')]
+    arpack_sources.extend([join('ARPACK','UTIL', '*.f')])
+#    arpack_sources.extend([join('ARPACK','BLAS', '*.f')])
+    arpack_sources.extend([join('ARPACK','LAPACK', '*.f')])
 
     config.add_library('arpack', sources=arpack_sources,
-                       include_dirs=[os.path.join('ARPACK', 'SRC')])
+                       include_dirs=[join('ARPACK', 'SRC')])
 
 
     config.add_extension('_arpack',

Modified: trunk/Lib/sandbox/exmplpackage/setup.py
===================================================================
--- trunk/Lib/sandbox/exmplpackage/setup.py	2007-05-15 11:31:51 UTC (rev 3005)
+++ trunk/Lib/sandbox/exmplpackage/setup.py	2007-05-15 11:57:40 UTC (rev 3006)
@@ -1,5 +1,7 @@
 #!/usr/bin/env python
 
+from os.path import join
+
 def configuration(parent_package='',top_path=None):
     # The following two lines with `return config` constitutes a
     # minimal contents of configuration(..) that is suitable for pure
@@ -15,9 +17,8 @@
 
     # exmplpackage generates source code, that will be processed with f2py
     def generate_spam_pyf(ext, build_dir):
-        import os
         from distutils.dep_util import newer
-        target = os.path.join(build_dir,'spam.pyf')
+        target = join(build_dir,'spam.pyf')
         source = ext.depends[0]
         if newer(source,target):
             fin = open(source)

Modified: trunk/Lib/sandbox/pysparse/setup.py
===================================================================
--- trunk/Lib/sandbox/pysparse/setup.py	2007-05-15 11:31:51 UTC (rev 3005)
+++ trunk/Lib/sandbox/pysparse/setup.py	2007-05-15 11:57:40 UTC (rev 3006)
@@ -10,20 +10,19 @@
 working around PySparse's weird inconsistency in its module name.)
 """
 
-import os
-from numpy.distutils.core import Extension
-from numpy.distutils.misc_util import get_path,Configuration,dot_join
-join = os.path.join
-import glob
+from os.path import join
+from glob import glob
 
+
 def configuration(parent_package='',parent_path=None):
+    from numpy.distutils.misc_util import Configuration
     from numpy.distutils.system_info import get_info
     config = Configuration('pysparse', parent_package, parent_path)
 
     config.add_data_dir('docs')
     config.add_data_dir('examples')
     config.add_data_dir('tests')
-    headers = glob.glob(os.path.join ("include","pysparse","*.h"))
+    headers = glob(join("include","pysparse","*.h"))
     config.add_extension('pysparse',
         sources = ['src/spmatrixmodule.c'],
         include_dirs = ['include/']

Modified: trunk/Lib/sandbox/spline/setup.py
===================================================================
--- trunk/Lib/sandbox/spline/setup.py	2007-05-15 11:31:51 UTC (rev 3005)
+++ trunk/Lib/sandbox/spline/setup.py	2007-05-15 11:57:40 UTC (rev 3006)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 
-import os
+from os.path import join
 
 def configuration(parent_package='',top_path=None):
     from numpy.distutils.misc_util import Configuration
@@ -8,7 +8,7 @@
     config = Configuration('spline', parent_package, top_path)
 
     config.add_library('fitpack',
-                       sources=[os.path.join('fitpack', '*.f')],
+                       sources=[join('fitpack', '*.f')],
                       )
 
     config.add_extension('dfitpack',

Modified: trunk/Lib/sandbox/xplt/setup.py
===================================================================
--- trunk/Lib/sandbox/xplt/setup.py	2007-05-15 11:31:51 UTC (rev 3005)
+++ trunk/Lib/sandbox/xplt/setup.py	2007-05-15 11:57:40 UTC (rev 3006)
@@ -1,8 +1,7 @@
-## Automatically adapted for scipy Oct 31, 2005 by
-
 #!/usr/bin/env python
 
-import os
+from os import environ
+from os.path import abspath, dirname, join
 import sys
 from distutils import dir_util
 from distutils.sysconfig import get_python_lib
@@ -37,7 +36,7 @@
 x11 = 0
 if not (windows or cygwin or macosx):
     x11 = 1
-if 'NO_XLIB' in os.environ:
+if 'NO_XLIB' in environ:
     x11 = 0
 
 
@@ -193,15 +192,15 @@
 
     include_dirs = ['src/gist', 'src/play', 'src/play/unix' ]
 
-    library_dirs = [os.path.join(local_path,x) for x in ['.','src']]
+    library_dirs = [join(local_path,x) for x in ['.','src']]
     library_dirs.extend(x11_info.get('library_dirs',[]))
     library_dirs.extend(get_special_dirs(sys.platform))
 
-    include_dirs = [os.path.join(local_path,x) for x in include_dirs]
+    include_dirs = [join(local_path,x) for x in include_dirs]
     include_dirs.extend(x11_info.get('include_dirs',[]))
 
     if 1:
-        inputfile = open(os.path.join(config_path,"Make.cfg"))
+        inputfile = open(join(config_path,"Make.cfg"))
         lines = inputfile.readlines()
         inputfile.close()
         for line in lines:
@@ -240,11 +239,11 @@
     config = Configuration('xplt',parent_package, top_path)
     local_path = config.local_path
 
-    all_playsource = [os.path.join('src','play','*','*.c'),
-                      os.path.join('src','play','*.h')
+    all_playsource = [join('src','play','*','*.c'),
+                      join('src','play','*.h')
                       ]
 
-    gistpath = os.path.join(get_python_lib(1),config.path_in_package,"gistdata")
+    gistpath = join(get_python_lib(1),config.path_in_package,"gistdata")
     gistpath = gistpath.replace("\\",r"\\\\")
 
     def get_playsource(extension,build_dir):
@@ -256,9 +255,9 @@
             playsource = unixsource + macsource + allsource
         else:
             playsource = unixsource + x11source + allsource
-        sources = [os.path.join(local_path,n) for n in playsource]
+        sources = [join(local_path,n) for n in playsource]
 
-        config_path = os.path.join(build_dir,'config_pygist')
+        config_path = join(build_dir,'config_pygist')
         dir_util.mkpath(config_path)
         conf = config_pygist(local_path,config_path)
         # Look to see if compiler is set on command line and add it
@@ -279,7 +278,7 @@
         include_dirs, library_dirs, libraries, \
                       extra_compile_args, extra_link_args \
                       = getallparams(gistpath,local_path,config_path)
-        include_dirs.insert(0,os.path.dirname(conf.config_h))
+        include_dirs.insert(0,dirname(conf.config_h))
 
         extension.include_dirs.extend(include_dirs)
         extension.library_dirs.extend(library_dirs)
@@ -291,7 +290,7 @@
 
 
 
-    gistC = os.path.join('pygist','gistCmodule.c')
+    gistC = join('pygist','gistCmodule.c')
     sources = gistsource
     sources = [gistC] + sources + [get_playsource]
 
@@ -300,16 +299,16 @@
                          depends = ['src']
                          )
     config.add_extension('gistfuncs',
-                         [os.path.join('pygist','gistfuncsmodule.c')])
+                         [join('pygist','gistfuncsmodule.c')])
 
 
     file_ext = ['*.gs','*.gp', '*.ps', '*.help']
-    xplt_files = [os.path.join('gistdata',x) for x in file_ext]
-    xplt_files += [os.path.join('src','g',x) for x in file_ext]
+    xplt_files = [join('gistdata',x) for x in file_ext]
+    xplt_files += [join('src','g',x) for x in file_ext]
 
     config.add_data_dir('gistdata')
-    config.add_data_dir((os.path.join(config.path_in_package,'gistdata'),
-                         os.path.abspath(config.paths('src/g')[0])))
+    config.add_data_dir((join(config.path_in_package,'gistdata'),
+                         abspath(config.paths('src/g')[0])))
 
     return config
 




More information about the Scipy-svn mailing list