Skip to content
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

Documentation: Explain how to execute the doctests #1504

Closed
HereAround opened this issue Aug 10, 2022 · 4 comments · Fixed by #1566 or #1572
Closed

Documentation: Explain how to execute the doctests #1504

HereAround opened this issue Aug 10, 2022 · 4 comments · Fixed by #1566 or #1572
Assignees
Labels
Decision documentation Improvements or additions to documentation enhancement New feature or request

Comments

@HereAround
Copy link
Member

Oscar.build_doc() does not execute the doc_tests. So as a humble user or developer, one might wonder "how do I execute the doc tests locally to test my code?". Unless I am mistaken, the documentation for this question is rather sparse. Here are a couple of suggestions from communication with @thofma.

One can provide additional arguments to Oscar.build_doc() so that the doctests are being executed:

  • build_doc(; doctest = true),
  • build_doc(; doctest = true, strict = true).

In the past, I used to directly execute the make.jl file in the docs folder. I recently noticed that this triggered a lot of failures. As @thofma explained to me, the output format/ordering of output is different in julia 1.6 and 1.7. OSCAR sticks to the standard of the LTS 1.6 while I was using 1.7 locally. Maybe also worth mentioning towards documentation?

And of course, there are options that can be used for a direct execution of the make.jl in the docs folder. @thofma suggested the following:

  • julia --project=. make.jl
  • Probably also julia --project=. -e 'using Pkg; Pkg.instantiate() before.
@HereAround HereAround added enhancement New feature or request documentation Improvements or additions to documentation Decision labels Aug 10, 2022
@fingolfin
Copy link
Member

Regarding tests: This should be covered by the developer docs. A minimal start is here: https://oscar-system.github.io/Oscar.jl/dev/DeveloperDocumentation/documentation/#Automatically-repairing-jldoctests -- but of course not enough. IMHO there should be a separate section on "Tests", and in addition to what you mention, it should also discuss Oscar.test_module.

Regarding make.jl: I don't think executing this "directly in the docs folder" is a good idea, and we should not recommend that.

We definitely should state that Julia 1.6 is the reference for doctests, at the very place in the section of the dev docs I just linked to, but of course can also be mentioned in further places.

@lkastner lkastner linked a pull request Sep 26, 2022 that will close this issue
@lkastner
Copy link
Member

I dealt with some of these in the PR above. Nevertheless this will stay a recurring issues, since people don't read documentation.

Is there a reason that build_doc and test_module don't have docstrings? From the Julia terminal the names don't seem to be taken, so that could be a viable option.

@lkastner lkastner self-assigned this Sep 26, 2022
@lkastner lkastner reopened this Sep 27, 2022
@fingolfin
Copy link
Member

I dealt with some of these in the PR above. Nevertheless this will stay a recurring issues, since people don't read documentation.

Is there a reason that build_doc and test_module don't have docstrings? From the Julia terminal the names don't seem to be taken, so that could be a viable option.

I can't think of a reason, other than "nobody did it yet". Sounds like a good idea to me!

@lkastner
Copy link
Member

I can't think of a reason, other than "nobody did it yet". Sounds like a good idea to me!

Ok, I'll make a PR with that and restructure a little. Probably won't be perfect, but should solve this issue.

@lkastner lkastner linked a pull request Sep 27, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Decision documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
3 participants