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'])]
      )

from distutils.core import setup
import glob,re, os

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)
  
def get_test_files():
  """
  Gets the unit tests and configs for them
  """
  files = []
  for root, subFolders, files in os.walk('tests'):
    for name in files:
      files.append(os.path.join(root,file))  
  return filter(lambda x: '.svn' not in x, files)

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']),
                  ('/usr/share/osg-configure', get_test_files())]
      )

Include test files when packaging osg-configure
Include test files when packaging osg-configure

git-svn-id: 8e6470fdf0410dbd375d7ca1c7e7b1f4e5857e13@14556 4e558342-562e-0410-864c-e07659590f8c

  from distutils.core import setup
- import glob,re
+ import glob,re, os
  
  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)
    
+ def get_test_files():
+   """
+   Gets the unit tests and configs for them
+   """
+   files = []
+   for root, subFolders, files in os.walk('tests'):
+     for name in files:
+       files.append(os.path.join(root,file))  
+   return filter(lambda x: '.svn' not in x, files)
+ 
  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'])]
+                   ('/etc/osg/', ['data_files/grid3-locations.txt']),
+                   ('/usr/share/osg-configure', get_test_files())]
        )
  
Include test files when packaging osg-configure
## Code Before:
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'])]
      )

## Instruction:
Include test files when packaging osg-configure
## Code After:
from distutils.core import setup
import glob,re, os

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)
  
def get_test_files():
  """
  Gets the unit tests and configs for them
  """
  files = []
  for root, subFolders, files in os.walk('tests'):
    for name in files:
      files.append(os.path.join(root,file))  
  return filter(lambda x: '.svn' not in x, files)

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']),
                  ('/usr/share/osg-configure', get_test_files())]
      )
