-
-
Notifications
You must be signed in to change notification settings - Fork 706
Docs: build directly using sphinx #41156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
|
I never managed to actually start work on getting rid of our sage_autodoc.py. If this ticket works, I am going to adopt it in sage-on-gentoo faster than you can say sphinx-9. I did the last few migrations of sage_autodoc.py at sphinx-8, sphinx-8.2 and may be some earlier and it looks like it would need another migration at sphinx-9. |
|
Alas, it dies in |
|
My inspection so far tells me that I need to either install sage_docbuild when I install sage (and that is probably needed for a legacy build at this stage) or I need to copy |
| # --------------------- | ||
|
|
||
| # To find sage_docbuild (from the builddir) | ||
| sys.path.insert(0, '../../../../src/') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the line that's currently getting me. It is fragile in that it requires you to follow an exact workflow about the building directory location. I am wondering how to make it more foolproof.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am making progress after replacing the line with
sys.path.insert(0, SAGE_DOC_SRC + '/..')
If we were importing SAGE_SRC, it could be used directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you invoke the docbuilding? And how do you set SAGE_SRC/DOC_SRC?
Another solution would be to copy the stuff in the sage_docbuild directory to the build directory. Would that work for you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, SAGE_DOC_SRC is set in my build script https://github.com/cschwan/sage-on-gentoo/blob/4cfde2c8ca8af625ee6d84bd212c3e0fa5665a98/sci-mathematics/sagemath-doc/sagemath-doc-9999.ebuild#L101 (the file is not completely up to date compared to what I am working with). But I thought that in vanilla, the default value as sourced from env would work. I am using SAGE_DOC_SRC because it is imported earlier in conf.py so it is available.
I traditionally have setup a build_doc folder fully out of source. So one level up compared to the builddir you are using by default. So at the moment my script looks like
meson compile -C "${WORKDIR}/build_doc" doc-html
${EPYTHON} -m sphinx "${WORKDIR}/build_doc/src/doc/en" "${WORKDIR}/build_doc/src/doc/html/en/"
Where EPYTHON is the python used for building and WORKDIR is the folder which contains the sage root folder.
|
OK, so after my little fix I can go much further. It did not complete, at the end I got a lot warning like which do happen with the legacy build as well in the first pass. Usually it resolves itself in a second pass. But thanks to the lack of output, I do not if it is definite or just not the final pass where those things get resolved. The build broke mysteriously The files exists but obviously they are not looked for from the right path |
|
And building with sphinx 9.0 fails equally in this build and the legacy build. Previous results were with sphinx-8.2.3. |
Do you mean building with this PR using
Thanks, I'll look into it. |
Building with this PR is very slow. That option should speed things up considerably. |
Instead of our custom docbuilder, build the documentation simply by running:
(has to be run after an initial
meson compile -C builddir doc-htmlwhich generates some of the rst files)The old way to build the docs is not (yet) removed and can be activated via:
📝 Checklist
⌛ Dependencies