from distutils.core import setup
import glob,re

config_files = glob.glob('config/*.ini')


def get_version():
  """
  Gets version from osg-configure script file
  """
  buffer = open('scripts/osg-configure').read()
  match = re.search("VERSION\s+=\s+'(.*)'", buffer)
  return match.group(1)
  
setup(name='osg-configure',
      version=get_version(),
      description='Package for osg-configure and associated scripts',
      author='Suchandra Thapa',
      author_email='sthapa@ci.uchicago.edu',
      url='http://www.opensciencegrid.org',
      packages=['osg_configure', 'osg_configure.modules', 'osg_configure.configure_modules'],      
      scripts=['scripts/osg-configure'],
      data_files=[('/etc/osg/config.d', config_files),
                  ('/etc/osg/', ['data_files/grid3-locations.txt'])]
      )

@@ -40,17 +40,21 @@
  glob,re
+, os
 %0A
-
 %0Aconfig_
@@ -293,16 +293,277 @@
 p(1)%0A  %0A
+def get_test_files():%0A  %22%22%22%0A  Gets the unit tests and configs for them%0A  %22%22%22%0A  files = %5B%5D%0A  for root, subFolders, files in os.walk('tests'):%0A    for name in files:%0A      files.append(os.path.join(root,file))  %0A  return filter(lambda x: '.svn' not in x, files)%0A%0A
 setup(na
@@ -998,16 +998,16 @@
 files),%0A
-
         
@@ -1065,16 +1065,82 @@
 s.txt'%5D)
+,%0A                  ('/usr/share/osg-configure', get_test_files())
 %5D%0A      

Include test files when packaging osg-configure