Opened 15 months ago

Closed 10 months ago

Last modified 9 months ago

#32174 closed enhancement (fixed)

doctests: Detect "safe" external features even if "--optional=external" is not used

Reported by: Matthias Köppe Owned by:
Priority: critical Milestone: sage-9.5
Component: doctest framework Keywords:
Cc: Dima Pasechnik, Samuel Lelièvre, Antonio Rojas, François Bissey, Kwankyu Lee, Sébastien Labbé, Vincent Delecroix Merged in:
Authors: Matthias Koeppe, Sébastien Labbé Reviewers: Sébastien Labbé
Report Upstream: N/A Work issues:
Branch: 41c4cd4 (Commits, GitHub, GitLab) Commit:
Dependencies: #32866, #27744 Stopgaps:

Status badges

Description (last modified by Sébastien Labbé)

(from https://trac.sagemath.org/ticket/30887#comment:28)

For some "safe" features such as imagemagick, rubiks, 4ti2 (#30887), pandoc, it really shouldn't require the use of external to check for these.

Likewise for the PythonModule features for Sage modules introduced in #32614. By delaying the test for these features, using the sage.doctest.external machinery, we fix the broken detection of some of these features. (This is why the ticket is marked "critical".)

This is a step toward #30746 (sage.doctest.control: Replace use of sage.misc.package.list_packages)

With this ticket, more doctests will be run by default. This may lead to new failures (discovered by patchbot for instance). But that does not mean it is introduced in this ticket, just that they were existing before this ticket, but simply not executed.

For example, let's compare the behavior of the following command:

sage -tp --show-skipped src/sage/tests/cmdline.py 

returns:

BEFORE (9.5.beta7):

Git branch: develop
Using --optional=4ti2,build,ccache,cryptominisat,debian,dochtml,dot2tex,e_antic,fricas,glucose,latte_int,lidia,normaliz,notedown,pandoc_attributes,pip,pycosat,pynormaliz,rst2ipynb,sage,sage.geometry.polyhedron,sage.rings.real_double,sage_numerical_backends_coin,sage_spkg
Doctesting 1 file using 8 threads.
sage -t --random-seed=265206128165572261397002909756599539048 src/sage/tests/cmdline.py
    3 gdb tests not run
    12 internet tests not run
    2 pandoc tests not run
    4 r tests not run
    0 tests not run because we ran out of time
    [235 tests, 30.65 s]
----------------------------------------------------------------------
All tests passed!
----------------------------------------------------------------------

AFTER (9.5.beta7 + #32174):

$ sage -tp --show-skipped src/sage/tests/cmdline.py 
Git branch: 32174
Using --optional=4ti2,build,ccache,cryptominisat,debian,dochtml,dot2tex,e_antic,fricas,glucose,latte_int,lidia,normaliz,notedown,pandoc_attributes,pip,pycosat,pynormaliz,rst2ipynb,sage,sage_numerical_backends_coin,sage_spkg
Features to be detected: 4ti2,benzene,bliss,buckygen,conway_polynomials,csdp,database_cremona_ellcurve,database_cremona_mini_ellcurve,database_jones_numfield,database_knotinfo,dvipng,ffmpeg,graphviz,imagemagick,jupymake,kenzo,latte_int,lrslib,mcqd,meataxe,pandoc,pdf2svg,plantri,pynormaliz,rubiks,sage.combinat,sage.geometry.polyhedron,sage.graphs,sage.plot,sage.rings.number_field,sage.rings.real_double,sage.symbolic,sage_numerical_backends_coin,tdlib
Doctesting 1 file using 8 threads.
sage -t --random-seed=100100306103974678574881156032164018710 src/sage/tests/cmdline.py
**********************************************************************
File "src/sage/tests/cmdline.py", line 732, in sage.tests.cmdline.test_executable
Failed example:
    print(open(output, 'r').read() == t)          # optional - pandoc
Expected:
    True
Got:
    False
**********************************************************************
1 item had failures:
   1 of 238 in sage.tests.cmdline.test_executable
    3 gdb tests not run
    12 internet tests not run
    4 r tests not run
    0 tests not run because we ran out of time
    [237 tests, 1 failure, 32.76 s]
----------------------------------------------------------------------
sage -t --random-seed=100100306103974678574881156032164018710 src/sage/tests/cmdline.py  # 1 doctest failed
----------------------------------------------------------------------
Features detected for doctesting: pandoc

We observe that the number of tests run went from 235 to 237, because the feature pandoc was detected. Note that the doctest failure is already tracked at #32697.

Change History (92)

comment:1 Changed 15 months ago by Matthias Köppe

Milestone: sage-9.4sage-9.5

comment:2 Changed 12 months ago by Matthias Köppe

Description: modified (diff)

comment:3 Changed 12 months ago by Matthias Köppe

Dependencies: #32649

comment:4 Changed 12 months ago by Matthias Köppe

Dependencies: #32649#32649, #32614

comment:5 Changed 12 months ago by Matthias Köppe

Priority: majorcritical

Let's use this ticket to address the problem discovered in https://trac.sagemath.org/ticket/32732#comment:10: Detection of Sage modules fails because the check runs before sage.all has been imported, and is therefore affected by import failures from cyclic imports

comment:6 Changed 12 months ago by Matthias Köppe

Dependencies: #32649, #32614#32732

comment:7 Changed 11 months ago by Matthias Köppe

Dependencies: #32732#32732, #32650

comment:8 Changed 11 months ago by Matthias Köppe

Branch: u/mkoeppe/doctests__detect__safe__external_features_even_if____optional_external__is_not_used

comment:9 Changed 11 months ago by Matthias Köppe

Commit: c8e6c0eb147a21974c9926fe5ad99b31a850c8a9

Here's an approach to do feature enumeration


Last 10 new commits:

5d9414d32650: .. note -> .. NOTE
345c76032650: using features in has_latex method of doctest/external.py
6c6b33232650: independent and improved method latex().is_functional()
63555d232650: adding spkg pdf2svg in build/pkgs
c8330fe32650: linking pdf2svg feature to spkg pdf2svg
2ea4d9e32650: fixing two doctests now that we latex().require() it when we use it
98b7db6Merge #32650
0968f95sage.features.sagemath.all_features: New
cdc0cb6sage.features.all: New
c8e6c0esage.features.bliss.all_features: New

comment:10 Changed 11 months ago by git

Commit: c8e6c0eb147a21974c9926fe5ad99b31a850c8a969d2cfbd7914f8e64c9648492f19847034ee5e60

Branch pushed to git repo; I updated commit sha1. New commits:

69d2cfbsrc/sage/features/kenzo.py: Move import from sage.libs.ecl into method

comment:11 Changed 11 months ago by Matthias Köppe

Authors: Matthias Koeppe, ...

comment:12 Changed 11 months ago by Samuel Lelièvre

Indent .. NOTE:: blocks 4 spaces, not 3 (can be a follow-up ticket).

comment:13 Changed 11 months ago by git

Commit: 69d2cfbd7914f8e64c9648492f19847034ee5e60893ec23c44ae4c85c4297f2b06ccb102673e8582

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

fa45c36sage.features.sagemath.all_features: New
17e30e2sage.features.all: New
8bfebc9sage.features.bliss.all_features: New
893ec23src/sage/features/kenzo.py: Move import from sage.libs.ecl into method

comment:14 Changed 11 months ago by Matthias Köppe

Dependencies: #32732, #32650#32866

Rebased on 9.5.beta6

comment:15 Changed 11 months ago by git

Commit: 893ec23c44ae4c85c4297f2b06ccb102673e8582fa25155f55cadf4424dd561586b111e4183e2d50

Branch pushed to git repo; I updated commit sha1. New commits:

eaec400src/sage/features/interfaces.py: New
827ca03src/sage/features/interfaces.py: Fix and doctest exception handling
52ac51esrc/sage/features/interfaces.py (all_features): New
7754faesrc/sage/features/interfaces.py: Fix and doctest exception handling (fixup)
8081f29src/sage/doctest/external.py: Use sage.features.interfaces
09c4238Merge #32866
c41808bsrc/sage/features/latex.py (all_features): New
44c19e3src/sage/features/mip_backends.py (all_features): New
fa25155src/sage/doctest/external.py (external_software): Go through external_features

comment:16 Changed 11 months ago by git

Commit: fa25155f55cadf4424dd561586b111e4183e2d507fa5b3bf93c320f0d0d388b7c7c240dfe51d8300

Branch pushed to git repo; I updated commit sha1. New commits:

945132bsrc/sage/features/interfaces.py: Fix up
f63acfdMerge #32866
7fa5b3bsrc/sage/doctest/external.py (external_features): Add CPLEX, Gurobi

comment:17 Changed 11 months ago by Matthias Köppe

The has_... functions are now no longer needed.

Deprecate them? Or just remove them?

comment:18 Changed 11 months ago by git

Commit: 7fa5b3bf93c320f0d0d388b7c7c240dfe51d8300132f00dfbe947bb3898debb5ccf659b728624fb9

Branch pushed to git repo; I updated commit sha1. New commits:

132f00dsage.doctest.{control,external}: Detect optional tags via AvailableSoftware

comment:19 Changed 11 months ago by Matthias Köppe

Here's a version that seems to work.

comment:20 Changed 11 months ago by git

Commit: 132f00dfbe947bb3898debb5ccf659b728624fb968b3d4186903d2d215b709bb17c55979ac4353b1

Branch pushed to git repo; I updated commit sha1. New commits:

68b3d41src/sage/doctest/external.py (external_features): Rewrite as generator, add doctest

comment:21 Changed 11 months ago by Matthias Köppe

Authors: Matthias Koeppe, ...Matthias Koeppe
Status: newneeds_review

comment:22 Changed 11 months ago by Antonio Rojas

Is the ticket description still valid? This doesn't do anything for me unless I explicitly pass --optional=external

comment:23 Changed 11 months ago by Matthias Köppe

At the end of the tests it should print a line "Features detected for doctesting"

comment:24 Changed 11 months ago by Antonio Rojas

Yes, but it doesn't detect anything if I don't use --optional=external:

> sage -t --optional=sage /usr/lib/python3.9/site-packages/sage/features/imagemagick.py
too many failed tests, not using stored timings
Running doctests with ID 2021-11-15-18-40-01-8b3be5fc.
Using --optional=sage
External software to be detected: 4ti2,cplex,dvipng,ffmpeg,graphviz,gurobi,imagemagick,internet,latex,lualatex,macaulay2,magma,maple,mathematica,matlab,octave,pandoc,pdf2svg,pdflatex,rubiks,scilab,xelatex
Doctesting 1 file.
sage -t --random-seed=283871835415461728632029979826455200075 /usr/lib/python3.9/site-packages/sage/features/imagemagick.py
    [3 tests, 0.00 s]
----------------------------------------------------------------------
All tests passed!
----------------------------------------------------------------------
Total time for all tests: 0.0 seconds
    cpu time: 0.0 seconds
    cumulative wall time: 0.0 seconds
Features detected for doctesting: 
Pytest is not installed, skip checking tests that rely on it.

doesn't detect imagemagick, but

> sage -t --optional=sage,external /usr/lib/python3.9/site-packages/sage/features/imagemagick.py
too many failed tests, not using stored timings
Running doctests with ID 2021-11-15-18-39-46-a52ab438.
Using --optional=external,sage
External software to be detected: 4ti2,cplex,dvipng,ffmpeg,graphviz,gurobi,imagemagick,internet,latex,lualatex,macaulay2,magma,maple,mathematica,matlab,octave,pandoc,pdf2svg,pdflatex,rubiks,scilab,xelatex
Doctesting 1 file.
sage -t --random-seed=59814167025539044529043021967633197695 /usr/lib/python3.9/site-packages/sage/features/imagemagick.py
    [4 tests, 0.00 s]
----------------------------------------------------------------------
All tests passed!
----------------------------------------------------------------------
Total time for all tests: 0.0 seconds
    cpu time: 0.0 seconds
    cumulative wall time: 0.0 seconds
Features detected for doctesting: imagemagick
Pytest is not installed, skip checking tests that rely on it.

does

comment:25 Changed 11 months ago by git

Commit: 68b3d4186903d2d215b709bb17c55979ac4353b16f2d22bebad1f9c043499bdc0a5fea6406ac6c7f

Branch pushed to git repo; I updated commit sha1. New commits:

6f2d22bsrc/sage/doctest/external.py: Declare pandoc, graphviz, ffmpeg, imagemagick, dvipng, pdf2svg, rubiks, 4ti2 feature tests safe (do not require 'external' to test them)

comment:26 Changed 11 months ago by Matthias Köppe

Thanks. Should work now

comment:27 Changed 11 months ago by git

Commit: 6f2d22bebad1f9c043499bdc0a5fea6406ac6c7f2f50385550e03e6f02d1432864be5dba559b081e

Branch pushed to git repo; I updated commit sha1. New commits:

2f50385src/sage/features/: Add more all_features functions

comment:28 Changed 11 months ago by git

Commit: 2f50385550e03e6f02d1432864be5dba559b081ee2cda415abc4c5af6fea8e4739016d877414091e

Branch pushed to git repo; I updated commit sha1. New commits:

e2cda41src/sage/features/: Add remaining missing all_features functions

comment:29 in reply to:  26 Changed 11 months ago by Antonio Rojas

Replying to mkoeppe:

Thanks. Should work now

Confirmed. But now, running, sage -t without --optional=external displays

External software to be detected: cplex,gurobi,internet,macaulay2,magma,maple,mathematica,matlab,octave,scilab

which is kind of misleading, as these are precisely the packages that are *not* autodetected in that case.

comment:30 Changed 11 months ago by Matthias Köppe

Thanks for testing. Good point, I'll make that clearer

comment:31 Changed 11 months ago by git

Commit: e2cda415abc4c5af6fea8e4739016d877414091ec4deceb2babdadafc3044bb5918c1f8a4467c82e

Branch pushed to git repo; I updated commit sha1. New commits:

c4decebsrc/sage/doctest/control.py: Replace use of 'external_software' by new method 'available_software.detectable()'

comment:32 Changed 11 months ago by Matthias Köppe

Dependencies: #32866#32866, #27744

comment:33 Changed 11 months ago by git

Commit: c4deceb2babdadafc3044bb5918c1f8a4467c82eb8f0a107bd1bc621ecf5d7cacddae0e2110b8427

Branch pushed to git repo; I updated commit sha1. New commits:

23f5009sage.features.normaliz: New
0b65b79src/sage/features/normaliz.py: Fix up
00cb9c7src/sage/features/normaliz.py: Rename class to PyNormaliz, fix uses
7632e53src/sage/geometry/polyhedron/base.py: Remove unused import
24aaf73Merge #27744
b8f0a10src/sage/features/normaliz.py: Add all_features

comment:34 Changed 11 months ago by git

Commit: b8f0a107bd1bc621ecf5d7cacddae0e2110b842791f0bcc173d40c15abfba67d7c01a453726a1a02

Branch pushed to git repo; I updated commit sha1. New commits:

944bb74src/sage/features/interfaces.py: Add doctests
2463e1eMerge #32866
91f0bccsrc/sage/doctest: Update doctest outputs

comment:35 Changed 11 months ago by git

Commit: 91f0bcc173d40c15abfba67d7c01a453726a1a02c9312dbe74009795f2ea1a20cb5f4c2b087415c7

Branch pushed to git repo; I updated commit sha1. New commits:

12f7c98src/sage/features/polymake.py: Add all_features
c9312dbsrc/sage/features: Add more all_features functions

comment:36 Changed 11 months ago by Antonio Rojas

This unveils a test failure coming from #32732 (wasn't detected there because the test was skipped)

**********************************************************************
File "/usr/lib/python3.9/site-packages/sage/geometry/hyperbolic_space/hyperbolic_geodesic.py", line 2038, in sage.geometry.hyperbolic_space.hyperbolic_geodesic.HyperbolicGeodesicPD.plot
Failed example:
    H = h.plot(thickness=6, color="orange"); H           # optional - sage.plot
Expected:
    Graphics object consisting of 2 graphics primitives        # optional - sage.plot
Got:
    Graphics object consisting of 2 graphics primitives
**********************************************************************

comment:37 Changed 11 months ago by git

Commit: c9312dbe74009795f2ea1a20cb5f4c2b087415c7230d135a72f002fcf16980b34825e20e41f776f8

Branch pushed to git repo; I updated commit sha1. New commits:

230d135src/sage/geometry/hyperbolic_space/hyperbolic_geodesic.py: Fix doctest markup

comment:38 Changed 11 months ago by Matthias Köppe

Description: modified (diff)

comment:39 Changed 11 months ago by git

Commit: 230d135a72f002fcf16980b34825e20e41f776f87a8f48c64947e41300407bdd7092a1b019d74d60

Branch pushed to git repo; I updated commit sha1. New commits:

7a8f48csrc/sage/features/sagemath.py (sage_features): Unused now, removed

comment:40 Changed 11 months ago by Antonio Rojas

I'm getting a bliss related failure:

File "/usr/lib/python3.9/site-packages/sage/features/bliss.py", line 33, in sage.features.bliss.BlissLibrary
Failed example:
    BlissLibrary().require()  # optional: bliss
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python3.9/site-packages/sage/doctest/forker.py", line 694, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/usr/lib/python3.9/site-packages/sage/doctest/forker.py", line 1088, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.features.bliss.BlissLibrary[1]>", line 1, in <module>
        BlissLibrary().require()  # optional: bliss
      File "/usr/lib/python3.9/site-packages/sage/features/__init__.py", line 205, in require
        raise FeatureNotPresentError(self, presence.reason, presence.resolution)
    sage.features.FeatureNotPresentError: Bliss is not available.
    Failed to run test code.
    No equivalent system packages for pip are known to Sage.
    Further installation instructions might be available at http://www.tcs.hut.fi/Software/bliss/.

This is happening because Sage is compiled with bliss, but the bliss library is not present at runtime (it doesn't need to, since it's statically linked).

So apparently there is a mismatch between whatever is tested to decide whether to enable the optional: bliss tests (which seems to be just the presence of the python module) and what the tests themselves require (not just the module, but also the library itself)

comment:41 Changed 11 months ago by Sébastien Labbé

Also, pyflakes patchbot says:

src/sage/doctest/forker.py:218:9 'readline' imported but unused
src/sage/doctest/forker.py:224:9 'sympy' imported but unused
src/sage/geometry/polyhedron/base.py:2701:17 'sage.graphs.graph' imported but unused
src/sage/geometry/polyhedron/base.py:5852:17 'sage.graphs.graph' imported but unused
src/sage/geometry/polyhedron/base.py:6438:17 'sage.graphs.graph' imported but unused
src/sage/geometry/polyhedron/base.py:8913:13 'sage.graphs.graph' imported but unused

comment:42 Changed 11 months ago by Sébastien Labbé

Also another plugin patchbot warning says:

wrong syntax for blocks (INPUT, OUTPUT, EXAMPLES, NOTE, etc) inserted on 9 non-empty lines

possibly in

inside file:  b/src/sage/features/interfaces.py
inside file:  b/src/sage/features/normaliz.py

comment:43 in reply to:  41 Changed 11 months ago by Matthias Köppe

Replying to slabbe:

Also, pyflakes patchbot says:

src/sage/doctest/forker.py:218:9 'readline' imported but unused
src/sage/doctest/forker.py:224:9 'sympy' imported but unused
src/sage/geometry/polyhedron/base.py:2701:17 'sage.graphs.graph' imported but unused
src/sage/geometry/polyhedron/base.py:5852:17 'sage.graphs.graph' imported but unused
src/sage/geometry/polyhedron/base.py:6438:17 'sage.graphs.graph' imported but unused
src/sage/geometry/polyhedron/base.py:8913:13 'sage.graphs.graph' imported but unused

Not from this ticket, and all of these imports are done for their side effect, not the binding

comment:44 Changed 11 months ago by git

Commit: 7a8f48c64947e41300407bdd7092a1b019d74d6012a25079415abfa9d23c73668e294b2f1ad1d0e9

Branch pushed to git repo; I updated commit sha1. New commits:

e7f538dsage.features.bliss: Change name of BlissLibrary feature to libbliss, remove it from all_features
12a2507src/sage/features/interfaces.py: Fix indentation in docstring

comment:45 Changed 11 months ago by Sébastien Labbé

For reviewing, this ticket, I did:

$ sage -t -p --all --long --logfile=logs/32174-second.log

which returned

Git branch: 32174
Using --optional=4ti2,build,ccache,cryptominisat,debian,dochtml,dot2tex,e_antic,fricas,glucose,latte_int,lidia,normaliz,notedown,pandoc_attributes,pip,pycosat,pynormaliz,rst2ipynb,sage,sage_numerical_backends_coin,sage_spkg
Features to be detected: 4ti2,benzene,bliss,buckygen,conway_polynomials,csdp,database_cremona_ellcurve,database_cremona_mini_ellcurve,database_jones_numfield,database_knotinfo,dvipng,ffmpeg,graphviz,imagemagick,jupymake,kenzo,latex,latte_int,lrslib,lualatex,mcqd,meataxe,pandoc,pdf2svg,pdflatex,plantri,pynormaliz,rubiks,sage.combinat,sage.geometry.polyhedron,sage.graphs,sage.plot,sage.rings.number_field,sage.rings.real_double,sage.symbolic,sage_numerical_backends_coin,tdlib,xelatex
Doctesting entire Sage library.
Sorting sources by runtime so that slower doctests are run first....
Doctesting 4397 files using 8 threads.
...
----------------------------------------------------------------------
sage -t --long --random-seed=129857008849586417489695899017012168188 src/sage/tests/cmdline.py  # 1 doctest failed
sage -t --long --random-seed=129857008849586417489695899017012168188 src/sage/graphs/generic_graph.py  # 2 doctests failed
sage -t --long --random-seed=129857008849586417489695899017012168188 src/sage/interfaces/fricas.py  # 1 doctest failed
sage -t --long --random-seed=129857008849586417489695899017012168188 src/sage/graphs/graph.py  # 2 doctests failed
sage -t --long --random-seed=129857008849586417489695899017012168188 src/sage/schemes/toric/sheaf/klyachko.py  # 1 doctest failed
sage -t --long --random-seed=129857008849586417489695899017012168188 src/sage/sat/solvers/dimacs.py  # 2 doctests failed
sage -t --long --random-seed=129857008849586417489695899017012168188 src/sage/combinat/designs/incidence_structures.py  # 1 doctest failed
----------------------------------------------------------------------
Features detected for doctesting: dvipng,ffmpeg,graphviz,imagemagick,latex,lualatex,pandoc,pdf2svg,pdflatex,sage.combinat,sage.geometry.polyhedron,sage.graphs,sage.plot,sage.rings.number_field,sage.rings.real_double,sage.symbolic,xelatex

The issue with src/sage/schemes/toric/sheaf/klyachko.py does not reproduce:

sage -t --long --random-seed=129857008849586417489695899017012168188 src/sage/schemes/toric/sheaf/klyachko.py
**********************************************************************
File "src/sage/schemes/toric/sheaf/klyachko.py", line 950, in sage.schemes.toric.sheaf.klyachko.KlyachkoBundle_clas
s.random_deformation
Failed example:
    Vtilde.cohomology(dim=True, weight=(0,))
Expected:
    (1, 0)
Got:
    (0, 0)
**********************************************************************
1 item had failures:
   1 of   7 in sage.schemes.toric.sheaf.klyachko.KlyachkoBundle_class.random_deformation
    [151 tests, 1 failure, 16.00 s]

The other failures are known.

Then I did:

sage -t -p --all --long --optional=sage,optional,external,build --show-skipped --logfile=logs/32174.log

which returned:

Git branch: 32174
Using --optional=4ti2,build,ccache,cryptominisat,debian,dot2tex,e_antic,external,fricas,glucose,latte_int,lidia,normaliz,notedown,pandoc_attributes,pip,pycosat,pynormaliz,rst2ipynb,sage,sage_numerical_backends_coin,sage_spkg
Features to be detected: 4ti2,benzene,bliss,buckygen,conway_polynomials,cplex,csdp,database_cremona_ellcurve,database_cremona_mini_ellcurve,database_jones_numfield,database_knotinfo,dvipng,ffmpeg,graphviz,gurobi,imagemagick,internet,jupymake,kenzo,latex,latte_int,lrslib,lualatex,macaulay2,magma,maple,mathematica,matlab,mcqd,meataxe,octave,pandoc,pdf2svg,pdflatex,plantri,pynormaliz,rubiks,sage.combinat,sage.geometry.polyhedron,sage.graphs,sage.plot,sage.rings.number_field,sage.rings.real_double,sage.symbolic,sage_numerical_backends_coin,scilab,tdlib,xelatex
Doctesting entire Sage library.
Sorting sources by runtime so that slower doctests are run first....
Doctesting 4397 files using 8 threads.
...
----------------------------------------------------------------------
sage -t --long --random-seed=199830843512308713498063069261640048262 src/sage/graphs/generic_graph.py  # 2 doctests failed
sage -t --long --random-seed=199830843512308713498063069261640048262 src/sage/databases/findstat.py  # 9 doctests failed
sage -t --long --random-seed=199830843512308713498063069261640048262 src/sage/tests/cmdline.py  # 10 doctests failed
sage -t --long --random-seed=199830843512308713498063069261640048262 src/sage/graphs/graph.py  # 3 doctests failed
sage -t --long --random-seed=199830843512308713498063069261640048262 src/sage/interfaces/fricas.py  # 1 doctest failed
sage -t --long --random-seed=199830843512308713498063069261640048262 src/sage/sat/solvers/dimacs.py  # 2 doctests failed
sage -t --long --random-seed=199830843512308713498063069261640048262 src/sage/combinat/designs/incidence_structures.py  # 1 doctest failed
sage -t --long --random-seed=199830843512308713498063069261640048262 src/sage/finance/stock.py  # 1 doctest failed
----------------------------------------------------------------------
Features detected for doctesting: dvipng,ffmpeg,graphviz,imagemagick,internet,latex,lualatex,octave,pandoc,pdf2svg,pdflatex,sage.combinat,sage.geometry.polyhedron,sage.graphs,sage.plot,sage.rings.number_field,sage.rings.real_double,sage.symbolic,xelatex

Therefore, there are no new failing test compared to what is currently the case with respect to known external failing doctests, see #25536. The difference is that now there is a list of features to be detected (pandoc, pdf2svg, etc.) which are now considered as optional instead of external which is a good thing.

I confirm that the new list of external packages is shorter and made only of the following:

>>> s = "4ti2,benzene,bliss,buckygen,conway_polynomials,csdp,database_cremona_ellcurve,database_cremona_mini_ellcurve,database_jones_numfield,database_knotinfo,dvipng,ffmpeg,graphviz,imagemagick,jupymake,kenzo,latex,latte_int,lrslib,lualatex,mcqd,meataxe,pandoc,pdf2svg,pdflatex,plantri,pynormaliz,rubiks,sage.combinat,sage.geometry.polyhedron,sage.graphs,sage.plot,sage.rings.number_field,sage.rings.real_double,sage.symbolic,sage_numerical_backends_coin,tdlib,xelatex"
>>> t = "4ti2,benzene,bliss,buckygen,conway_polynomials,cplex,csdp,database_cremona_ellcurve,database_cremona_mini_ellcurve,database_jones_numfield,database_knotinfo,dvipng,ffmpeg,graphviz,gurobi,imagemagick,internet,jupymake,kenzo,latex,latte_int,lrslib,lualatex,macaulay2,magma,maple,mathematica,matlab,mcqd,meataxe,octave,pandoc,pdf2svg,pdflatex,plantri,pynormaliz,rubiks,sage.combinat,sage.geometry.polyhedron,sage.graphs,sage.plot,sage.rings.number_field,sage.rings.real_double,sage.symbolic,sage_numerical_backends_coin,scilab,tdlib,xelatex"
>>> set(t.split(',')) - set(s.split(','))
set(['macaulay2', 'mathematica', 'cplex', 'magma', 'gurobi', 'matlab', 'octave', 'internet', 'scilab', 'maple'])

comment:46 Changed 11 months ago by Sébastien Labbé

Reviewers: Sébastien Labbé
Status: needs_reviewpositive_review

Objectives of the ticket are achieved.

comment:47 Changed 11 months ago by Matthias Köppe

Thank you for reviewing!

comment:48 Changed 10 months ago by Volker Braun

Status: positive_reviewneeds_work
sage -t --long --warn-long 45.7 --random-seed=86523171498431921424879269621082549712 src/sage/misc/latex.py
**********************************************************************
File "src/sage/misc/latex.py", line 1549, in sage.misc.latex.Latex.add_package_to_preamble_if_available
Failed example:
    latex.extra_preamble()       # optional - latex
Expected:
    '\\usepackage{xypic}\n'
Got:
    ''
**********************************************************************
File "src/sage/misc/latex.py", line 1859, in sage.misc.latex.?
Failed example:
    _run_latex_(file, engine="pdflatex") # optional - latex
Expected:
    'pdf'
Got:
    An error occurred.
    This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=pdflatex 2020.11.22)  24 NOV 2021 00:24
    entering extended mode
     restricted \write18 enabled.
     %&-line parsing enabled.
    **\nonstopmode \input{temp.tex}
    (./temp.tex (/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
    Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
    (/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo
    File: size10.clo 2019/12/20 v1.4l Standard LaTeX file (size option)
    )
    \c@part=\count167
    \c@section=\count168
    \c@subsection=\count169
    \c@subsubsection=\count170
    \c@paragraph=\count171
    \c@subparagraph=\count172
    \c@figure=\count173
    \c@table=\count174
    \abovecaptionskip=\skip47
    \belowcaptionskip=\skip48
    \bibindent=\dimen134
    )
    (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty
    Package: amsmath 2020/01/20 v2.17e AMS math features
    \@mathmargin=\skip49
    <BLANKLINE>
    For additional information on amsmath, use the `?' option.
    (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty
    Package: amstext 2000/06/29 v2.01 AMS text
    <BLANKLINE>
    (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty
    File: amsgen.sty 1999/11/30 v2.0 generic functions
    \@emptytoks=\toks15
    \ex@=\dimen135
    ))
    (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty
    Package: amsbsy 1999/11/29 v1.2d Bold Symbols
    \pmbraise@=\dimen136
    )
    (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty
    Package: amsopn 2016/03/08 v2.02 operator names
    )
    \inf@bad=\count175
    LaTeX Info: Redefining \frac on input line 227.
    \uproot@=\count176
    \leftroot@=\count177
    LaTeX Info: Redefining \overline on input line 389.
    \classnum@=\count178
    \DOTSCASE@=\count179
    LaTeX Info: Redefining \ldots on input line 486.
    LaTeX Info: Redefining \dots on input line 489.
    LaTeX Info: Redefining \cdots on input line 610.
    \Mathstrutbox@=\box45
    \strutbox@=\box46
    \big@size=\dimen137
    LaTeX Font Info:    Redeclaring font encoding OML on input line 733.
    LaTeX Font Info:    Redeclaring font encoding OMS on input line 734.
    \macc@depth=\count180
    \c@MaxMatrixCols=\count181
    \dotsspace@=\muskip16
    \c@parentequation=\count182
    \dspbrk@lvl=\count183
    \tag@help=\toks16
    \row@=\count184
    \column@=\count185
    \maxfields@=\count186
    \andhelp@=\toks17
    \eqnshift@=\dimen138
    \alignsep@=\dimen139
    \tagshift@=\dimen140
    \tagwidth@=\dimen141
    \totwidth@=\dimen142
    \lineht@=\dimen143
    \@envbody=\toks18
    \multlinegap=\skip50
    \multlinetaggap=\skip51
    \mathdisplay@stack=\toks19
    LaTeX Info: Redefining \[ on input line 2859.
    LaTeX Info: Redefining \] on input line 2860.
    )
    (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amssymb.sty
    Package: amssymb 2013/01/14 v3.01 AMS font symbols
    <BLANKLINE>
    (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amsfonts.sty
    Package: amsfonts 2013/01/14 v3.01 Basic AMSFonts support
    \symAMSa=\mathgroup4
    \symAMSb=\mathgroup5
    LaTeX Font Info:    Redeclaring math symbol \hbar on input line 98.
    LaTeX Font Info:    Overwriting math alphabet `\mathfrak' in version `bold'
    (Font)                  U/euf/m/n --> U/euf/b/n on input line 106.
    ))
    (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
    Package: graphicx 2019/11/30 v1.2a Enhanced LaTeX Graphics (DPC,SPQR)
    <BLANKLINE>
    (/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty
    Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
    \KV@toks@=\toks20
    )
    (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty
    Package: graphics 2019/11/30 v1.4a Standard LaTeX Graphics (DPC,SPQR)
    <BLANKLINE>
    (/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty
    Package: trig 2016/01/03 v1.10 sin cos tan (DPC)
    )
    (/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg
    File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration
    )
    Package graphics Info: Driver file: pdftex.def on input line 105.
    <BLANKLINE>
    (/usr/share/texlive/texmf-dist/tex/latex/graphics-def/pdftex.def
    File: pdftex.def 2018/01/08 v1.0l Graphics/color driver for pdftex
    ))
    \Gin@req@height=\dimen144
    \Gin@req@width=\dimen145
    )
    (/usr/share/texlive/texmf-dist/tex/latex/jknapltx/mathrsfs.sty
    Package: mathrsfs 1996/01/01 Math RSFS package v1.0 (jk)
    \symrsfs=\mathgroup6
    )
    (/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty
    Package: inputenc 2018/08/11 v1.3c Input encoding file
    \inpenc@prehook=\toks21
    \inpenc@posthook=\toks22
    )
    (/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty
    Package: fontenc 2020/02/11 v2.0o Standard LaTeX package
    )
    <BLANKLINE>
    ! LaTeX Error: File `tkz-graph.sty' not found.
    <BLANKLINE>
    Type X to quit or <RETURN> to proceed,
    or enter new name. (Default extension: sty)
    <BLANKLINE>
    Enter file name: 
    ! Emergency stop.
    <read *> 
    <BLANKLINE>
    l.19 \newcommand
                    {\ZZ}{\Bold{Z}}^^M
    *** (cannot \read from terminal in nonstop modes)
    <BLANKLINE>
    <BLANKLINE>
    Here is how much of TeX's memory you used:
     1949 strings out of 482029
     21727 string characters out of 5943690
     251133 words of memory out of 5000000
     17640 multiletter control sequences out of 15000+600000
     533101 words of font info for 25 fonts, out of 8000000 for 9000
     430 hyphenation exceptions out of 8191
     32i,0n,33p,241b,38s stack positions out of 5000i,500n,10000p,200000b,80000s
    !  ==> Fatal error occurred, no output PDF file produced!
    <BLANKLINE>
    'Error latexing slide.'
**********************************************************************
2 items had failures:
   1 of  19 in sage.misc.latex.?
   1 of   5 in sage.misc.latex.Latex.add_package_to_preamble_if_available
    [258 tests, 2 failures, 0.85 s]
----------------------------------------------------------------------
sage -t --long --warn-long 45.7 --random-seed=86523171498431921424879269621082549712 src/sage/misc/latex.py  # 2 doctests failed
----------------------------------------------------------------------
Total time for all tests: 1.0 seconds
    cpu time: 0.2 seconds
    cumulative wall time: 0.9 seconds
Features detected for doctesting: imagemagick,latex

comment:49 Changed 10 months ago by git

Commit: 12a25079415abfa9d23c73668e294b2f1ad1d0e907b2512e77df2923d85bda52d42537392ca6b338

Branch pushed to git repo; I updated commit sha1. New commits:

0dd76b6Merge tag '9.5.beta7' into t/32174/doctests__detect__safe__external_features_even_if____optional_external__is_not_used
07b2512src/sage/misc/latex.py: Conditionalize some doctests on latex_package_tkz_graph

comment:50 Changed 10 months ago by Matthias Köppe

Here's a quick fix by marking some doctests # optional - latex_package_tkz_graph. For now, this annotation just disables that line. This feature is introduced in #32926.

comment:51 Changed 10 months ago by Matthias Köppe

Status: needs_workneeds_review

comment:52 Changed 10 months ago by Sébastien Labbé

I do not have access to a computer with no installation of latex. But, I confirm that this

sage -tp --optional=sage,optional,external src/sage/misc/latex.py

works on my machine:

Git branch: 32174
Using --optional=4ti2,ccache,cryptominisat,debian,dot2tex,e_antic,external,fricas,glucose,latte_int,lidia,normaliz,notedown,pandoc_attributes,pip,pycosat,pynormaliz,rst2ipynb,sage,sage_numerical_backends_coin,sage_spkg
Features to be detected: 4ti2,benzene,bliss,buckygen,conway_polynomials,cplex,csdp,database_cremona_ellcurve,database_cremona_mini_ellcurve,database_jones_numfield,database_knotinfo,dvipng,ffmpeg,graphviz,gurobi,imagemagick,internet,jupymake,kenzo,latex,latte_int,lrslib,lualatex,macaulay2,magma,maple,mathematica,matlab,mcqd,meataxe,octave,pandoc,pdf2svg,pdflatex,plantri,pynormaliz,rubiks,sage.combinat,sage.geometry.polyhedron,sage.graphs,sage.plot,sage.rings.number_field,sage.rings.real_double,sage.symbolic,sage_numerical_backends_coin,scilab,tdlib,xelatex
Doctesting 1 file using 8 threads.
sage -t --random-seed=278462588081941083872300580472279407754 src/sage/misc/latex.py
    [255 tests, 1.15 s]
----------------------------------------------------------------------
All tests passed!
----------------------------------------------------------------------
Features detected for doctesting: imagemagick,latex

comment:53 Changed 10 months ago by Sébastien Labbé

All tests are passing on the patchbots. For me it is a positive review.

Can someone having a machine similar to the one used by Volker confirm it is okay?

Volker, are you okay to test it again on your machine?

comment:54 Changed 10 months ago by Matthias Köppe

Status: needs_reviewpositive_review

Let's just put it back in the queue

comment:55 Changed 10 months ago by Sébastien Labbé

Status: positive_reviewneeds_info

The 89 + 63 doctest failures (seen on patchbot labri-vindelecroix-1) that are discussed in #32926 are also seen here on the same patchbot testing this ticket #32174. Moreover those numerous failures are not seen by the same patchbot while testing #32866 on which #32174 is based on. So I switch the status of the current ticket to needs info.

Last edited 10 months ago by Sébastien Labbé (previous) (diff)

comment:56 Changed 10 months ago by Sébastien Labbé

(I copy paste here a comment originally written at https://trac.sagemath.org/ticket/32926#comment:20)

All of the 89 + 63 errors are the same. It is always a warning which is printed (the output is always ok) saying ! LaTeX Error: File `type1ec.sty' not found.

Also the machine on which the failures is happening has the following detected features:

Features detected for doctesting: 4ti2,dvipng,ffmpeg,graphviz,latex,latex_package_tkz_graph,lrslib,lualatex,pdflatex,
sage.combinat,sage.geometry.polyhedron,sage.graphs,sage.plot,sage.rings.number_field,
sage.rings.real_double,sage.symbolic,xelatex

Here is one of the failure:

**********************************************************************
File "src/sage/plot/plot.py", line 1919, in sage.plot.plot.plot
Failed example:
    parametric_plot((sqrt(x^2-1),sqrt(x^2-1/2)), (x,0,5), exclude=[1,2,3])
Expected:
    Graphics object consisting of 3 graphics primitives
Got:
    doctest:warning
      File "/home/debian/sage/src/bin/sage-runtests", line 155, in <module>
        err = DC.run()
      File "/home/debian/sage/local/lib/python3.9/site-packages/sage/doctest/control.py", line 1253, in run
        self.run_doctests()
      File "/home/debian/sage/local/lib/python3.9/site-packages/sage/doctest/control.py", line 954, in run_doctests
        self.dispatcher.dispatch()
      File "/home/debian/sage/local/lib/python3.9/site-packages/sage/doctest/forker.py", line 1996, in dispatch
        self.parallel_dispatch()
      File "/home/debian/sage/local/lib/python3.9/site-packages/sage/doctest/forker.py", line 1891, in parallel_dispatch
        w.start()  # This might take some time
      File "/home/debian/sage/local/lib/python3.9/site-packages/sage/doctest/forker.py", line 2165, in start
        super(DocTestWorker, self).start()
      File "/usr/lib/python3.9/multiprocessing/process.py", line 121, in start
        self._popen = self._Popen(self)
      File "/usr/lib/python3.9/multiprocessing/context.py", line 224, in _Popen
        return _default_context.get_context().Process._Popen(process_obj)
      File "/usr/lib/python3.9/multiprocessing/context.py", line 277, in _Popen
        return Popen(process_obj)
      File "/usr/lib/python3.9/multiprocessing/popen_fork.py", line 19, in __init__
        self._launch(process_obj)
      File "/usr/lib/python3.9/multiprocessing/popen_fork.py", line 71, in _launch
        code = process_obj._bootstrap(parent_sentinel=child_r)
      File "/usr/lib/python3.9/multiprocessing/process.py", line 315, in _bootstrap
        self.run()
      File "/home/debian/sage/local/lib/python3.9/site-packages/sage/doctest/forker.py", line 2137, in run
        task(self.options, self.outtmpfile, msgpipe, self.result_queue)
      File "/home/debian/sage/local/lib/python3.9/site-packages/sage/doctest/forker.py", line 2467, in __call__
        doctests, extras = self._run(runner, options, results)
      File "/home/debian/sage/local/lib/python3.9/site-packages/sage/doctest/forker.py", line 2519, in _run
        result = runner.run(test)
      File "/home/debian/sage/local/lib/python3.9/site-packages/sage/doctest/forker.py", line 861, in run
        return self._run(test, compileflags, out)
      File "/home/debian/sage/local/lib/python3.9/site-packages/sage/doctest/forker.py", line 694, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/home/debian/sage/local/lib/python3.9/site-packages/sage/doctest/forker.py", line 1088, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.plot.plot.plot[144]>", line 1, in <module>
        parametric_plot((sqrt(x**Integer(2)-Integer(1)),sqrt(x**Integer(2)-Integer(1)/Integer(2))), (x,Integer(0),Integer(5)), exclude=[Integer(1),Integer(2),Integer(3)])
      File "/home/debian/sage/local/lib/python3.9/site-packages/sage/repl/rich_output/display_manager.py", line 825, in displayhook
        plain_text, rich_output = self._rich_output_formatter(obj, dict())
      File "/home/debian/sage/local/lib/python3.9/site-packages/sage/repl/rich_output/display_manager.py", line 643, in _rich_output_formatter
        rich_output = self._call_rich_repr(obj, rich_repr_kwds)
      File "/home/debian/sage/local/lib/python3.9/site-packages/sage/repl/rich_output/display_manager.py", line 608, in _call_rich_repr
        warnings.warn(
      File "/usr/lib/python3.9/warnings.py", line 109, in _showwarnmsg
        sw(msg.message, msg.category, msg.filename, msg.lineno,
    :
    sage.repl.rich_output.display_manager.RichReprWarning: Exception in _rich_repr_ while displaying object: latex was not able to process the following string:
    b'lp'
    <BLANKLINE>
    Here is the full report generated by latex:
    This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020/Debian) (preloaded format=latex)
     restricted \write18 enabled.
    entering extended mode
    <BLANKLINE>
    (/home/debian/.sage/matplotlib-1.5.1/tex.cache/1acea6f6c115d0ec7a634ed0529287b9
    .tex
    LaTeX2e <2020-10-01> patch level 4
    L3 programming layer <2021-01-09> xparse <2020-03-03>
    (/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
    Document Class: article 2020/04/10 v1.4m Standard LaTeX document class
    (/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
    (/usr/share/texlive/texmf-dist/tex/latex/type1cm/type1cm.sty)
    <BLANKLINE>
    ! LaTeX Error: File `type1ec.sty' not found.
    <BLANKLINE>
    Type X to quit or <RETURN> to proceed,
    or enter new name. (Default extension: sty)
    <BLANKLINE>
    Enter file name: 
    ! Emergency stop.
    <read *> 
    <BLANKLINE>
    l.6 \usepackage
                   {type1ec}^^M
    No pages of output.
    Transcript written on 1acea6f6c115d0ec7a634ed0529287b9.log.
    <BLANKLINE>
    <BLANKLINE>
    <BLANKLINE>
    Graphics object consisting of 3 graphics primitives

I am not able to reproduce these failures on my machine. I will try to see if these failures appear with the same machine running doctest on different tickets or on no ticket at all (if I remember well, there is a way to check this no?)

comment:57 Changed 10 months ago by Samuel Lelièvre

See similar discussion in a matplotlib issue:

The fix suggested there is:

$ apt install cm-super

comment:58 Changed 10 months ago by Sébastien Labbé

Description: modified (diff)

I updated the description of the ticket to mention that more doctests will be run by default after #32174 which may lead to "new" bugs that were there before. That being said, I still don't know if the 89 + 63 fall in this category, because only 2 + 1 doctests are marked as optional - latex in those two files.

Also, it made me realize that there is a bug with --show-skipped which does not work correctly: The fact that 2 latex tests not run, 1 latex test not run still appear is a bug, since those tests are run.

Last edited 10 months ago by Sébastien Labbé (previous) (diff)

comment:59 Changed 10 months ago by Sébastien Labbé

Description: modified (diff)

comment:60 Changed 10 months ago by Sébastien Labbé

Cc: Vincent Delecroix added

The 89 + 63 failures seems to be created by the current branch when looking at the patchbot report made by vindelecroix-labri1 machine. But, when looking at the code of this ticket, I can't see anything which can explain those failures to appear. I am adding machine's owner in cc in case Vincent has an idea.

Most of the machines are fine, so I am fine with putting the status back to positive review.

Or do we want to mark those doctests as dependent on the external latex feature cm-super? That would rather be done in #32926.

comment:61 in reply to:  58 Changed 10 months ago by Sébastien Labbé

Branch: u/mkoeppe/doctests__detect__safe__external_features_even_if____optional_external__is_not_usedpublic/32174
Commit: 07b2512e77df2923d85bda52d42537392ca6b338cb13437b602e3217c3df2290ad40a9f89741b783

Replying to slabbe:

Also, it made me realize that there is a bug with --show-skipped which does not work correctly: The fact that 2 latex tests not run, 1 latex test not run still appear is a bug, since those tests are run.

I am adding a commit to fix the issue with the --show-skipped report.


New commits:

cb1343732174: fix the --show-skipped doctest report

comment:62 Changed 10 months ago by Sébastien Labbé

Description: modified (diff)

comment:63 Changed 10 months ago by git

Commit: cb13437b602e3217c3df2290ad40a9f89741b783391dca19bf3cd61c148f99027fb7983bbdaef3bd

Branch pushed to git repo; I updated commit sha1. New commits:

391dca1sage.misc.latex.png: Mark doctest # optional - imagemagick

comment:64 Changed 10 months ago by Matthias Köppe

Cherry-picked from #32926.

comment:65 Changed 10 months ago by git

Commit: 391dca19bf3cd61c148f99027fb7983bbdaef3bd6f311b311e44def63f21ed4524d5e76f753f3be7

Branch pushed to git repo; I updated commit sha1. New commits:

6f311b3src/sage/doctest/external.py: Revert latex features to 'external'

comment:66 Changed 10 months ago by Matthias Köppe

Status: needs_infoneeds_review

In order to get this ticket in, I have now reduced the scope, keeping the latex features as external. In a follow-up ticket, we can work on improving the # optional tags.

comment:67 Changed 10 months ago by Sébastien Labbé

Description: modified (diff)

updated the example in the description of the ticket to be based on pandoc instead of latex

comment:68 in reply to:  66 Changed 10 months ago by Matthias Köppe

Replying to mkoeppe:

In a follow-up ticket, we can work on improving the # optional tags.

This is now #32955.

comment:69 Changed 10 months ago by git

Commit: 6f311b311e44def63f21ed4524d5e76f753f3be73bfe1a14fbce31550866a1d4b393ec076e344592

Branch pushed to git repo; I updated commit sha1. New commits:

3bfe1a132174: adapting the doctest listing external softwares

comment:70 Changed 10 months ago by Matthias Köppe

Authors: Matthias KoeppeMatthias Koeppe, Sébastien Labbé

comment:71 Changed 10 months ago by Sébastien Labbé

I started a re-run of all tests on my machine. Will report later.

@Matthias: Sorry for having re-open this ticket earlier today. It was having a positive review for 7 days. I should have open another ticket instead I think. I hope it will not delay the entry of this ticket into sage since many other tickets depend on it. I will stay close to it to not add anymore delay.

comment:72 Changed 10 months ago by Matthias Köppe

No worries, and thanks for all your work!

comment:73 in reply to:  71 Changed 10 months ago by Sébastien Labbé

Replying to slabbe:

I started a re-run of all tests on my machine. Will report later.

On my machine running optional and external doctests on top of 9.5.beta7 returns:

----------------------------------------------------------------------
sage -t --long --random-seed=199830843512308713498063069261640048262 src/sage/graphs/generic_graph.py  # 2 doctests failed
sage -t --long --random-seed=199830843512308713498063069261640048262 src/sage/databases/findstat.py  # 9 doctests failed
sage -t --long --random-seed=199830843512308713498063069261640048262 src/sage/tests/cmdline.py  # 10 doctests failed
sage -t --long --random-seed=199830843512308713498063069261640048262 src/sage/graphs/graph.py  # 3 doctests failed
sage -t --long --random-seed=199830843512308713498063069261640048262 src/sage/interfaces/fricas.py  # 1 doctest failed
sage -t --long --random-seed=199830843512308713498063069261640048262 src/sage/sat/solvers/dimacs.py  # 2 doctests failed
sage -t --long --random-seed=199830843512308713498063069261640048262 src/sage/combinat/designs/incidence_structures.py  # 1 doctest failed
sage -t --long --random-seed=199830843512308713498063069261640048262 src/sage/finance/stock.py  # 1 doctest failed
----------------------------------------------------------------------
Total time for all tests: 2664.6 seconds
    cpu time: 16553.0 seconds
    cumulative wall time: 20701.4 seconds
Features detected for doctesting: dvipng,ffmpeg,graphviz,imagemagick,internet,latex,lualatex,octave,pandoc,pdf2svg,pdflatex,sage.combinat,sage.geometry.polyhedron,sage.graphs,sage.plot,sage.rings.number_field,sage.rings.real_double,sage.symbolic,xelatex

which has no more failures than what I reported for 9.5.beta7 on sage-release.

I am waiting for the patchbot to finish.

Last edited 10 months ago by Sébastien Labbé (previous) (diff)

comment:74 Changed 10 months ago by Sébastien Labbé

The patchbot panke finished its tests. It has only one failure which is exactly the one given in the description of this ticket which I repeat is already tracked at #32697:

sage -t --long --random-seed=318717441882109214278396779393985383988 src/sage/tests/cmdline.py
**********************************************************************
File "src/sage/tests/cmdline.py", line 732, in sage.tests.cmdline.test_executable
Failed example:
    print(open(output, 'r').read() == t)          # optional - pandoc
Expected:
    True
Got:
    False
**********************************************************************
1 item had failures:
   1 of 223 in sage.tests.cmdline.test_executable
    [222 tests, 1 failure, 57.81 s]

From me it is a positive review. Next stuff to be checked are

  • whether it works on vindelecroix-labri1 machine (are the 63 + 89 failures gone with the last changes by Matthias? personnaly, I am not even sure). That being said Vincent is gone for vacation for 4 weeks, so we might not want to wait for an answer.
  • whether it works on Volker's machine (normally this was fixed by 07b2512)

comment:75 in reply to:  74 ; Changed 10 months ago by Matthias Köppe

Replying to slabbe:

  • whether it works on vindelecroix-labri1 machine (are the 63 + 89 failures gone with the last changes by Matthias?

Well, these tests are # optional - latex, and latex is now no longer automatically added unless external is in use.

comment:76 in reply to:  75 Changed 10 months ago by Sébastien Labbé

Replying to mkoeppe:

Replying to slabbe:

  • whether it works on vindelecroix-labri1 machine (are the 63 + 89 failures gone with the last changes by Matthias?

Well, these tests are # optional - latex, and latex is now no longer automatically added unless external is in use.

No, only very few of them are marked as # optional - latex, maybe two of them if I well remember.

comment:77 Changed 10 months ago by Matthias Köppe

Thanks for the correction.

comment:78 Changed 10 months ago by Sébastien Labbé

Status: needs_reviewpositive_review

I think we will not have answers from Vincent as he is on vacation. A solution to this weird problem seen on vdelecroix-labri1 patchbot is suggested in comment https://trac.sagemath.org/ticket/32174#comment:57 (install cm-super).

I change the status to positive review.

comment:79 Changed 10 months ago by Matthias Köppe

Thanks!

comment:80 Changed 10 months ago by Volker Braun

Status: positive_reviewneeds_work

Still fails:

sage -t --long --warn-long 42.3 --random-seed=269228488280518602699863791762785215883 src/sage/tests/cmdline.py
**********************************************************************
File "src/sage/tests/cmdline.py", line 732, in sage.tests.cmdline.test_executable
Failed example:
    print(open(output, 'r').read() == t)          # optional - pandoc
Expected:
    True
Got:
    False
**********************************************************************
1 item had failures:
   1 of 223 in sage.tests.cmdline.test_executable
    [222 tests, 1 failure, 39.52 s]

comment:81 Changed 10 months ago by Matthias Köppe

that's #32697 "sage --ipynb2rst is broken due to changes in nbconvert

comment:82 Changed 10 months ago by git

Commit: 3bfe1a14fbce31550866a1d4b393ec076e344592fdfe1a7e03d3bd32e9433cdb164ce013a6d0dfd3

Branch pushed to git repo; I updated commit sha1. New commits:

fdfe1a7src/sage/tests/cmdline.py: Mark a doctest # known bug #32697

comment:83 Changed 10 months ago by Matthias Köppe

Status: needs_workneeds_review

comment:84 Changed 10 months ago by Sébastien Labbé

Status: needs_reviewpositive_review

comment:85 Changed 10 months ago by Matthias Köppe

Thanks!

comment:86 Changed 10 months ago by Volker Braun

Status: positive_reviewneeds_work
**********************************************************************
File "src/sage/misc/latex.py", line 1087, in sage.misc.latex.Latex.?
Failed example:
    latex.eval(r"\ThisIsAnInvalidCommand", {}) # optional -- ImageMagick
Exception raised:
    Traceback (most recent call last):
      File "/var/lib/buildbot/slave/sage_git/build/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/doctest/forker.py", line 694, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/var/lib/buildbot/slave/sage_git/build/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/doctest/forker.py", line 1088, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.misc.latex.Latex.?[1]>", line 1, in <module>
        latex.eval(r"\ThisIsAnInvalidCommand", {}) # optional -- ImageMagick
      File "/var/lib/buildbot/slave/sage_git/build/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/misc/latex.py", line 1128, in eval
        e = _run_latex_(os.path.join(base, filename + ".tex"), debug=debug,
      File "/var/lib/buildbot/slave/sage_git/build/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/misc/latex.py", line 725, in _run_latex_
        pdflatex().require()
      File "/var/lib/buildbot/slave/sage_git/build/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/features/__init__.py", line 206, in require
        raise FeatureNotPresentError(self, presence.reason, presence.resolution)
    sage.features.FeatureNotPresentError: pdflatex is not available.
    Executable 'pdflatex' not found on PATH.
    Further installation instructions might be available at https://www.latex-project.org/.
**********************************************************************
1 item had failures:
   1 of   3 in sage.misc.latex.Latex.?
    [250 tests, 1 failure, 0.35 s]
    Timed out
**********************************************************************

comment:87 Changed 10 months ago by git

Commit: fdfe1a7e03d3bd32e9433cdb164ce013a6d0dfd341c4cd4917a1f513f995054da47b30edf19ddad1

Branch pushed to git repo; I updated commit sha1. New commits:

8f5c962Merge tag '9.5.beta8' into t/32174/public/32174
41c4cd4src/sage/misc/latex.py: Add another # optional - latex

comment:88 Changed 10 months ago by Matthias Köppe

Status: needs_workpositive_review

comment:89 Changed 10 months ago by Volker Braun

Branch: public/3217441c4cd4917a1f513f995054da47b30edf19ddad1
Resolution: fixed
Status: positive_reviewclosed

comment:90 Changed 10 months ago by Volker Braun

Commit: 41c4cd4917a1f513f995054da47b30edf19ddad1

Followup at #33045 for ffmpeg

Last edited 9 months ago by Samuel Lelièvre (previous) (diff)

comment:91 Changed 9 months ago by Samuel Lelièvre

Followup at #33101 for lrslib.

comment:92 Changed 9 months ago by Samuel Lelièvre

See also #33092 for ffmpeg and imagemagick.

Note: See TracTickets for help on using tickets.