1 | I managed to get a sphinx build working: |
---|
2 | |
---|
3 | http://sparkle.ncnr.nist.gov/pkienzle/sasview |
---|
4 | |
---|
5 | First I had to move a setup.py file out of the way, since it broke sphinx autodoc: |
---|
6 | |
---|
7 | mv src/sans/simulation/setup.py src/sans/simulation/setup.pynot |
---|
8 | |
---|
9 | With some tweaks the setup.py could be moved to the root directory, or maybe removed entirely. We may be able to leave it in place and ignore it with the right sphinx-apidocs invocation. |
---|
10 | |
---|
11 | Next I had to prepare the python environment so it contained all the modules in the right place (including periodictable): |
---|
12 | |
---|
13 | python setup.py build |
---|
14 | In ~/src/periodictable/periodictable build/lib.linux-x86_64-2.7 |
---|
15 | |
---|
16 | I needed to update conf.py and Makefile to point to the build (see diffs below). This wouldn't be necessary if sasview and periodictable were installed in a virtual environment, but then you would need to trick sphinx into using that environment. |
---|
17 | |
---|
18 | Finally, change into the docs/sphinx-docs directory and type: |
---|
19 | |
---|
20 | make clean html |
---|
21 | |
---|
22 | There are a lot of sphinx markup errors to work through, which I haven't started on. |
---|
23 | |
---|
24 | |
---|
25 | Index: source/conf.py |
---|
26 | =================================================================== |
---|
27 | --- source/conf.py (revision 6834) |
---|
28 | +++ source/conf.py (working copy) |
---|
29 | @@ -16,7 +16,15 @@ |
---|
30 | # If extensions (or modules to document with autodoc) are in another directory, |
---|
31 | # add these directories to sys.path here. If the directory is relative to the |
---|
32 | # documentation root, use os.path.abspath to make it absolute, like shown here. |
---|
33 | -sys.path.insert(0, os.path.abspath('../../src')) |
---|
34 | +from distutils.util import get_platform |
---|
35 | +platform = '.%s-%s'%(get_platform(),sys.version[:3]) |
---|
36 | +build_lib = os.path.abspath('../../../build/lib'+platform) |
---|
37 | +sys.path.insert(0, build_lib) |
---|
38 | +print "-- path --" |
---|
39 | +print "\n".join(sys.path) |
---|
40 | +import sans.sansview |
---|
41 | +from sans.sansview import __version__ as sasview_version |
---|
42 | +print "version:",sasview_version |
---|
43 | |
---|
44 | |
---|
45 | Index: Makefile |
---|
46 | =================================================================== |
---|
47 | --- Makefile (revision 6834) |
---|
48 | +++ Makefile (working copy) |
---|
49 | @@ -48,10 +50,12 @@ |
---|
50 | |
---|
51 | clean: |
---|
52 | rm -rf $(BUILDDIR)/* |
---|
53 | + rm -rf source/api |
---|
54 | + rm *.pyc |
---|
55 | |
---|
56 | stubs: |
---|
57 | rm -rf source/api |
---|
58 | - sphinx-apidoc -o source/api -d 8 ../../src |
---|
59 | + sphinx-apidoc -o source/api -d 8 ../../build/lib.linux-x86_64-2.7 |
---|
60 | |
---|
61 | html: stubs |
---|
62 | $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html |
---|