Changeset 1296

Show
Ignore:
Timestamp:
05/22/07 02:28:29 (2 years ago)
Author:
arj..@yirdis.nl
Message:

Added build_doc target to gaphas' setup.py.
Epydoc should be installed in order to generate documentation.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gaphas/trunk/setup.py

    r1220 r1296  
    55 
    66from setuptools import setup, find_packages 
     7from distutils.cmd import Command 
     8 
     9class build_doc(Command): 
     10    description = 'Builds the documentation' 
     11    user_options = [] 
     12 
     13    def initialize_options(self): 
     14        pass 
     15 
     16    def finalize_options(self): 
     17        pass 
     18 
     19    def run(self): 
     20        epydoc_conf = 'epydoc.conf' 
     21 
     22        try: 
     23            import sys 
     24            from epydoc import cli 
     25            old_argv = sys.argv[1:] 
     26            sys.argv[1:] = [ 
     27                '--config=%s' % epydoc_conf, 
     28                '--no-private', # epydoc bug, not read from config 
     29                '--simple-term', 
     30                '--verbose' 
     31            ] 
     32            cli.cli() 
     33            sys.argv[1:] = old_argv 
     34 
     35        except ImportError: 
     36            print 'epydoc not installed, skipping API documentation.' 
    737 
    838setup( 
     
    5888    test_suite = 'nose.collector', 
    5989 
     90    cmdclass={'build_doc': build_doc }, 
    6091    ) 
    6192