[GRASS-dev] Issues with Sphinx on osgeo server

Vaclav Petras wenzeslaus at gmail.com
Sat Oct 4 14:55:31 PDT 2014


On Sat, Oct 4, 2014 at 4:31 PM, Markus Neteler <neteler at osgeo.org> wrote:

> On Fri, Oct 3, 2014 at 10:54 PM, Vaclav Petras <wenzeslaus at gmail.com>
> wrote:
> > On Mon, Sep 29, 2014 at 7:11 AM, Markus Neteler <neteler at osgeo.org>
> wrote:
> ...
> > Both conf.py files and Sphinx itself requires import of
> packages/modules. So
> > the documentation build must run inside a valid GRASS session. conf.py
> > checks if GISBASE is set which is but it seems that Python path is not,
> > although the Makefile contains:
> >
> > $(call run_grass,$(SPHINXBUILD) ...)
> >
> > Does `call run_grass` sets PYTHONPATH? It seems that it does:
> >
> > PYTHONPATH="$(GRASS_PYTHONPATH)"
> >
> > It even seems that variable is set properly (although with the syntax I'm
> > never sure):
> >
> > GRASS_PYTHONPATH := $(call mkpath,$(GISBASE)/gui/wxpython,$$PYTHONPATH)
> > GRASS_PYTHONPATH := $(call
> mkpath,$(GISBASE)/etc/python,$(GRASS_PYTHONPATH))
> ...
> > Now I'm wondering if the module is even there. Do you actually compile
> GRASS
> > or just the documentation?
>
> I compile all GRASS 7 trunk there.
>
> I checked again. So the differences are:
>
> # generate pyGRASS sphinx manual (in docs/html/libpython/)
> (cd lib/python/docs/ ; make libpythonhtml)
>
> --> works ok
>

This should not be necessary to execute if you are executing `make
sphixdoc`.

>
> # generate wxGUI sphinx manual etc, (in main src directory)
> make sphinxdoc
>
> This compiles both, GUI and Python. See:

./include/Make/Sphinx.make

Perhaps we can switch the order (just because GUI takes much longer than
the library).

The rule sphinxdoc depends on checksphinx, so it should fail when something
is bad:

    @echo $(SPHINXBUILD)
    @echo $(SPHINXAPIDOC)
    @(type $(SPHINXBUILD) > /dev/null || (echo "ERROR: Install
'sphinx-build' software first (get from http://sphinx-doc.org)" && exit 1))
    @(type $(SPHINXAPIDOC) > /dev/null || (echo "ERROR: Install
'sphinx-apidoc' software first (get from http://sphinx-doc.org)" && exit 1))

Run `make checksphinx` to see.


> --> fails (also on Fedora):
>
>
...
> Creating file src/vnet.rst.
> Creating file src/web_services.rst.
> Creating file src/wxplot.rst.
> make[1]: Leaving directory
> `/home/neteler/software/grass71/gui/wxpython/docs/wxgui_sphinx'
> make -C ./gui/wxpython/docs/wxgui_sphinx/ wxguihtml
> make[1]: Entering directory
> `/home/neteler/software/grass71/gui/wxpython/docs/wxgui_sphinx'
>
> GISRC=/home/neteler/software/grass71/dist.x86_64-unknown-linux-gnu/demolocation/.grassrc71
> GISBASE=/home/neteler/software/grass71/dist.x86_64-unknown-linux-gnu
>
> PATH="/home/neteler/software/grass71/dist.x86_64-unknown-linux-gnu/bin:/home/neteler/software/grass71/dist.x86_64-unknown-linux-gnu/bin:/home/neteler/software/grass71/dist.x86_64-unknown-linux-gnu/scripts:$PATH"
>
> PYTHONPATH="/home/neteler/software/grass71/dist.x86_64-unknown-linux-gnu/etc/python:/home/neteler/software/grass71/dist.x86_64-unknown-linux-gnu/gui/wxpython:$PYTHONPATH"
>
> LD_LIBRARY_PATH="/home/neteler/software/grass71/dist.x86_64-unknown-linux-gnu/bin:/home/neteler/software/grass71/dist.x86_64-unknown-linux-gnu/scripts:/home/neteler/software/grass71/dist.x86_64-unknown-linux-gnu/lib:/home/neteler/software/grass71/dist.x86_64-unknown-linux-gnu/lib:"
> LC_ALL=C  -b html -d _build/doctrees   -c . src/
>
> /home/neteler/software/grass71/dist.x86_64-unknown-linux-gnu/docs/html/wxgui
> /bin/sh: -b: command not found
>

No -b command, see 3 lines above, this basically mean that $(SPHINXBUILD)
is not set for

$(call run_grass,$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR_HTML))

I don't have an idea how it can get here. If there is a problem it should
fail. So, maybe the checking is wrong. There is no documentation but the
ifs looks like they just leave $(SPHINXBUILD) undefined if something
nothing i found but then checksphinx should fail.

Besides running `make checksphinx`, you can try to reproduce to do the
steps the rule is doing, basically:

sphinx-apidoc2 --help
sphinx-apidoc --help

I unified the indentation in the Makefile in

http://trac.osgeo.org/grass/changeset/62183

but now I see I missed one line and anyway, it should not play any role in
this case:

http://www.gnu.org/software/make/manual/make.html#Conditionals

make[1]: *** [wxguihtml] Error 127
> make[1]: Leaving directory
> `/home/neteler/software/grass71/gui/wxpython/docs/wxgui_sphinx'
> make: *** [sphinxdoc] Error 2
>
> Maybe the "make sphinxdoc" way is yet useless and I'll simply keep the
> previous one for the weekly cronjob.
>
> If you think that the problem is in `make sphinxdoc` you an try:

cd gui/wxpython/docs/wxgui_sphinx/
make wxguihtml

But the previous errors were actually different, it was:

  File "conf.py", line 27, in <module>
    from grass.script import core
ImportError: No module named grass.script

Which would mean that Sphinx was running but the GRASS environment is
wrong. Now GRASS environment is OK (for libpython) or we don't know (for
wxgui) but Sphinx is broken for `make sphinxdoc`

Vaclav

Markus
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20141004/b5fe3261/attachment-0001.html>


More information about the grass-dev mailing list