[Subversion] / PEAK / setup.py  

Diff of /PEAK/setup.py

Parent Directory | Revision Log

version 576, Mon Oct 28 17:58:01 2002 UTC version 974, Thu Apr 10 01:22:36 2003 UTC
Line 2 
Line 2 
   
 """Distutils setup file"""  """Distutils setup file"""
   
 from distutils.core import setup, Command, Extension  include_tests = True        # edit this to stop installation of test modules
 from distutils.command.install_data import install_data  include_metamodels = True   # edit this to stop installation of MOF, UML, etc.
 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_lib', '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)  
   
   
   
   
   
   
   
   
   # Metadata
   
   PACKAGE_NAME = "PEAK"
   PACKAGE_VERSION = "0.5a0"
   
 class test(Command):  HAPPYDOC_IGNORE = [
       '-i', 'examples',  '-i', 'old', '-i', 'tests',
     """Command to run unit tests after installation"""      '-i', 'Interface', '-i', 'Persistence', '-i', 'kjbuckets',
   ]
     description = "Run unit tests after installation"  
   
     user_options = [('test-module=','m','Test module (default=peak.tests)'),]  
   
     def initialize_options(self):  
         self.test_module = None  
   
     def finalize_options(self):  
   
         if self.test_module is None:  
             self.test_module = 'peak.api.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)  
   
   
   # Base packages for installation
   
   packages = [
       'peak', 'peak.api', 'peak.binding', 'peak.config', 'peak.model',
       'peak.naming', 'peak.naming.factories', 'peak.running',
       'peak.storage', 'peak.util',
   
       'Interface', 'Interface.Common', 'Interface.Registry',
       'Persistence',
   ]
   
   
   # Base data files
   
   data_files = [
       ('peak', ['src/peak/peak.ini']),
   ]
   
   
   
   
   
 class happy(Command):  
   
     """Command to generate documentation using HappyDoc  if include_tests:
   
         I should probably make this more general, and contribute it to either      packages += [
         HappyDoc or the distutils, but this does the trick for PEAK for now...          'peak.tests', 'peak.binding.tests', 'peak.config.tests',
     """          'peak.model.tests', 'peak.naming.tests', 'peak.running.tests',
           'peak.storage.tests', 'peak.util.tests',
   
     description = "Generate docs using happydoc"          'Interface.tests', 'Interface.Common.tests',
           'Interface.Registry.tests',
       ]
   
     user_options = []      data_files += [
           ('peak/running/tests', ['src/peak/running/tests/test_cluster.txt']),
       ]
   
   
     def initialize_options(self):  if include_metamodels:
         self.happy_options = None  
         self.doc_output_path = None  
   
       packages += [
           'peak.metamodels',
           'peak.metamodels.UML13',
           'peak.metamodels.UML13.model',
           'peak.metamodels.UML13.model.Foundation',
           'peak.metamodels.UML13.model.Behavioral_Elements',
       ]
   
     def finalize_options(self):      if include_tests:
   
         if self.doc_output_path is None:          packages += [
             self.doc_output_path = 'docs/html/reference'              'peak.metamodels.tests',
           ]
   
         if self.happy_options is None:          data_files += [
             self.happy_options = [              ('peak/metamodels/tests',
                 '-t', 'PEAK Reference', '-d', self.doc_output_path,                  ['src/peak/metamodels/tests/MetaMeta.xml']
                 '-i', 'examples', '-i', 'old', '-i', 'tests',              ),
                 '-i', 'Interface', '.'  
             ]              ]
             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()  execfile('src/setup/common.py')
   
 setup(  setup(
     name="PEAK",      name=PACKAGE_NAME,
     version="0.5a1",      version=PACKAGE_VERSION,
   
     description="The Python Enterprise Application Kit",      description="The Python Enterprise Application Kit",
   
     author="Phillip J. Eby",      author="Phillip J. Eby",
     author_email="transwarp@eby-sarna.com",      author_email="transwarp@eby-sarna.com",
     url="http://www.telecommunity.com/PEAK/",  
   
     packages=[      url="http://peak.telecommunity.com/",
         'peak', 'peak.api', 'peak.binding', 'peak.model', 'peak.metamodels',  
         'peak.metamodels.mof', 'peak.metamodels.uml', 'peak.metamodels.xmi',  
         'peak.naming', 'peak.naming.factories', 'peak.util', 'peak.running',  
         'peak.config', 'peak.storage',  
   
         'peak.binding.tests', 'peak.config.tests',  
         'peak.metamodels.tests', 'peak.util.tests', 'peak.tests',  
   
         'Interface', 'Interface.tests',  
         'Interface.Common', 'Interface.Common.tests',  
         'Interface.Registry', 'Interface.Registry.tests',  
   
         'Persistence',      license="PSF or ZPL",
     ],      platforms=['UNIX','Windows'],
   
       packages    = packages,
     package_dir = {'':'src'},      package_dir = {'':'src'},
   
       cmdclass = SETUP_COMMANDS,
   
       data_files = data_files,
   
     ext_modules = [      ext_modules = [
         Extension("kjbuckets", ["src/kjbuckets/kjbucketsmodule.c"]),          Extension("kjbuckets", ["src/kjbuckets/kjbucketsmodule.c"]),
         Extension("Persistence.cPersistence",          Extension("Persistence.cPersistence",
             ["src/Persistence/cPersistence.c"]              ["src/Persistence/cPersistence.c"]
         )          ),
     ],          Extension(
     cmdclass = {              "peak.binding._once", [
         'install_data': install_data, 'sdist': sdist, 'happy': happy,                  "src/peak/binding/_once" + EXT,
         'test': test, 'sdist_nodoc': old_sdist,                  "src/peak/binding/getdict.c"
     },              ]
     data_files = [          ),
         ('peak', ['src/peak/peak.ini']),          Extension("peak.util.buffer_gap", ["src/peak/util/buffer_gap" + EXT]),
         ('peak/metamodels/tests', ['src/peak/metamodels/tests/MetaMeta.xml']),          Extension("peak.util._Code", ["src/peak/util/_Code" + EXT]),
     ],      ],
   
 )  )
   
   


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

cvs-admin@eby-sarna.com

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help