Bug#931223: sagemath: sage test fails to test sagetex example_doctest.sage generated from sagetex example.tex

Tobias Hansen thansen at debian.org
Fri Jun 28 16:09:44 BST 2019


Hi,

yes, to run doctests one needs to set SAGE_SRC and SAGE_PKGS. From sagemath's README.Debian:

One can run the tests using the installed sage packages. First, get the source
code for this package (`apt-get source sagemath`), and make sure the Debian
patches are applied. Then, from the 'sage' directory in the sources:

 *$ export -n SAGE_LOCAL SAGE_ROOT
 *$ SAGE_SRC=$(pwd)/src SAGE_PKGS=$(pwd)/build/pkgs sage -t -p --long --logfile=ptestlong.log --all

Hopefully we can refactor and simplify the package one day and then also doctesting should hopefully work out of the box.

What you are trying is slightly different but it boils down to patching sage to do doctests without having SAGE_PKGS around.

Best,
Tobias

On 6/28/19 4:25 PM, Jerome Benoit wrote:
> Source: sagemath
> Version: 8.6-6
> Severity: normal
>
> Dear Maintainer,
>
> for the sake of curiosity, I have just tried to doctest the sage script generated
> by SageTeX for the example.tex : the test reveals an issue with sage-runtests .
> The issue can be reproduce as follows (when sagetex-doc is installed):
>
> cd <A FOLDER>
> cp -p /usr/share/doc/sagetex/examples/example.tex .
> pdflatex example.tex
> sage -t example_doctest.sage
>
> The last command gives:
>
> Traceback (most recent call last):
>   File "/usr/share/sagemath/bin/sage-runtests", line 162, in <module>
> 		DC = DocTestController(options, args)
> 	File "/usr/lib/python2.7/dist-packages/sage/doctest/control.py", line 357, in __init__
> 		for pkg in list_packages('optional', local=True).values():
> 	File "/usr/lib/python2.7/dist-packages/sage/misc/package.py", line 228, in list_packages
> 		for p in os.listdir(SAGE_PKGS):
> OSError: [Errno 2] No such file or directory: '/usr/share/sagemath/build/pkgs'
>
> As it does not look as a sagetex issue but rather as a sagemath issue, I submitted this issue
> as sagemath bug.
>
> Thanks,
> Jerome
>
>
>
> -- System Information:
> Debian Release: Stretch*
>   APT prefers stable
>   APT policy: (990, 'stable'), (500, 'stable-updates')
> Architecture: amd64 (x86_64)
> Foreign Architectures: i386
>
> Kernel: Linux 4.15.0-0.bpo.2-amd64 (SMP w/8 CPU cores)
> Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8), LANGUAGE=en_GB:en (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/dash
> Init: sysvinit (via /sbin/init)
>



More information about the debian-science-maintainers mailing list