##// END OF EJS Templates
Generate docs correctly if pexpect is not available....
Fernando Perez -
Show More
@@ -1,65 +1,74 b''
1 1 #!/usr/bin/env python
2 2 """Script to auto-generate our API docs.
3 3 """
4 4 # stdlib imports
5 5 import os
6 6 import sys
7 7
8 8 # local imports
9 9 sys.path.append(os.path.abspath('sphinxext'))
10 10 from apigen import ApiDocWriter
11 11
12 12 #*****************************************************************************
13 13 if __name__ == '__main__':
14 14 pjoin = os.path.join
15 15 package = 'IPython'
16 16 outdir = pjoin('source','api','generated')
17 17 docwriter = ApiDocWriter(package,rst_extension='.txt')
18 18 # You have to escape the . here because . is a special char for regexps.
19 19 # You must do make clean if you change this!
20 20 docwriter.package_skip_patterns += [r'\.fixes$',
21 21 r'\.external$',
22 22 r'\.extensions',
23 23 r'\.kernel\.config',
24 24 r'\.attic',
25 25 r'\.quarantine',
26 26 r'\.deathrow',
27 27 r'\.config\.default',
28 28 r'\.config\.profile',
29 29 r'\.frontend',
30 30 r'\.gui'
31 31 ]
32 32
33 33 docwriter.module_skip_patterns += [ r'\.core\.fakemodule',
34 34
35 35 # XXX These need fixing, disabling for
36 36 # now but we need to figure out why
37 37 # they are breaking. Error from sphinx
38 38 # for each group copied below
39 39
40 40 # AttributeError: __abstractmethods__
41 41 r'\.core\.component',
42 42 r'\.utils\.traitlets',
43 43
44 44 # AttributeError: __provides__
45 45 r'\.kernel\.clusterdir',
46 46 r'\.kernel\.configobjfactory',
47 47 r'\.kernel\.fcutil',
48 48 r'\.kernel\.ipcontrollerapp',
49 49 r'\.kernel\.launcher',
50 50 r'\.kernel\.task',
51 51 r'\.kernel\.winhpcjob',
52 52 r'\.testing\.util',
53 53
54 54 # Keeping these disabled is OK
55 55 r'\.cocoa',
56 56 r'\.ipdoctest',
57 57 r'\.Gnuplot',
58 58 r'\.frontend\.process\.winprocess',
59 59 r'\.Shell',
60 60 ]
61
62 # If we don't have pexpect, we can't load irunner, so skip any code that
63 # depends on it
64 try:
65 import pexpect
66 except ImportError:
67 docwriter.module_skip_patterns += [r'\.lib\.irunner',
68 r'\.testing\.mkdoctests']
69 # Now, generate the outputs
61 70 docwriter.write_api_docs(outdir)
62 71 docwriter.write_index(outdir, 'gen',
63 72 relative_to = pjoin('source','api')
64 73 )
65 74 print '%d files written' % len(docwriter.written_modules)
General Comments 0
You need to be logged in to leave comments. Login now