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
Make search_doc independent of sage_setup #26227
Comments
Changed keywords from none to packaging |
Commit: |
Author: Antonio Rojas |
This comment has been minimized.
This comment has been minimized.
New commits:
|
comment:3
Thanks for copying me. Those bits are a part of something I just remove from sage https://github.com/cschwan/sage-on-gentoo/blob/master/sci-mathematics/sage/files/sage-8.4-sagedoc.patch . I wonder if it is time for it to disappear in sage proper too. Why do I remove that bit? This check at runtime that the documentation has been built - it may have been helpful at some point during early sage development but I don't believe it should still be the case. Furthermore, this effectively depends on the presence (fake or real) of sage's documentation source. And of course we disapprove of that in distro. Finally if the search fails, it suggests you do stuff that is not supported for user on a distro ( |
comment:4
It would be great to get rid of all that code, yes. If devs agree to that I'll happily withdraw this. |
comment:5
@kiwifb: Is there some good way of detecting whether you are on a distro, and then conditionally evaluate the code? My view has been for a long time that a Sage installation (any software installation, really) is not complete without documentation, so I want some sort of check. (I don't think you're advocating removing that big chunk of code always, just in your distro, but if we can make things work for both settings, why not?) Can we set some environment variable, or touch some file, or do something else to indicate that it's a distro and not a from-source or from-binary installation? @antonio-rojas: By the way, an alternative to the branch here: rather than to duplicate code and variable definitions from sage_setup.docbuild, is to define the relevant variables in sage.misc.sagedoc or sage.env, and then import them in sage_setup.docbuild. Duplication is usually a bad idea: harder to maintain and harder to diagnose problems. (sage_setup.docbuild already has some imports from the Sage library.) |
comment:6
I understand the concern about the documentation (or at least some documentation - in sage-on-gentoo I allow for some language selection with the caveat that only english is complete). The code is useful for someone writing new code with the associated documentation but it is difficult to justify it at runtime for everyone. There no current way to say we are a distro, although we could come up with one :) Overall I think the concern that documentation is present could be checked by a doctest rather than anytime you do a search. I am OK for sage's source code to be referenced during a doctest. |
comment:8
Okay, how about something like this? I tried to write it so it would work if New commits:
|
comment:9
I am not too crazy about it, I'd like other people opinions and some reflection time before completely dismissing the approach. But my first reaction is as follow
I guess more generally I didn't think doctesting that some or all documentation has been built/installed would need that much machinery that in turn needs its own problematic doctests. Is the added complexity worth it? But thank you for showing what you think it should look like. |
comment:10
Some more thoughts. Using sources at runtime is forbidden but testing is ideally run before install time and certainly before packaging for binary distro. We don't expect users installing binary packages to be able to run the test suite. Apart from some rare cases it is just not present to be run anyway. So relying on SAGE_DOC_SRC at testing is fine. Nevertheless there is a general feeling that the list of language may belong to env.py rather than somewhere in sage_setup. Something more satisfactory could be constructed there. There are many moving parts and I am considering giving it a shot from the current branch and some thinking time. |
comment:11
Ping to other distro guys, do you have a definition for |
comment:12
Replying to @kiwifb:
To really test whether the built documentation is present, you need access to
If you don't care about doctests passing, or if you only care about doctests passing if you have intact Does it at least make sense to have a separate function (as in my branch) that just tests whether the documentation is built, along with a doctest? |
comment:13
Replying to @jhpalmieri:
Yes.
I must say I am puzzled by my colleagues insisting the tests should pass without the doc. I guess technically I have it run OK with just some languages of the documentation but I was not expecting it to pass with none. But having the ability to test the html documentation separately is not absurd. I agree you should at least have "something that look like SAGE_DOC_SRC". Again, like I said using sources for testing purposes is OK.
Yes, I hadn't gone as far as thinking of a new function when I brought you the idea of doctesting but it make sense for it to exist and to be the thing tested. The only issue I may have is: "is it useful to have this available at runtime?" Which then turns into where is it appropriate to put this. |
comment:14
And if it is not needed at runtime, my reaction is to shove it into sage_setup. |
comment:15
Replying to @kiwifb:
I don't agree with this. Binary packages have a different folder structure than the one in sage-the-distribution and it's important to make sure that everything works as intended, and the way to check that is by running the test suite, and it needs to be done when the package is installed and the source files are no longer available. This helps detecting runtime dependencies on source files that should be removed, and can't be detected by running the test suite on sage-the-distribution. |
comment:16
|
comment:17
Replying to @jhpalmieri:
The same applies to packagers who build distro packages, so I don't see why that case should be treated differently.
We ship docs as a separate, optional package, so such a warning would be quite useful. |
comment:18
Replying to @antonio-rojas:
I agree with arojas. I think testing is ideally run after install time, under identical conditions as if the package was installed on a users machine. Because that is what we want to test: That sage is fully functional for a user. What does it help when sage works after build but may break after installation? I personally just ship the sage source code. Why do you not want to do that? The only negative I see is the disk space, which is not that much. |
comment:19
Replying to @antonio-rojas:
Does your main distribution include |
comment:20
Replying to @jhpalmieri:
I think a doctest that makes sure sage can find its documentation is very valuable. However it shouldn't be mandatory to build sage. That is why I originally introduced
That would be nice. |
comment:21
Replying to @jhpalmieri:
I ship two packages: |
comment:22
Replying to @jhpalmieri:
We do define SAGE_DOC_SRC because it is still required by Sage at runtime (ideally it shouldn't). For us, simply checking whether $SAGE_DOC/html is present would be enough. |
comment:23
We do define it too, but just a dummy value:
Where the wrapper may set |
comment:24
Maybe you should rip out all of the stuff that François mentions in comment:3, and instead check for the presence of I'm assuming that distributions will either include no documentation or will include (almost) all of it. With this approach, if for some reason someone decided to only include the stuff in Italian, then |
comment:25
Replying to @jhpalmieri:
Sorry for the delay. My job had to take priority over the last few days. It seems like arojas and timokau have a different concept of what should be tested and when compared to me and I suspect Debian. That is unexpected but not a show stopper to me. People should be able to do what they think they need to do unless it is outrageous in some ways. I would totally be in favor of John's last proposal. Rip this particular code and check whether the (or some) documentation is available when searching. |
This comment has been minimized.
This comment has been minimized.
comment:28
Done as suggested in comment:25 |
Reviewer: François Bissey |
comment:29
Good enough for me. |
Changed branch from u/arojas/make_search_doc_independent_of_sage_setup to |
search_doc currently imports stuff from sage_setup, which shouldn't be needed by sage at runtime. It also relies on the sage doc source to be present, which is not necessarily true for distro packages.
This patch replaces the current exhaustive check that all translated docs have been built by a simple check that $SAGE_DOC/html exists.
CC: @timokau @kiwifb @saraedum
Component: documentation
Keywords: packaging
Author: Antonio Rojas
Branch/Commit:
b3abf9c
Reviewer: François Bissey
Issue created by migration from https://trac.sagemath.org/ticket/26227
The text was updated successfully, but these errors were encountered: