sagemath/sage

Remove runtime dependency on sage_docbuild introduced in #33763

mkoeppe opened this issue · 34 comments

(from #33763 comment:19)

We create a new module sage.misc.sagedoc_conf, to which we move the parts of sage_docbuild.conf needed by sage.misc.sphinxify.

Depends on #33922

CC: @kwankyu @jhpalmieri @antonio-rojas

Component: documentation

Author: Matthias Koeppe, Kwankyu Lee

Branch/Commit: 0a02496

Reviewer: Kwankyu Lee, Matthias Koeppe

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

Description changed:

--- 
+++ 
@@ -1,3 +1,4 @@
 (from [#33763 comment:19](https://github.com/sagemath/sage/issues/33763#comment:19))
 
+We create a new module `sage.misc.sagedoc_conf`, to which we move the parts of `sage_docbuild.conf` needed by `sage.misc.sphinxify`.
 

Commit: f2b34ae

Author: Matthias Koeppe

New commits:

2915352src/sage/misc/sagedoc_conf.py: New, use it instead of sage_docbuild.conf
f2b34aesrc/sage/misc/sagedoc_conf.py: Move default_role here from sage_docbuild.conf
comment:4

This one setting is what is needed to pass the doctests of sage.misc.sagedoc.
Not sure what else is needed

comment:5

I was waiting for the next beta that is merged with #33922, before I start to work on this ticket.

I think many more settings in sage_docbuild/conf.py need to move into sage/misc/sagedoc_conf.py, in anticipation of #33682.

Changed commit from f2b34ae to none

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

9fa7101Add missing title to conf.py
7b17c2dSplit sage_docbuild.conf to sage.misc.sagedoc_conf

Changed author from Matthias Koeppe to Matthias Koeppe, Kwankyu Lee

Dependencies: #33922

Changed commit from 7b17c2d to 282270f

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

282270fFix docs
comment:12

I moved more settings which seem to have been used by sphinxify.

comment:13

I'm not very comfortable with the use of the os.environ variables in sagedoc_conf. I think it would be best if this was done in the docbuild only

comment:14

Replying to @mkoeppe:

I'm not very comfortable with the use of the os.environ variables in sagedoc_conf. I think it would be best if this was done in the docbuild only

os.environ is used in two places:

(1) in skip_member(): skip_member() skips problematic members of a module.

(2) in setup() to decide whether or not to include skip_TESTS_block(): skip_TESTS_block() skips TESTS: blocks.

For (1), SAGE_CHECK_NESTED and SAGE_DOC_UNDERSCORE environment variables are used

For (2), SAGE_SKIP_TESTS_BLOCKS environment variables is used.

If we decide on the defaults to these 3 variables, then we can remove them from sagedoc_conf. What would be reasonable defaults?

comment:15

Replying to @kwankyu:

If we decide on the defaults to these 3 variables, then we can remove them from sagedoc_conf. What would be reasonable defaults?

We may remove skip_member() altogether, and include skip_TESTS_block().

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

c2766bfMove skip_member() to sage_docbuild

Changed commit from 282270f to c2766bf

comment:17

Replying to @sagetrac-git:

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

c2766bfMove skip_member() to sage_docbuild

It's not completely moved it seems

sage: integrate?
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Input In [1], in <cell line: 1>()
----> 1 get_ipython().run_line_magic('pinfo', 'integrate')

[...]

File /usr/lib/python3.10/site-packages/sage/misc/sagedoc_conf.py:160, in setup(app)
    158 app.connect('autodoc-process-docstring', process_inherited)
    159 app.connect('autodoc-process-docstring', skip_TESTS_block)
--> 160 app.connect('autodoc-skip-member', skip_member)
    161 app.add_transform(SagemathTransform)

NameError: name 'skip_member' is not defined

Changed commit from c2766bf to 4296851

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

4296851Move the remnants of skip_member from sagedoc_conf
comment:19

Replying to @antonio-rojas:

It's not completely moved it seems

Obviously my mistake. Fixed now.

comment:20
+    assert app.srcdir.startswith(SAGE_DOC_SRC)

I think this is not a good change because sage -docbuild is also used by user packages

Changed commit from 4296851 to 0a02496

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

45f9ff3Merge branch 'develop'
0a02496Change assert back to if
comment:22

Replying to @mkoeppe:

+    assert app.srcdir.startswith(SAGE_DOC_SRC)

I think this is not a good change because sage -docbuild is also used by user packages

Okay. Removed assert and restored if.

Reviewer: ..., Matthias Koeppe

comment:23

positive review from my side

Changed reviewer from ..., Matthias Koeppe to Kwankyu Lee, Matthias Koeppe

comment:24

Thank you.

Changed branch from u/klee/33936 to 0a02496