how to use sphinx in external project?

34 views
Skip to first unread message

Vincent Delecroix

unread,
Sep 25, 2020, 12:43:19 PM9/25/20
to sage-devel
Dear all,

I used to have sphinx documentation in many Python libraries that
depends on SageMath (such as [admcycles], [surface_dynamics]).
It appears that in none of them I can build the documentation
properly anymore (with the Sage compiled from source or downloaded
from the tarball). The minimal example is [cvolume] where the failure
is described in the pull request

https://github.com/eduryev/cvolume/pull/1

and where `make html` ends with

```
Exception occurred:
File
"/opt/sage/local/lib/python3.8/site-packages/sage/repl/user_globals.py",
line 82, in _check
raise RuntimeError(
RuntimeError: the user-space globals dictionary has not been
initialized. Use initialize_globals() or set_globals() or use a
different function which doesn't need these globals
```

Any help appreciated!

[cvolume] https://github.com/eduryev/cvolume
[admcycles] https://gitlab.com/jo314schmitt/admcycles
[surface_dynamics] https://gitlab.com/videlec/surface_dynamics

Best
Vincent

Vincent Delecroix

unread,
Sep 25, 2020, 1:10:18 PM9/25/20
to sage-devel
It appears that having the line

from sage.all import *

breaks sphinx. I don't know why, but removing them
get the documentation compiled.

Vincent

Sébastien Labbé

unread,
Sep 25, 2020, 2:16:35 PM9/25/20
to sage-devel
With 9.2.beta13, I can build the documentation of package slabbe with no problem. My __init__.py file contains this:

# For sphinx to work, we first need to import the sage library
from sage.all_cmdline import *

And I make doc like this (with calls the sphinx makefile):
cd docs && sage -sh -c "make html"

Reply all
Reply to author
Forward
0 new messages