[Subversion] / PEAK / setup.py  

Diff of /PEAK/setup.py

Parent Directory | Revision Log

version 467, Sat Jul 13 20:17:17 2002 UTC version 2073, Sat Jul 9 05:32:33 2005 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  import sys, os, ez_setup
 from distutils.command.install_data import install_data  ez_setup.use_setuptools()
 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)  
   
   
   
   
   
   
   
   from setuptools import setup, Extension, Feature, find_packages
   
   # Metadata
   PACKAGE_NAME = "PEAK"
   PACKAGE_VERSION = "0.5a4"
   HAPPYDOC_IGNORE = [
       '-i','old', '-i','tests', '-i','setup', '-i','examples',
   ]
   
   scripts = ['scripts/peak']
   packages = find_packages('src')
   
 class test(Command):  extensions = [
       Extension("peak.util.pyexpat", [
           "src/peak/util/pyexpat.c",
           "src/expat/xmlparse.c", "src/expat/xmltok.c", #"src/expat/xmltok_ns.c",
           "src/expat/xmlrole.c",], #"src/expat/xmltok_impl.c"],
           include_dirs=["src/expat"],
           define_macros=[('XML_STATIC',1),('HAVE_MEMMOVE',1)]   # XXX
       ),
       Extension(
           "peak.binding._once", [
               "src/peak/binding/_once.pyx", "src/peak/binding/getdict.c"
           ]
       ),
       Extension("peak.util.buffer_gap", ["src/peak/util/buffer_gap.pyx"]),
       Extension("peak.util._Code", ["src/peak/util/_Code.pyx"]),
       Extension(
           "peak.persistence._persistence", ["src/peak/persistence/persistence.c"]
       ),
   ]
   
     """Command to run unit tests after installation"""  
   
     description = "Run unit tests after installation"  
   
     user_options = [('test-module=','m','Test module (default=peak.tests)'),]  
   
     def initialize_options(self):  have_uuidgen = False
         self.test_module = None  
   
     def finalize_options(self):  if os.name=='posix' and hasattr(os, 'uname'):
   
         if self.test_module is None:      un = os.uname()
             self.test_module = 'peak.tests'  
   
         self.test_args = [self.test_module+'.test_suite']      if un[0] == 'FreeBSD' and int(un[2].split('.')[0]) >= 5:
           have_uuidgen = True
   
         if self.verbose:      elif un[0] == 'NetBSD' and int(un[2].split('.')[0]) >= 2:
             self.test_args.insert(0,'--verbose')          have_uuidgen = True
   
     def run(self):      elif un[0] == 'NetBSD' and un[2].startswith('1.6Z'):
           # XXX for development versions before 2.x where uuidgen
           # is present -- this should be removed at some point
           try:
               if len(un[2]) > 4:
                   if ord(un[2][4]) >= ord('I'):
                       if os.path.exists('/lib/libc.so.12'):
                           l = os.listdir('/lib')
                           l = [x for x in l if x.startswith('libc.so.12.')]
                           l = [int(x.split('.')[-1]) for x in l]
                           l.sort(); l.reverse()
                           if l[0] >= 111:
                               have_uuidgen = True
           except:
               pass
   
         # 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 80 
Line 80 
   
   
   
 class happy(Command):  execfile('src/setup/common.py')
   
     """Command to generate documentation using HappyDoc  features = {
       'tests': Feature(
           "test modules", standard = True,
           remove = [p for p in packages if p.endswith('.tests')]
       ),
       'metamodels': Feature(
           "MOF/UML metamodels", standard = True, remove=['peak.metamodels']
       ),
       'uuidgen': Feature(
           "UUID generation via BSD system libraries",
           available = have_uuidgen, standard = have_uuidgen,
           optional = have_uuidgen,
           ext_modules = [
               Extension("peak.util._uuidgen", ["src/peak/util/_uuidgen.c"]),
           ]
       ),
       'pyexpat-plus': Feature(
           "Backport pyexpat features from Python 2.4",
           standard=sys.version_info < (2,4), optional = False,
           remove = ["peak.util.pyexpat"]
       ),
   }
   
         I should probably make this more general, and contribute it to either  ALL_EXTS = [
         HappyDoc or the distutils, but this does the trick for PEAK for now...      '*.ini', '*.html', '*.conf', '*.xml', '*.pwt', '*.dtd', '*.txt',
     """  ]
   
     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', 'PEAK 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=PACKAGE_NAME,
       version=PACKAGE_VERSION,
   
     name="PEAK",  
     version="0.2pre1",  
     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/",
       license="PSF or ZPL",
       platforms=['UNIX','Windows'],
   
     url="http://telecommunity.com/TransWarp/",      package_dir = {'':'src'},
       packages    = packages,
     packages=[      cmdclass = SETUP_COMMANDS,
         '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.running.config',  
   
         'peak.binding.tests',  
         'peak.metamodels.tests', 'peak.util.tests', 'peak.tests',  
   
         'Interface', 'Interface.Common', 'Interface.tests',      install_requires = [
           'PyProtocols >= 1.0a0dev-r2070',
           'wsgiref     >= 0.0.1dev',
           'ZConfig     >  2.0',
     ],      ],
   
     package_dir = {'':'src'},      extras_require = {
           'FastCGI': ['fcgiapp >= 1.4'],
       },
   
     cmdclass = {      package_data = {
         'install_data': install_data, 'sdist': sdist, 'happy': happy,          '': ALL_EXTS,
         'test': test,          'peak.metamodels': ['*.asdl']
     },      },
   
     data_files = [      features = features,
         ('peak/metamodels/tests', ['src/peak/metamodels/tests/MetaMeta.xml']),      test_suite = 'peak.tests.test_suite',
     ],      ext_modules = extensions,
       scripts = scripts,
 )  )
   
   
   
   
   
   


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

cvs-admin@eby-sarna.com

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help