<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Oct 4, 2014 at 4:31 PM, Markus Neteler <span dir="ltr"><<a href="mailto:neteler@osgeo.org" target="_blank">neteler@osgeo.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">On Fri, Oct 3, 2014 at 10:54 PM, Vaclav Petras <<a href="mailto:wenzeslaus@gmail.com">wenzeslaus@gmail.com</a>> wrote:<br>
> On Mon, Sep 29, 2014 at 7:11 AM, Markus Neteler <<a href="mailto:neteler@osgeo.org">neteler@osgeo.org</a>> wrote:<br>
</span>...<br>
<span class="">> Both conf.py files and Sphinx itself requires import of packages/modules. So<br>
> the documentation build must run inside a valid GRASS session. conf.py<br>
> checks if GISBASE is set which is but it seems that Python path is not,<br>
> although the Makefile contains:<br>
><br>
> $(call run_grass,$(SPHINXBUILD) ...)<br>
><br>
> Does `call run_grass` sets PYTHONPATH? It seems that it does:<br>
><br>
> PYTHONPATH="$(GRASS_PYTHONPATH)"<br>
><br>
> It even seems that variable is set properly (although with the syntax I'm<br>
> never sure):<br>
><br>
> GRASS_PYTHONPATH := $(call mkpath,$(GISBASE)/gui/wxpython,$$PYTHONPATH)<br>
> GRASS_PYTHONPATH := $(call mkpath,$(GISBASE)/etc/python,$(GRASS_PYTHONPATH))<br>
</span>...<br>
<span class="">> Now I'm wondering if the module is even there. Do you actually compile GRASS<br>
> or just the documentation?<br>
<br>
</span>I compile all GRASS 7 trunk there.<br>
<br>
I checked again. So the differences are:<br>
<br>
# generate pyGRASS sphinx manual (in docs/html/libpython/)<br>
(cd lib/python/docs/ ; make libpythonhtml)<br>
<br>
--> works ok<br></blockquote><div><br></div><div>This should not be necessary to execute if you are executing `make sphixdoc`.<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
# generate wxGUI sphinx manual etc, (in main src directory)<br>
make sphinxdoc<br>
<br></blockquote><div>This compiles both, GUI and Python. See:<br><br>./include/Make/Sphinx.make<br><br></div><div>Perhaps we can switch the order (just because GUI takes much longer than the library).<br><br></div><div>The rule sphinxdoc depends on checksphinx, so it should fail when something is bad:<br><br> @echo $(SPHINXBUILD)<br> @echo $(SPHINXAPIDOC)<br> @(type $(SPHINXBUILD) > /dev/null || (echo "ERROR: Install 'sphinx-build' software first (get from <a href="http://sphinx-doc.org">http://sphinx-doc.org</a>)" && exit 1))<br> @(type $(SPHINXAPIDOC) > /dev/null || (echo "ERROR: Install 'sphinx-apidoc' software first (get from <a href="http://sphinx-doc.org">http://sphinx-doc.org</a>)" && exit 1))<br><br></div><div>Run `make checksphinx` to see.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
--> fails (also on Fedora):<br>
<br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
...<br>
Creating file src/vnet.rst.<br>
Creating file src/web_services.rst.<br>
Creating file src/wxplot.rst.<br>
make[1]: Leaving directory<br>
`/home/neteler/software/grass71/gui/wxpython/docs/wxgui_sphinx'<br>
make -C ./gui/wxpython/docs/wxgui_sphinx/ wxguihtml<br>
make[1]: Entering directory<br>
`/home/neteler/software/grass71/gui/wxpython/docs/wxgui_sphinx'<br>
GISRC=/home/neteler/software/grass71/dist.x86_64-unknown-linux-gnu/demolocation/.grassrc71<br>
GISBASE=/home/neteler/software/grass71/dist.x86_64-unknown-linux-gnu<br>
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"<br>
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"<br>
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:"<br>
LC_ALL=C -b html -d _build/doctrees -c . src/<br>
/home/neteler/software/grass71/dist.x86_64-unknown-linux-gnu/docs/html/wxgui<br>
/bin/sh: -b: command not found<br></blockquote><div><br>No -b command, see 3 lines above, this basically mean that $(SPHINXBUILD) is not set for<br><br>$(call run_grass,$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR_HTML))<br><br></div><div>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.<br><br></div><div>Besides running `make checksphinx`, you can try to reproduce to do the steps the rule is doing, basically:<br><br>sphinx-apidoc2 --help<br>sphinx-apidoc --help<br><br></div><div>I unified the indentation in the Makefile in<br></div><div><br><a href="http://trac.osgeo.org/grass/changeset/62183">http://trac.osgeo.org/grass/changeset/62183</a><br></div><div><br></div><div>but now I see I missed one line and anyway, it should not play any role in this case:<br></div><div><br><a href="http://www.gnu.org/software/make/manual/make.html#Conditionals">http://www.gnu.org/software/make/manual/make.html#Conditionals</a><br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
make[1]: *** [wxguihtml] Error 127<br>
make[1]: Leaving directory<br>
`/home/neteler/software/grass71/gui/wxpython/docs/wxgui_sphinx'<br>
make: *** [sphinxdoc] Error 2<br>
<br>
Maybe the "make sphinxdoc" way is yet useless and I'll simply keep the<br>
previous one for the weekly cronjob.<br>
<span class=""><font color="#888888"><br></font></span></blockquote><div>If you think that the problem is in `make sphinxdoc` you an try:<br><br>cd gui/wxpython/docs/wxgui_sphinx/<br>make wxguihtml<br></div><div><br></div><div>But the previous errors were actually different, it was:<br></div><div> <br> File "conf.py", line 27, in <module><br>
from grass.script import core<br>
ImportError: No module named grass.script<br><br></div><div>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`<br><br></div><div>Vaclav<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class=""><font color="#888888">
Markus<br>
</font></span></blockquote></div><br></div></div>