[Subversion] / PEAK / setup.py  

Diff of /PEAK/setup.py

Parent Directory | Revision Log

version 895, Tue Feb 18 23:48:35 2003 UTC version 1119, Wed May 14 22:40:54 2003 UTC
Line 2 
Line 2 
   
 """Distutils setup file"""  """Distutils setup file"""
   
 from distutils.core import setup, Command, Extension  execfile('src/setup/prologue.py')
 from distutils.command.install_data import install_data  
 from distutils.command.sdist import sdist as old_sdist  
 from distutils.command.build_ext import build_ext as old_build_ext  
 import sys  
   
 try:  
     from Pyrex.Distutils.build_ext import build_ext  
     EXT = '.pyx'  
 except ImportError:  
     build_ext = old_build_ext  
     EXT = '.c'  
   
   include_tests      = True   # edit this to stop installation of test modules
   include_metamodels = True   # edit this to stop installation of MOF, UML, etc.
   include_fcgiapp    = True   # edit this to stop installation of 'fcgiapp'
   
   # Metadata
   PACKAGE_NAME = "PEAK"
   PACKAGE_VERSION = "0.5a1"
   
   HAPPYDOC_IGNORE = [
       '-i', 'examples',  '-i', 'old', '-i', 'tests', '-i', 'setup',
       '-i', 'kjbuckets', '-i', 'ZConfig', '-i', 'persistence',
   ]
   
 class install_data(install_data):  
   
     """Variant of 'install_data' that installs data to module directories"""  # Base packages for installation
   scripts = ['scripts/peak']
   
     def finalize_options (self):  packages = [
         self.set_undefined_options('install',      'peak', 'peak.api', 'peak.binding', 'peak.config', 'peak.model',
                                    ('install_lib', 'install_dir'),      'peak.naming', 'peak.naming.factories', 'peak.running',
                                    ('root', 'root'),      'peak.storage', 'peak.util', 'protocols',
                                    ('force', 'force'),  ]
                                   )  
   
 class sdist(old_sdist):  extensions = [
       Extension("kjbuckets", ["src/kjbuckets/kjbucketsmodule.c"]),
       Extension(
           "peak.binding._once", [
               "src/peak/binding/_once" + EXT,
               "src/peak/binding/getdict.c"
           ]
       ),
       Extension("peak.util.buffer_gap", ["src/peak/util/buffer_gap" + EXT]),
       Extension("peak.util._Code", ["src/peak/util/_Code" + EXT]),
   ]
   
     """Variant of 'sdist' that (re)builds the documentation first"""  # Base data files
   
     def run(self):  data_files = [
       ('peak', ['src/peak/peak.ini']),
   ]
   
         # Build docs before source distribution  
         self.run_command('happy')  
   
         # Run the standard sdist command  if include_tests:
         old_sdist.run(self)  
   
 class test(Command):      packages += [
           'peak.tests', 'peak.binding.tests', 'peak.config.tests',
           'peak.model.tests', 'peak.naming.tests', 'peak.running.tests',
           'peak.storage.tests', 'peak.util.tests',
       ]
   
     """Command to run unit tests after installation"""      data_files += [
           ('peak/running/tests', ['src/peak/running/tests/test_cluster.txt']),
       ]
   
     description = "Run unit tests after installation"  
   
     user_options = [('test-module=','m','Test module (default=peak.tests)'),]  if include_metamodels:
   
     def initialize_options(self):      packages += [
         self.test_module = None          '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.test_module is None:          packages += [ 'peak.metamodels.tests' ]
             self.test_module = 'peak.api.tests'  
   
         self.test_args = [self.test_module+'.test_suite']          data_files += [
               ('peak/metamodels/tests',
                   ['src/peak/metamodels/tests/MetaMeta.xml']
               ),
           ]
   
         if self.verbose:  
             self.test_args.insert(0,'--verbose')  
   
     def run(self):  try:
       # Check if Zope X3 is installed; we use zope.component
       # because we don't install it ourselves; if we used something we
       # install, we'd get a false positive if PEAK was previously installed.
       import zope.component
       zope_installed = True
   
         # Install before testing  except ImportError:
         self.run_command('install')      zope_installed = False
   
         if not self.dry_run:  
             from unittest import main  
             main(None, None, sys.argv[:1]+self.test_args)  
   
   if not zope_installed:
   
       packages += [
           'persistence', 'ZConfig',
       ]
   
       extensions += [
           Extension("persistence._persistence", ["src/persistence/persistence.c"])
       ]
   
       if include_tests:
           packages += [
               'persistence.tests', 'ZConfig.tests',
           ]
   
           data_files += findDataFiles('src/ZConfig/tests', 1, '*.xml', '*.txt', '*.conf')
   
   
   
Line 80 
Line 114 
   
   
   
 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 PEAK 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):  import os
   
         if self.doc_output_path is None:  if os.name=='posix':
             self.doc_output_path = 'docs/html/reference'  
   
         if self.happy_options is None:      # install 'fcgiapp' module on posix systems
             self.happy_options = [      if include_fcgiapp:
                 '-t', 'PEAK Reference', '-d', self.doc_output_path,          extensions += [
                 '-i', 'examples', '-i', 'old', '-i', 'tests',              Extension("fcgiapp", [
                 '-i', 'Interface', '-i', 'Persistence',                  "src/fcgiapp/fcgiappmodule.c", "src/fcgiapp/fcgiapp.c"
                 '-i', 'kjbuckets', '.'              ])
             ]              ]
             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:  execfile('src/setup/common.py')
             HappyDoc(self.happy_options).run()  
   
 setup(  setup(
     name="PEAK",      name=PACKAGE_NAME,
     version="0.5a0",      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://peak.telecommunity.com/",
     url="http://www.telecommunity.com/PEAK/",  
   
     license="PSF or ZPL",      license="PSF or ZPL",
     platforms=['UNIX','Windows'],      platforms=['UNIX','Windows'],
   
     packages=[  
         'peak', 'peak.api', 'peak.binding', 'peak.model', 'peak.metamodels',  
   
         'peak.metamodels.UML13',  
         'peak.metamodels.UML13.Foundation',  
   
         'peak.metamodels.UML13.model',  
         'peak.metamodels.UML13.model.Foundation',  
         'peak.metamodels.UML13.model.Behavioral_Elements',  
   
   
         'peak.naming', 'peak.naming.factories', 'peak.util', 'peak.running',  
         'peak.config', 'peak.storage',  
   
         'peak.binding.tests', 'peak.config.tests', 'peak.storage.tests',  
         'peak.metamodels.tests', 'peak.util.tests', 'peak.naming.tests',  
         'peak.model.tests', 'peak.tests', 'peak.running.tests',  
   
         'Interface', 'Interface.tests',  
         'Interface.Common', 'Interface.Common.tests',  
         'Interface.Registry', 'Interface.Registry.tests',  
         'Persistence',  
     ],  
   
     package_dir = {'':'src'},      package_dir = {'':'src'},
       packages    = packages,
       cmdclass = SETUP_COMMANDS,
       data_files = data_files,
       ext_modules = extensions,
       scripts = scripts,
   )
   
   
     cmdclass = {  
         'install_data': install_data, 'sdist': sdist, 'happy': happy,  
         'test': test, 'sdist_nodoc': old_sdist, 'build_ext': build_ext,  
     },  
   
     data_files = [  
         ('peak', ['src/peak/peak.ini']),  
         ('peak/running/tests', ['src/peak/running/tests/test_cluster.txt']),  
         ('peak/metamodels/tests', ['src/peak/metamodels/tests/MetaMeta.xml']),  
     ],  
   
     ext_modules = [  
         Extension("kjbuckets", ["src/kjbuckets/kjbucketsmodule.c"]),  
         Extension("Persistence.cPersistence",  
             ["src/Persistence/cPersistence.c"]  
         ),  
         Extension(  
             "peak.binding._once", [  
                 "src/peak/binding/_once" + EXT,  
                 "src/peak/binding/getdict.c"  
             ]  
         ),  
         Extension("peak.util.buffer_gap", ["src/peak/util/buffer_gap" + EXT]),  
         Extension("peak.util._Code", ["src/peak/util/_Code" + EXT]),  
     ],  
   
 )  
   
   


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

cvs-admin@eby-sarna.com

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help