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

Install tests in sage/tests/books #31037

Closed
kiwifb opened this issue Dec 11, 2020 · 11 comments
Closed

Install tests in sage/tests/books #31037

kiwifb opened this issue Dec 11, 2020 · 11 comments

Comments

@kiwifb
Copy link
Member

kiwifb commented Dec 11, 2020

Following sd111 discussion at #31016 we noted that tests in sage/tests/books are not installed and therefore not doctested when doctests are run from a globally installed sage as is done by the like of sage-on-gentoo and Arch.

CC: @antonio-rojas

Component: distribution

Keywords: sd111

Author: François Bissey

Branch/Commit: 0fd15f7

Reviewer: Matthias Koeppe

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

@kiwifb kiwifb added this to the sage-9.3 milestone Dec 11, 2020
@kiwifb
Copy link
Member Author

kiwifb commented Dec 11, 2020

Author: François Bissey

@kiwifb
Copy link
Member Author

kiwifb commented Dec 11, 2020

Commit: 0fd15f7

@kiwifb
Copy link
Member Author

kiwifb commented Dec 11, 2020

Branch: u/fbissey/booktests

@kiwifb
Copy link
Member Author

kiwifb commented Dec 11, 2020

New commits:

0fd15f7make files in the tests/books folder to be automatically installed

@kiwifb
Copy link
Member Author

kiwifb commented Dec 11, 2020

comment:2

Before putting it for review we need to make a final decision on the README file attached to the "computational mathematics with sagemath" book.
https://github.com/sagemath/sage-prod/blob/develop/src/sage/tests/books/computational-mathematics-with-sagemath/README

@mkoeppe
Copy link
Member

mkoeppe commented Dec 11, 2020

comment:3

I think I would prefer a solution that installs all these files as package data rather than as Python packages.

@kiwifb
Copy link
Member Author

kiwifb commented Dec 11, 2020

comment:4

I am not even sure that sage/tests is the right location for them in the first place. In judson-abstract-algebra we have solution of problems from the book, in a doctestable format. And in computational-mathematics-with-sage we have autogenerated example, that are meant to be doctestable. In fact there is a disconnect between the name of the files and their own description. See https://github.com/sagemath/sage-prod/blob/develop/src/sage/tests/books/computational-mathematics-with-sagemath/calculus_doctest.py for example.

They have been put into sage so they can be updated on change of behavior, but a better location may be somewhere under doc and that could still be doctested.

@kiwifb
Copy link
Member Author

kiwifb commented Dec 11, 2020

comment:5

Just to re-iterate:

If it is .py files that you install under PYTHON_PATH (site-package or otherwise), it should be precompiled. This happens automatically if you install things as python package but not as package data. QA in Gentoo would tell me to manually compile them, effectively it would introduce something I have to do on my side.

If we install them as real data by changing them to .rst files for example, we could then install them as package data, but we would need some kind of runner for them like sage/doctest/test.py is for the content of sage/doctest/tests/.

Putting them under doc is interesting but may cause problem with the doc build system. We don't want to produce html or pdf.

@mkoeppe
Copy link
Member

mkoeppe commented Dec 11, 2020

comment:6

OK, adding the __init__ files seems like a good simple solution then.

@mkoeppe
Copy link
Member

mkoeppe commented Dec 11, 2020

Reviewer: Matthias Koeppe

@vbraun
Copy link
Member

vbraun commented Dec 14, 2020

Changed branch from u/fbissey/booktests to 0fd15f7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants