comparison setup.py @ 100:3eaa652b1216

Add `--without-apidocs` switch to `build_doc` command for quicker doc-edit/review cycles.
author cmlenz
date Wed, 13 Jun 2007 07:48:06 +0000
parents e68fd956ebce
children 3d9cb4beec8b
comparison
equal deleted inserted replaced
99:b6b5992daa6c 100:3eaa652b1216
23 import sys 23 import sys
24 24
25 25
26 class build_doc(Command): 26 class build_doc(Command):
27 description = 'Builds the documentation' 27 description = 'Builds the documentation'
28 user_options = [] 28 user_options = [
29 ('without-apidocs', None,
30 "whether to skip the generation of API documentaton"),
31 ]
32 boolean_options = ['without-apidocs']
29 33
30 def initialize_options(self): 34 def initialize_options(self):
31 pass 35 self.without_apidocs = False
32 36
33 def finalize_options(self): 37 def finalize_options(self):
34 pass 38 pass
35 39
36 def run(self): 40 def run(self):
65 print 'building documentation file %s' % dest 69 print 'building documentation file %s' % dest
66 publish_cmdline(writer_name='html', 70 publish_cmdline(writer_name='html',
67 argv=['--config=%s' % docutils_conf, source, 71 argv=['--config=%s' % docutils_conf, source,
68 dest]) 72 dest])
69 73
70 try: 74 if not self.without_apidocs:
71 from epydoc import cli 75 try:
72 old_argv = sys.argv[1:] 76 from epydoc import cli
73 sys.argv[1:] = [ 77 old_argv = sys.argv[1:]
74 '--config=%s' % epydoc_conf, 78 sys.argv[1:] = [
75 '--no-private', # epydoc bug, not read from config 79 '--config=%s' % epydoc_conf,
76 '--simple-term', 80 '--no-private', # epydoc bug, not read from config
77 '--verbose' 81 '--simple-term',
78 ] 82 '--verbose'
79 cli.cli() 83 ]
80 sys.argv[1:] = old_argv 84 cli.cli()
85 sys.argv[1:] = old_argv
81 86
82 except ImportError: 87 except ImportError:
83 print 'epydoc not installed, skipping API documentation.' 88 print 'epydoc not installed, skipping API documentation.'
84 89
85 90
86 class test_doc(Command): 91 class test_doc(Command):
87 description = 'Tests the code examples in the documentation' 92 description = 'Tests the code examples in the documentation'
88 user_options = [] 93 user_options = []
Copyright (C) 2012-2017 Edgewall Software