[Subversion] / PEAK / setup.py  

Diff of /PEAK/setup.py

Parent Directory | Revision Log

version 359, Sun Mar 24 00:36:04 2002 UTC version 1170, Sat Jun 7 19:30:26 2003 UTC
Line 1 
Line 1 
 #!/usr/bin/env python  #!/usr/bin/env python
   
 """Distutils setup file"""  """Distutils setup file"""
   
 from distutils.core import setup, Command  execfile('src/setup/prologue.py')
 from distutils.command.install_data import install_data  
 from distutils.command.sdist import sdist as old_sdist  
   
 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):  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.5a2"
   
   HAPPYDOC_IGNORE = [
       '-i', 'examples',  '-i', 'old', '-i', 'tests', '-i', 'setup',
       '-i', 'kjbuckets', '-i', 'ZConfig', '-i', 'persistence',
   ]
   
     """Variant of 'sdist' that (re)builds the documentation first"""  # Base packages for installation
   scripts = ['scripts/peak']
   
     def run(self):  packages = [
       'peak', 'peak.api', 'peak.binding', 'peak.config', 'peak.model',
       'peak.naming', 'peak.naming.factories', 'peak.running',
       'peak.storage', 'peak.util', 'protocols',
   ]
   
         # Build docs before source distribution  extensions = [
         self.run_command('happy')      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]),
       Extension("protocols._speedups", ["src/protocols/_speedups" + EXT]),
   ]
   
         # Run the standard sdist command  # Base data files
         old_sdist.run(self)  
   
   data_files = [
       ('peak', ['src/peak/peak.ini']),
   ] + findDataFiles('src/peak/running', 1, '*.xml')
   
   
   if include_tests:
   
       packages += [
           'peak.tests', 'peak.binding.tests', 'peak.config.tests',
           'peak.model.tests', 'peak.naming.tests', 'peak.running.tests',
           'peak.storage.tests', 'peak.util.tests', 'protocols.tests',
       ]
   
       data_files += [
           ('peak/running/tests', ['src/peak/running/tests/test_cluster.txt']),
       ]
   
   
   if include_metamodels:
   
       packages += [
           'peak.metamodels',
           'peak.metamodels.UML13', 'peak.metamodels.UML14',
           'peak.metamodels.UML13.model', 'peak.metamodels.UML14.model',
           'peak.metamodels.UML13.model.Foundation',
           'peak.metamodels.UML13.model.Behavioral_Elements',
       ]
   
       if include_tests:
   
           packages += [ 'peak.metamodels.tests' ]
   
           data_files += findDataFiles('src/peak/metamodels/tests', 1, '*.xml')
   
 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 = []  
   
   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
   
     def initialize_options(self):  except ImportError:
         self.happy_options = None      zope_installed = False
         self.doc_output_path = None  
   
   
     def finalize_options(self):  if not zope_installed:
   
         if self.doc_output_path is None:      packages += [
             self.doc_output_path = 'docs/html/reference'          'persistence', 'ZConfig',
       ]
   
         if self.happy_options is None:      extensions += [
             self.happy_options = [          Extension("persistence._persistence", ["src/persistence/persistence.c"])
                 '-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):      if include_tests:
         from distutils.dir_util import remove_tree, mkpath          packages += [
         from happydoclib import HappyDoc              'persistence.tests', 'ZConfig.tests',
           ]
   
           data_files += findDataFiles(
               'src/ZConfig/tests', 1, '*.xml', '*.txt', '*.conf'
           )
   
   
   
   
         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(  
   
     name="TransWarp",  
     version="0.2pre1",  
     description="The TransWarp Software Automation Toolkit",  
   
   
   
   
   import os
   
   if os.name=='posix':
   
       # install 'fcgiapp' module on posix systems
       if include_fcgiapp:
           extensions += [
               Extension("fcgiapp", [
                   "src/fcgiapp/fcgiappmodule.c", "src/fcgiapp/fcgiapp.c"
               ])
           ]
   
   
   
   execfile('src/setup/common.py')
   
   setup(
       name=PACKAGE_NAME,
       version=PACKAGE_VERSION,
   
       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/",
       license="PSF or ZPL",
       platforms=['UNIX','Windows'],
   
       package_dir = {'':'src'},
       packages    = packages,
       cmdclass = SETUP_COMMANDS,
       data_files = data_files,
       ext_modules = extensions,
       scripts = scripts,
   )
   
     url="http://www.telecommunity.com/TransWarp/",  
   
     packages=[  
         'TW', 'TW.API', 'TW.Database', 'TW.MOF', 'TW.SEF', 'TW.UML', 'TW.XMI',  
         'TW.Utils', 'TW.API.tests', 'TW.Database.tests', 'TW.SEF.tests',  
         'TW.Utils.tests', 'TW.tests',  
     ],  
   
     package_dir = {'':'src'},  
   
     cmdclass = {'install_data': install_data, 'sdist': sdist, 'happy': happy},  
   
     data_files = [  
         ('TW/SEF/tests', ['src/TW/SEF/tests/MetaMeta.xml']),  
     ],  
 )  
   
   


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

cvs-admin@eby-sarna.com

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help