[Subversion] / PEAK / setup.py  

Diff of /PEAK/setup.py

Parent Directory | Revision Log

version 326, Fri Feb 15 14:23:54 2002 UTC version 377, Sun Mar 31 21:33:31 2002 UTC
Line 1 
Line 1 
 #!/usr/bin/env python  #!/usr/bin/env python
   
 from distutils.core import setup  """Distutils setup file"""
   
   from distutils.core import setup, Command
   from distutils.command.install_data import install_data
   from distutils.command.sdist import sdist as old_sdist
   import sys
   
   class install_data(install_data):
   
       """Variant of 'install_data' that installs data to module directories"""
   
       def finalize_options (self):
           self.set_undefined_options('install',
                                      ('install_purelib', 'install_dir'),
                                      ('root', 'root'),
                                      ('force', 'force'),
                                     )
   
   class sdist(old_sdist):
   
       """Variant of 'sdist' that (re)builds the documentation first"""
   
       def run(self):
   
           # Build docs before source distribution
           self.run_command('happy')
   
           # Run the standard sdist command
           old_sdist.run(self)
   
   
   
   
   
   
   
   
   
   
   class test(Command):
   
       """Command to run unit tests after installation"""
   
       description = "Run unit tests after installation"
   
       user_options = [('test-module=','m','Test module (default=TW.tests)'),]
   
       def initialize_options(self):
           self.test_module = None
   
       def finalize_options(self):
   
           if self.test_module is None:
               self.test_module = 'TW.tests'
   
           self.test_args = [self.test_module+'.test_suite']
   
           if self.verbose:
               self.test_args.insert(0,'--verbose')
   
       def run(self):
   
           # Install before testing
           self.run_command('install')
   
           if not self.dry_run:
               from unittest import main
               main(None, None, sys.argv[:1]+self.test_args)
   
   
   
   
   
   
   
   
   
   
   
   
   class happy(Command):
   
       """Command to generate documentation using HappyDoc
   
           I should probably make this more general, and contribute it to either
           HappyDoc or the distutils, but this does the trick for TW for now...
       """
   
       description = "Generate docs using happydoc"
   
       user_options = []
   
   
       def initialize_options(self):
           self.happy_options = None
           self.doc_output_path = None
   
   
       def finalize_options(self):
   
           if self.doc_output_path is None:
               self.doc_output_path = 'docs/html/reference'
   
           if self.happy_options is None:
               self.happy_options = [
                   '-t', 'TransWarp Reference', '-d', self.doc_output_path,
                   '-i', 'examples', '-i', 'old', '-i', 'tests', '.',
               ]
               if not self.verbose: self.happy_options.insert(0,'-q')
   
       def run(self):
           from distutils.dir_util import remove_tree, mkpath
           from happydoclib import HappyDoc
   
           mkpath(self.doc_output_path, 0755, self.verbose, self.dry_run)
           remove_tree(self.doc_output_path, self.verbose, self.dry_run)
   
           if not self.dry_run:
               HappyDoc(self.happy_options).run()
   
   
 setup(  setup(
   
     name="TransWarp",      name="TransWarp",
     version="0.2pre1",      version="0.2pre1",
     description="The TransWarp Software Automation Toolkit",      description="The TransWarp Software Automation Toolkit",
   
     author="Phillip J. Eby",      author="Phillip J. Eby",
     author_email="transwarp@eby-sarna.com",      author_email="transwarp@eby-sarna.com",
     url="http://www.zope.org/Members/pje/Wikis/TransWarp",  
       url="http://www.telecommunity.com/TransWarp/",
   
     packages=[      packages=[
         'TW', 'TW.API', 'TW.Database', 'TW.MOF', 'TW.StructuralModel', 'TW.UML',          'TW', 'TW.API', 'TW.Database', 'TW.MOF', 'TW.SEF', 'TW.UML', 'TW.XMI',
         'TW.Utils', 'TW.XMI', 'TW.tests', 'TW.tests.Database',          'TW.Utils', 'TW.API.tests', 'TW.Database.tests', 'TW.SEF.tests',
         'TW.tests.StructuralModel',          'TW.Utils.tests', 'TW.tests',
     ],      ],
   
     package_dir = {'':'src'},      package_dir = {'':'src'},
   
       cmdclass = {
           'install_data': install_data, 'sdist': sdist, 'happy': happy,
           'test': test,
       },
   
     data_files = [      data_files = [
         ('TW/tests/StructuralModel', ['src/TW/tests/StructuralModel/MetaMeta.xml']),          ('TW/SEF/tests', ['src/TW/SEF/tests/MetaMeta.xml']),
     ],      ],
 )  )
   


Generate output suitable for use with a patch program
Legend:
Removed from v.326  
changed lines
  Added in v.377

cvs-admin@eby-sarna.com

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help