#31037 closed enhancement (fixed)

Install tests in sage/tests/books

Reported by: fbissey Owned by:
Priority: major Milestone: sage-9.3
Component: distribution Keywords: sd111
Cc: arojas Merged in:
Authors: François Bissey Reviewers: Matthias Koeppe
Report Upstream: N/A Work issues:
Branch: 0fd15f7 (Commits, GitHub, GitLab) Commit: 0fd15f75b8ca79339b5a3cd97e16331b34ef8c65
Dependencies: Stopgaps:

Status badges

Description

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.

Change History (9)

comment:1 Changed 10 months ago by fbissey

  • Authors set to François Bissey
  • Branch set to u/fbissey/booktests
  • Cc arojas added
  • Commit set to 0fd15f75b8ca79339b5a3cd97e16331b34ef8c65
  • Status changed from new to needs_info

New commits:

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

comment:2 Changed 10 months ago by fbissey

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/blob/develop/src/sage/tests/books/computational-mathematics-with-sagemath/README

comment:3 Changed 10 months ago by mkoeppe

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

comment:4 Changed 10 months ago by fbissey

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/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.

comment:5 Changed 10 months ago by fbissey

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.

comment:6 Changed 10 months ago by mkoeppe

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

comment:7 Changed 10 months ago by mkoeppe

  • Status changed from needs_info to needs_review

comment:8 Changed 10 months ago by mkoeppe

  • Reviewers set to Matthias Koeppe
  • Status changed from needs_review to positive_review

comment:9 Changed 10 months ago by vbraun

  • Branch changed from u/fbissey/booktests to 0fd15f75b8ca79339b5a3cd97e16331b34ef8c65
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.