sagemath/sage

Some clean up in docbuilding

jdemeyer opened this issue · 52 comments

No change in functionality, just some clean up.

In particular:

  • move the code for running Sphinx to src/sage_setup/docbuild
  • do not create and delete empty directories, instead silence the Sphinx warnings about non-existing directories
  • instead of compile(), use import
  • add a new variable SAGE_DOC_OUTPUT for src/doc/output (this is moved to local/share/doc/sage in #19963)

Depends on #19950

CC: @hivert @nathanncohen

Component: build

Author: Jeroen Demeyer

Branch: 0455d14

Reviewer: Marc Mezzarobba

Issue created by migration from https://trac.sagemath.org/ticket/19127

Commit: 2e2cb7a

New commits:

2e2cb7aDocbuilder cleanup

Changed commit from 2e2cb7a to d959af4

Branch pushed to git repo; I updated commit sha1. New commits:

d959af4builder/__init__.py should not be executable

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

ff58c9cReplace conf.py copies by symlinks
d783ee1Docbuilder cleanup

Changed commit from d959af4 to d783ee1

Dependencies: #19166

Branch pushed to git repo; I updated commit sha1. New commits:

9b12694Merge tag '6.10.beta3' into t/19127/ticket/19127

Changed commit from d783ee1 to 9b12694

Changed commit from 9b12694 to 97a6f82

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

97a6f82Merge tag '7.0.beta3' into t/19127/ticket/19127

Changed dependencies from #19166 to none

Changed commit from 97a6f82 to ea7efaa

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

ea7efaaDocbuilder cleanup

Changed commit from ea7efaa to f0f0e4c

Branch pushed to git repo; I updated commit sha1. New commits:

f0f0e4cUse `__main__` to run docbuilder

Changed commit from f0f0e4c to 2fbfe8e

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

2fbfe8eDocbuilder cleanup

Description changed:

--- 
+++ 
@@ -1,7 +1,7 @@
 No change in functionality, just some clean up.
 
 In particular:
-- move the code for running Sphinx to `src/doc/builder`
+- move the code for running Sphinx to `src/sage_setup/docbuild`
 - do not create and delete empty directories, instead silence the Sphinx warnings about non-existing directories
 - instead of `compile()`, use `import`
 - add a new variable `SAGE_DOC_OUTPUT` for `src/doc/output` (with the idea that this might be moved to `local/share/doc` in the future)

Changed commit from 2fbfe8e to 93339c2

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

93339c2Docbuilder cleanup

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

67b8e35Docbuilder cleanup

Changed commit from 93339c2 to 67b8e35

Changed commit from 67b8e35 to 7c98158

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

7c98158Docbuilder cleanup
comment:17

I don't understand what SAGE_DOC_OUTPUT is supposed to do: I tried (without reading the code)

SAGE_DOC_OUTPUT=. sage -docbuild tutorial pdf

but the pdf file still ends up at its usual location.

comment:18

Replying to @mezzarobba:

I don't understand what SAGE_DOC_OUTPUT is supposed to do

Such variables really need an absolute path, not relative.

comment:19

LGTM. Two minor comments though:

  • I wonder why you renamed the logger to doc.builder (the obvious reason to change the name would be to follow the more-or-less standard convention of “namespacing” it using the corresponding Python module name, but that's not what you do).
  • The developer guide contains a mention of SAGE_ROOT/src/doc/builder/__init__.py that probably should be updated or removed.

Branch pushed to git repo; I updated commit sha1. New commits:

537d9d2Minor fixes

Changed commit from 7c98158 to 537d9d2

Reviewer: Marc Mezzarobba

Description changed:

--- 
+++ 
@@ -4,4 +4,4 @@
 - move the code for running Sphinx to `src/sage_setup/docbuild`
 - do not create and delete empty directories, instead silence the Sphinx warnings about non-existing directories
 - instead of `compile()`, use `import`
-- add a new variable `SAGE_DOC_OUTPUT` for `src/doc/output` (with the idea that this might be moved to `local/share/doc` in the future)
+- add a new variable `SAGE_DOC_OUTPUT` for `src/doc/output` (this is moved to `local/share/doc/sage` in #19963)
comment:24

That failure looks unrelated to the documentation, so I would be surprised if that buildbot error was due to this ticket. Which other tickets did you test?

comment:25

Unrelated to the doctest failure: should the clean target in src/doc/Makefile also do something like rm -f common/*.pyc? It would be good to clean up common/builder.pyc and other left-over files.

comment:27

The problem seems to be that doctesting the old src/doc/output files fails because they are no longer consider "Sage library" files. Easily fixed by removing src/doc/output.

Changed commit from 537d9d2 to 2b37da3

Branch pushed to git repo; I updated commit sha1. New commits:

2b37da3Remove old src/doc/ouput and .pyc files
comment:29

Oops, I was confusing this ticket with #19963. Never mind this last commit.

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

Changed commit from 2b37da3 to 537d9d2

Branch pushed to git repo; I updated commit sha1. New commits:

2f8fe6bUse force_lib=True for "doc" modules

Changed commit from 537d9d2 to 2f8fe6b

comment:33

I will merge #19950 because these tickets conflict.

Dependencies: #19950

Changed commit from 2f8fe6b to 0455d14

Branch pushed to git repo; I updated commit sha1. New commits:

b5e3668allow the docbuild of a single file to build also underscore methods
5352485Merge branch 'public/19950' into 7.1.b0
0455d14Merge remote-tracking branch 'trac/public/19950' into t/19127/ticket/19127

Changed branch from u/jdemeyer/ticket/19127 to 0455d14

Changed commit from 0455d14 to none

comment:37

Is this the reason for #20255?