Closed mkoeppe closed 2 years ago
Dependencies: #32174
Last 10 new commits:
12f7c98 | src/sage/features/polymake.py: Add all_features |
c9312db | src/sage/features: Add more all_features functions |
230d135 | src/sage/geometry/hyperbolic_space/hyperbolic_geodesic.py: Fix doctest markup |
7a8f48c | src/sage/features/sagemath.py (sage_features): Unused now, removed |
e7f538d | sage.features.bliss: Change name of BlissLibrary feature to libbliss, remove it from all_features |
12a2507 | src/sage/features/interfaces.py: Fix indentation in docstring |
0dd76b6 | Merge tag '9.5.beta7' into t/32174/doctests__detect__safe__external_features_even_if____optional_external__is_not_used |
07b2512 | src/sage/misc/latex.py: Conditionalize some doctests on latex_package_tkz_graph |
2dd9ad3 | Merge #32174 |
42d35b0 | src/sage/features/latex.py (TeXFile, LaTeXPackage, 'latex_package_tkz_graph'): New |
When testing the feature, I get:
NameError: name 'FeatureNotPresentError' is not defined
an import is missing.
Branch pushed to git repo; I updated commit sha1. New commits:
da1e922 | src/sage/features/latex.py: Add missing import |
diff --git a/src/sage/features/latex.py b/src/sage/features/latex.py
index 7b95796be4..7bd8d72164 100644
--- a/src/sage/features/latex.py
+++ b/src/sage/features/latex.py
@@ -147,7 +147,7 @@ class TeXFile(StaticFile):
sage: from sage.features.latex import TeXFile
sage: TeXFile('x', 'x.tex').is_present() # optional: pdflatex
FeatureTestResult('x', True)
- sage: TeXFile('nonexisting', 'fajfhjdksf-nonexisting-file.tex').is_present() # optional: pdflatex
+ sage: TeXFile('nonexisting', 'xxxxxx-nonexisting-file.tex').is_present() # optional - pdflatex
FeatureTestResult('nonexisting', False)
"""
def __init__(self, name, filename, **kwds):
@@ -161,7 +161,7 @@ class TeXFile(StaticFile):
sage: from sage.features.latex import TeXFile
sage: feature = TeXFile('latex_class_article', 'article.cls')
- sage: feature.absolute_path() # optional: pdflatex
+ sage: feature.absolute_path() # optional - pdflatex
'.../latex/base/article.cls'
"""
from subprocess import run, CalledProcessError, PIPE
@@ -183,7 +183,7 @@ class LaTeXPackage(TeXFile):
EXAMPLES::
sage: from sage.features.latex import LaTeXPackage
- sage: LaTeXPackage('graphics').is_present() # optional: pdflatex
+ sage: LaTeXPackage('graphics').is_present() # optional - pdflatex
FeatureTestResult('latex_package_graphics', True)
"""
@staticmethod
Otherwise, looks good to me.
Reviewer: Kwankyu Lee
I agree with these changes, please push them to the ticket
Changed branch from u/mkoeppe/features_for_latex_packages to public/32926
Commit: ddac7bc
Branch pushed to git repo; I updated commit sha1. Last 10 new commits:
230d135 | src/sage/geometry/hyperbolic_space/hyperbolic_geodesic.py: Fix doctest markup |
7a8f48c | src/sage/features/sagemath.py (sage_features): Unused now, removed |
e7f538d | sage.features.bliss: Change name of BlissLibrary feature to libbliss, remove it from all_features |
12a2507 | src/sage/features/interfaces.py: Fix indentation in docstring |
0dd76b6 | Merge tag '9.5.beta7' into t/32174/doctests__detect__safe__external_features_even_if____optional_external__is_not_used |
07b2512 | src/sage/misc/latex.py: Conditionalize some doctests on latex_package_tkz_graph |
2dd9ad3 | Merge #32174 |
42d35b0 | src/sage/features/latex.py (TeXFile, LaTeXPackage, 'latex_package_tkz_graph'): New |
da1e922 | src/sage/features/latex.py: Add missing import |
ddac7bc | Small edits |
Okay. Done.
Let's wait for the patchbot run once more.
There are latex related failures on the patchbot, that may be caused by this ticket:
Using --optional=build,debian,dochtml,pip,sage,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,latex_package_tkz_graph,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
...
----------------------------------------------------------------------
sage -t --long --random-seed=178499729190442340371727389632049879918 src/sage/plot/plot.py # 89 doctests failed
sage -t --long --random-seed=178499729190442340371727389632049879918 src/sage/plot/graphics.py # 63 doctests failed
sage -t --long --random-seed=178499729190442340371727389632049879918 src/sage/misc/latex.py # 1 doctest failed
----------------------------------------------------------------------
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
in particular:
sage -t --long --random-seed=178499729190442340371727389632049879918 src/sage/misc/latex.py
**********************************************************************
File "src/sage/misc/latex.py", line 1968, in sage.misc.latex.?
Failed example:
png(ZZ[x], os.path.join(SAGE_TMP, "zz.png")) # random, optional - latex
Exception raised:
Traceback (most recent call last):
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.misc.latex.?[1]>", line 1, in <module>
png(ZZ[x], os.path.join(SAGE_TMP, "zz.png")) # random, optional - latex
File "/home/debian/sage/local/lib/python3.9/site-packages/sage/misc/latex.py", line 1990, in png
e = _run_latex_(tex_file, density=density, debug=debug,
File "/home/debian/sage/local/lib/python3.9/site-packages/sage/misc/latex.py", line 755, in _run_latex_
ImageMagick().require()
File "/home/debian/sage/local/lib/python3.9/site-packages/sage/features/__init__.py", line 205, in require
raise FeatureNotPresentError(self, presence.reason, presence.resolution)
sage.features.FeatureNotPresentError: imagemagick is not available.
Executable 'convert' not found on PATH.
To install imagemagick using the debian package manager, you can try to run:
!sudo apt-get update
!sudo apt-get install texlive-latex-extra texlive-xetex latexmk dvipng default-jdk ffmpeg libavdevice-dev
To install imagemagick using the Sage package manager, you can try to run:
!sage -i _recommended
No equivalent system packages for pip are known to Sage.
Further installation instructions might be available at https://www.imagemagick.org/.
**********************************************************************
1 item had failures:
1 of 19 in sage.misc.latex.?
[257 tests, 1 failure, 5.09 s]
Also notice:
To install imagemagick using the debian package manager, you can try to run:
!sudo apt-get update
!sudo apt-get install texlive-latex-extra texlive-xetex latexmk dvipng default-jdk ffmpeg libavdevice-dev
This failure in testing src/sage/misc/latex.py
is probably already visible with #32174.
Branch pushed to git repo; I updated commit sha1. New commits:
60bdd71 | sage.misc.latex.png: Mark doctest # optional - imagemagick |
Not sure what's going on in the other failures in sage.plot
.
(This comment was moved to #32174 comment:56)
Replying to @mkoeppe:
This failure in testing
src/sage/misc/latex.py
is probably already visible with #32174.
Ok, so I confirm that the 89 + 63 failures are already seen by the patchbot labri-vindelecroix-1
while testing #32174, so it is not related to the current ticket.
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
cb13437 | 32174: fix the --show-skipped doctest report |
391dca1 | sage.misc.latex.png: Mark doctest # optional - imagemagick |
6f311b3 | src/sage/doctest/external.py: Revert latex features to 'external' |
3bfe1a1 | 32174: adapting the doctest listing external softwares |
e41cf29 | src/sage/features/latex.py (TeXFile, LaTeXPackage, 'latex_package_tkz_graph'): New |
8d875d5 | src/sage/features/latex.py: Add missing import |
140575c | Small edits |
rebased on top of updated #32174
Replying to @seblabbe:
Also notice:
To install imagemagick using the debian package manager, you can try to run: !sudo apt-get update !sudo apt-get install texlive-latex-extra texlive-xetex latexmk dvipng default-jdk ffmpeg libavdevice-dev
See #32956 to deal with that.
Changed reviewer from Kwankyu Lee to Kwankyu Lee; Sébastien Labbé
No more thing to do here. Right?
Maybe a short ticket description?
E.g. is there a meta-ticket or documentation page or release tour item about "features"?
Other than that, this ticket depends on #32174 which still needs review.
Okay then.
Description changed:
---
+++
@@ -1 +1 @@
-
+Add Features `LaTeXPackage` to detect presence of latex packages.
As the dependency #32174 just got positive review.
sage -t --long --warn-long 41.2 --random-seed=90818346224792411697676027482246961463 src/sage/doctest/external.py
**********************************************************************
File "src/sage/doctest/external.py", line 379, in sage.doctest.external.AvailableSoftware
Failed example:
external_software
Expected:
['cplex',
'gurobi',
'internet',
'latex',
'lualatex',
'macaulay2',
'magma',
'maple',
'mathematica',
'matlab',
'octave',
'pdflatex',
'scilab',
'xelatex']
Got:
['cplex',
'gurobi',
'internet',
'latex',
'latex_package_tkz_graph',
'lualatex',
'macaulay2',
'magma',
'maple',
'mathematica',
'matlab',
'octave',
'pdflatex',
'scilab',
'xelatex']
**********************************************************************
1 item had failures:
1 of 3 in sage.doctest.external.AvailableSoftware
[40 tests, 1 failure, 0.02 s]
Changed branch from public/32926 to e22c173
Changed reviewer from Kwankyu Lee; Sébastien Labbé to Kwankyu Lee, Sébastien Labbé
Add Features
LaTeXPackage
to detect presence of latex packages.Depends on #32174
CC: @seblabbe @kwankyu
Component: refactoring
Author: Matthias Koeppe
Branch:
e22c173
Reviewer: Kwankyu Lee, Sébastien Labbé
Issue created by migration from https://trac.sagemath.org/ticket/32926