sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.41k stars 475 forks source link

./configure --disable-doc #32759

Closed mkoeppe closed 2 years ago

mkoeppe commented 3 years ago

This switch will disable the docbuild and avoid installing its many dependencies (sphinx...).

In contrast to other packages, pplpy's docbuild is enabled unless explicitly disabled by setting SAGE_SPKG_INSTALL_DOCS=no. We move it to a separate package pplpy_doc and make it a dependency of sagemath_doc_html.

Split out from #31396.

We also add argon2_cffi and nbclient to the packages disabled upon --disable-notebook.

Depends on #29039

CC: @tobiasdiez @dimpase @jhpalmieri @sagetrac-tmonteil

Component: build: configure

Author: Matthias Koeppe, John Palmieri

Branch/Commit: 43221d0

Reviewer: John Palmieri, Matthias Koeppe

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

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

Changed commit from 4c11aab to afa2f80

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

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

28cf775src/bin/sage-runtests (_get_optional_defaults): No need to include sagemath_doc_html here
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

Changed commit from afa2f80 to 28cf775

mkoeppe commented 2 years ago
comment:45

Could you push the change from comment:33 to the ticket please?

jhpalmieri commented 2 years ago

Changed branch from u/mkoeppe/__configure___disable_doc to u/jhpalmieri/__configure___disable_doc

mkoeppe commented 2 years ago
comment:47

Replying to @jhpalmieri:

Should we expect doctests to pass with ./configure --disable-doc? I get

src/sage/misc/sagedoc.py  # 8 doctests failed [...]

Not sure what to do with these ones. What's happening here is that sage.misc.sagedoc.detex has a run-time dependency on Sphinx.


New commits:

10de6fdtrac 32759: doctest sage_setup and sage_docbuild conditionally
mkoeppe commented 2 years ago

Changed commit from 28cf775 to 10de6fd

mkoeppe commented 2 years ago

Changed branch from u/jhpalmieri/__configure___disable_doc to u/mkoeppe/__configure___disable_doc

mkoeppe commented 2 years ago

Changed commit from 10de6fd to 4213f8a

mkoeppe commented 2 years ago
comment:49

Replying to @mkoeppe:

Yes, I think it should be autodetected already because sagemath_doc_html is just an installed package

Actually, at the moment this is not true because sage.doctest.control only looks at the optional packages.


New commits:

4213f8asage.misc.sagedoc: Do not fail if sphinx cannot be imported
jhpalmieri commented 2 years ago
comment:50

What mechanism adds sage.geometry.polyhedron and sage_spkg to the list of tags?

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

Changed commit from 4213f8a to 80513e3

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

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

b142e34sage.features.sphinx: New
80513e3src/sage/doctest/control.py: Add test for Sphinx feature
mkoeppe commented 2 years ago
comment:52

It's happening in the lines of code in the middle of which I have just inserted a test for sphinx

mkoeppe commented 2 years ago
comment:53

In #32174 I am hoping to unify all that

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

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

7d26e21sage.features.sagemath.sagemath_doc_html: New
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

Changed commit from 80513e3 to 7d26e21

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

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

bb1626asage.features.sagemath.sagemath_doc_html: Fixup
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

Changed commit from 7d26e21 to bb1626a

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

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

a24c3bdsrc/sage/misc/sagedoc.py: Mark some doctests # optional - sphinx
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

Changed commit from bb1626a to a24c3bd

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

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

3e9770bsage.features.StaticFile: Accept directories too
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

Changed commit from a24c3bd to 3e9770b

mkoeppe commented 2 years ago

Changed author from Matthias Koeppe to Matthias Koeppe, John Palmieri

jhpalmieri commented 2 years ago
comment:59

By the way, this fails:

make distclean
./configure --disable-doc
make
make doc-html

I think the error boils down to

[reference] intersphinx inventory '/Users/palmieri/Desktop/Sage/sage_builds/TESTING/sage-9.5.beta5/local/share/doc/pplpy/objects.inv' not fetchable due to <class 'FileNotFoundError'>: [Errno 2] No such file or directory: '/Users/palmieri/Desktop/Sage/sage_builds/TESTING/sage-9.5.beta5/local/share/doc/pplpy/objects.inv'

The problem is that pplpy doesn't build its documentation the first time, and then it doesn't get rebuilt when make doc-html is run. I don't know how to fix this.

jhpalmieri commented 2 years ago
comment:60

With make distclean && ./configure && make ptestlong, I get two doctest failures:

File "src/sage/all.py", line 31, in sage.all
Failed example:
    [inspect.getmodule(f).__name__ for f in frames if is_not_allowed(f)]
Expected:
    []
Got:
    ['pytz', 'importlib.resources']

and

File "src/sage/misc/sagedoc.py", line 31, in sage.misc.sagedoc
Failed example:
    "sphinx" in sys.modules
Expected:
    False
Got:
    True
mkoeppe commented 2 years ago
comment:61

Replying to @jhpalmieri:

The problem is that pplpy doesn't build its documentation the first time, and then it doesn't get rebuilt when make doc-html is run. I don't know how to fix this.

We can introduce a separate package pplpy_doc, something that would actually also make sense for the upstream Python package.

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

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

e4a7290build/pkgs/pplpy_doc: Split pplpy docbuild out as a separate package
ee4e50abuild/pkgs/sagemath_doc_html/dependencies: Add pplpy_doc
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

Changed commit from 3e9770b to ee4e50a

mkoeppe commented 2 years ago

Changed dependencies from #31356 to #31356, #32745

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

Changed commit from ee4e50a to 810f26f

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

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

f681abbbuild/bin/sage-spkg: Also source sage-src-env-config so that SAGE_VENV is available
7438449src/bin/sage-env: Do not skip the script if SAGE_ENV_SOURCED was set but SAGE_VENV has changed
b07c8e3build/bin/sage-spkg: Remove workaround of setting of PATH in the generated package scripts
4af9a24Merge #32745
810f26fsrc/sage/misc/sagedoc.py: Test that sphinx is not imported in a fresh Sage copy
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

Changed commit from 810f26f to d280c9c

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

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

f75d33fTrac #32836: don't let libSingular clobber the user's PATH.
d280c9cMerge #32836
mkoeppe commented 2 years ago

Changed dependencies from #31356, #32745 to #31356, #32745, #32836

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

Changed commit from d280c9c to 7960b90

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

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

7960b90src/sage/all.py: Update doctest
mkoeppe commented 2 years ago
comment:68

Replying to @jhpalmieri:

With make distclean && ./configure && make ptestlong, I get two doctest failures:

File "src/sage/all.py", line 31, in sage.all
Failed example:
    [inspect.getmodule(f).__name__ for f in frames if is_not_allowed(f)]
Expected:
    []
Got:
    ['pytz', 'importlib.resources']

I've updated this doctest for the stuff that is pulled in by the doctest framework via Sphinx.

and

File "src/sage/misc/sagedoc.py", line 31, in sage.misc.sagedoc
Failed example:
    "sphinx" in sys.modules
Expected:
    False
Got:
    True

Fixed by starting a fresh interpreter for this test. Had to pull in 2 tickets that fixed issues with recursive invocation of sage

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

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

687e5basrc/sage/features/sagemath.py: Add doctests
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

Changed commit from 7960b90 to 687e5ba

mkoeppe commented 2 years ago
comment:70

With --disable-doc, make doc-html goes through but ends with

touch: /var/lib/sage/installed/sagemath_doc_html-none: No such file or directory
make[2]: *** [sagemath_doc_html-SAGE_DOCS-no-deps] Error 1
jhpalmieri commented 2 years ago
comment:72

For reasons I don't understand, my computer is now refusing to build the plots in the documentation — it keeps hanging in references/plotting. After fighting with this for a while, I've given in and am resuming testing using export SAGE_DOCBUILD_OPTS=' --no-plot'.

(Not related to this ticket: this happens with the develop branch, too.)

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

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

40a9760build/make/Makefile.in: Raise an error if installation into disabled installation tree is attempted
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

Changed commit from 687e5ba to 40a9760

mkoeppe commented 2 years ago
comment:74

Replying to @mkoeppe:

With --disable-doc, make doc-html goes through but ends with

touch: /var/lib/sage/installed/sagemath_doc_html-none: No such file or directory
make[2]: *** [sagemath_doc_html-SAGE_DOCS-no-deps] Error 1

Fixed now by explicitly raising a clear error.

Do we want make doc, make doc-html to work when --disable-doc has been configured?

jhpalmieri commented 2 years ago
comment:75

Replying to @mkoeppe:

Do we want make doc, make doc-html to work when --disable-doc has been configured?

Good question, I don't know. Should the following work? Does it work?

make distclean
./configure --disable-doc
make
./configure --enable-doc # without make distclean or similar
make doc-html
jhpalmieri commented 2 years ago
comment:76

Replying to @jhpalmieri:

Replying to @mkoeppe:

Do we want make doc, make doc-html to work when --disable-doc has been configured?

Good question, I don't know.

I think I would be happy if it didn't work but if there were a clear error message.

% make doc
...
Error: Sage build configured with --disable-doc, so building the documentation will not work. To fix this, ...
mkoeppe commented 2 years ago
comment:77

Replying to @jhpalmieri:

Should the following work? Does it work?

make distclean
./configure --disable-doc
make
./configure --enable-doc # without make distclean or similar
make doc-html

Yes, I think this works

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

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

51f3002build/make/Makefile.in: Better error message when docbuild is attempted but configure --disable-doc has been used
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 2 years ago

Changed commit from 40a9760 to 51f3002