[Subversion] / PEAK / setup.py  

Diff of /PEAK/setup.py

Parent Directory | Revision Log

version 966, Sat Apr 5 20:44:59 2003 UTC version 1595, Thu Jan 15 01:12:42 2004 UTC
Line 1 
Line 1 
 #!/usr/bin/env python  #!/usr/bin/env python
   
 """Distutils setup file"""  """Distutils setup file"""
   
   execfile('src/setup/prologue.py')
   
 include_tests = True        # edit this to stop installation of test modules  include_tests = True        # edit this to stop installation of test modules
 include_metamodels = True   # edit this to stop installation of MOF, UML, etc.  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.5a3"
   HAPPYDOC_IGNORE = [
       '-i', 'examples',  '-i', 'old', '-i', 'tests', '-i', 'setup',
       '-i', 'kjbuckets', '-i', 'ZConfig', '-i', 'persistence',
   ]
   
 # Base packages for installation  # Base packages for installation
   scripts = ['scripts/peak']
   modules = []
 packages = [  packages = [
     'peak', 'peak.api', 'peak.binding', 'peak.config', 'peak.model',      'peak', 'peak.api', 'peak.binding', 'peak.config', 'peak.model',
     'peak.naming', 'peak.naming.factories', 'peak.running',      'peak.naming', 'peak.naming.factories', 'peak.net', 'peak.running',
     'peak.storage', 'peak.util',      'peak.tools', 'peak.tools.n2', 'peak.security', 'peak.tools.supervisor',
       'peak.storage', 'peak.util', 'peak.web', 'protocols',
     'Interface', 'Interface.Common', 'Interface.Registry',      'peak.tools.version', 'peak.query', 'peak.events',
     'Persistence',  
 ]  ]
   
   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]),
       Extension("protocols._speedups", ["src/protocols/_speedups" + EXT]),
   ]
   
 # Base data files  # Base data files
   
 data_files = [  data_files = [
     ('peak', ['src/peak/peak.ini']),      ('peak', ['src/peak/peak.ini']),
 ]      ('peak/web', ['src/peak/web/resource_defaults.ini']),
   ] + findDataFiles('src/peak/running', 1, '*.xml', '*.ini')
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
 if include_tests:  if include_tests:
   
     packages += [      packages += [
         'peak.tests', 'peak.binding.tests', 'peak.config.tests',          'peak.tests', 'peak.binding.tests', 'peak.config.tests',
         'peak.model.tests', 'peak.naming.tests', 'peak.running.tests',          'peak.model.tests', 'peak.naming.tests', 'peak.running.tests',
         'peak.storage.tests', 'peak.util.tests',          'peak.security.tests', 'peak.web.tests', 'peak.query.tests',
           'peak.storage.tests', 'peak.util.tests', 'protocols.tests',
         'Interface.tests', 'Interface.Common.tests',          'peak.events.tests'
         'Interface.Registry.tests',  
     ]      ]
   
     data_files += [      data_files += [
         ('peak/running/tests', ['src/peak/running/tests/test_cluster.txt']),          ('peak/running/tests', ['src/peak/running/tests/test_cluster.txt']),
     ]          ('peak/config/tests',  ['src/peak/config/tests/test_links.ini']),
       ] + findDataFiles('src/peak/web/tests', 1, '*.pwt')
   
   
 if include_metamodels:  if include_metamodels:
   
     packages += [      packages += [
         'peak.metamodels',          'peak.metamodels',
         'peak.metamodels.UML13',          'peak.metamodels.UML13', 'peak.metamodels.UML14',
         'peak.metamodels.UML13.model',          'peak.metamodels.UML13.model', 'peak.metamodels.UML14.model',
         'peak.metamodels.UML13.model.Foundation',          'peak.metamodels.UML13.model.Foundation',
         'peak.metamodels.UML13.model.Behavioral_Elements',          'peak.metamodels.UML13.model.Behavioral_Elements',
     ]      ]
   
     if include_tests:      if include_tests:
   
           packages += [ 'peak.metamodels.tests' ]
   
           data_files += findDataFiles(
               'src/peak/metamodels/tests', 1, '*.xml', '*.asdl'
           )
   
   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
   
   except ImportError:
       zope_installed = False
   
   
   if not zope_installed:
   
         packages += [          packages += [
             'peak.metamodels.tests',          'persistence', 'ZConfig',
         ]          ]
   
         data_files += [      extensions += [
             ('peak/metamodels/tests',          Extension("persistence._persistence", ["src/persistence/persistence.c"])
                 ['src/peak/metamodels/tests/MetaMeta.xml']  
             ),  
         ]          ]
   
       if include_tests:
           packages += [
               'persistence.tests', 'ZConfig.tests',
           ]
   
           data_files += findDataFiles(
               'src/ZConfig/tests', 1, '*.xml', '*.txt', '*.conf'
           )
   
   
 from distutils.core import setup, Command, Extension  
 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'  
   
   
 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  
         try:  
             import happydoclib  
         except ImportError:  
             pass  
         else:  
             self.run_command('happy')  
   
         # Run the standard sdist command  
         old_sdist.run(self)  
   
 class test(Command):  
   
     """Command to run unit tests after installation"""  import sys
   
     description = "Run unit tests after installation"  if sys.version_info < (2,3):
       # Install datetime and csv if we're not on 2.3
   
     user_options = [('test-module=','m','Test module (default=peak.tests)'),]      packages += ['datetime']
       if include_tests:
           packages += ['datetime.tests']
   
     def initialize_options(self):      modules += ['csv']
         self.test_module = None      extensions += [
           Extension('_csv', ['src/_csv.c'])
       ]
   
     def finalize_options(self):  import os
   
         if self.test_module is None:  if os.name=='posix':
             self.test_module = 'peak.api.tests'  
   
         self.test_args = [self.test_module+'.test_suite']      # install 'fcgiapp' module on posix systems
       if include_fcgiapp:
           extensions += [
               Extension("fcgiapp", [
                   "src/fcgiapp/fcgiappmodule.c", "src/fcgiapp/fcgiapp.c"
               ])
           ]
   
         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)  
   
   
   
Line 162 
Line 162 
   
   
   
 class happy(Command):  execfile('src/setup/common.py')
   
     """Command to generate documentation using HappyDoc  setup(
       name=PACKAGE_NAME,
       version=PACKAGE_VERSION,
   
         I should probably make this more general, and contribute it to either      description="The Python Enterprise Application Kit",
         HappyDoc or the distutils, but this does the trick for PEAK for now...      author="Phillip J. Eby",
     """      author_email="transwarp@eby-sarna.com",
       url="http://peak.telecommunity.com/",
       license="PSF or ZPL",
       platforms=['UNIX','Windows'],
   
     description = "Generate docs using happydoc"      package_dir = {'':'src'},
       packages    = packages,
       cmdclass = SETUP_COMMANDS,
       data_files = data_files,
       ext_modules = extensions,
       scripts = scripts,
   )
   
     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', 'PEAK Reference', '-d', self.doc_output_path,  
                 '-i', 'examples', '-i', 'old', '-i', 'tests',  
                 '-i', 'Interface', '-i', 'Persistence',  
                 '-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:  
             HappyDoc(self.happy_options).run()  
   
 setup(  
     name="PEAK",  
     version="0.5a0",  
   
     description="The Python Enterprise Application Kit",  
   
     author="Phillip J. Eby",  
     author_email="transwarp@eby-sarna.com",  
   
     url="http://www.telecommunity.com/PEAK/",  
   
     license="PSF or ZPL",  
     platforms=['UNIX','Windows'],  
   
     packages    = packages,  
     package_dir = {'':'src'},  
   
     cmdclass = {  
         'install_data': install_data, 'sdist': sdist, 'happy': happy,  
         'test': test, 'sdist_nodoc': old_sdist, 'build_ext': build_ext,  
     },  
   
     data_files = data_files,  
   
     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.966  
changed lines
  Added in v.1595

cvs-admin@eby-sarna.com

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help