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

Features for latex packages #32926

Closed
mkoeppe opened this issue Nov 24, 2021 · 39 comments
Closed

Features for latex packages #32926

mkoeppe opened this issue Nov 24, 2021 · 39 comments

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Nov 24, 2021

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

@mkoeppe mkoeppe added this to the sage-9.5 milestone Nov 24, 2021
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Nov 24, 2021

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Nov 24, 2021

Dependencies: #32174

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Nov 24, 2021

Last 10 new commits:

12f7c98src/sage/features/polymake.py: Add all_features
c9312dbsrc/sage/features: Add more all_features functions
230d135src/sage/geometry/hyperbolic_space/hyperbolic_geodesic.py: Fix doctest markup
7a8f48csrc/sage/features/sagemath.py (sage_features): Unused now, removed
e7f538dsage.features.bliss: Change name of BlissLibrary feature to libbliss, remove it from all_features
12a2507src/sage/features/interfaces.py: Fix indentation in docstring
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
2dd9ad3Merge #32174
42d35b0src/sage/features/latex.py (TeXFile, LaTeXPackage, 'latex_package_tkz_graph'): New

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Nov 24, 2021

Commit: 42d35b0

@seblabbe
Copy link
Contributor

comment:4

When testing the feature, I get:

NameError: name 'FeatureNotPresentError' is not defined

an import is missing.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 25, 2021

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

da1e922src/sage/features/latex.py: Add missing import

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 25, 2021

Changed commit from 42d35b0 to da1e922

@kwankyu
Copy link
Collaborator

kwankyu commented Nov 30, 2021

comment:8
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.

@kwankyu
Copy link
Collaborator

kwankyu commented Nov 30, 2021

Reviewer: Kwankyu Lee

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Nov 30, 2021

comment:10

I agree with these changes, please push them to the ticket

@kwankyu
Copy link
Collaborator

kwankyu commented Dec 1, 2021

Changed branch from u/mkoeppe/features_for_latex_packages to public/32926

@kwankyu
Copy link
Collaborator

kwankyu commented Dec 1, 2021

Changed commit from da1e922 to none

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 1, 2021

Commit: ddac7bc

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 1, 2021

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

230d135src/sage/geometry/hyperbolic_space/hyperbolic_geodesic.py: Fix doctest markup
7a8f48csrc/sage/features/sagemath.py (sage_features): Unused now, removed
e7f538dsage.features.bliss: Change name of BlissLibrary feature to libbliss, remove it from all_features
12a2507src/sage/features/interfaces.py: Fix indentation in docstring
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
2dd9ad3Merge #32174
42d35b0src/sage/features/latex.py (TeXFile, LaTeXPackage, 'latex_package_tkz_graph'): New
da1e922src/sage/features/latex.py: Add missing import
ddac7bcSmall edits

@kwankyu
Copy link
Collaborator

kwankyu commented Dec 1, 2021

comment:13

Okay. Done.

@kwankyu
Copy link
Collaborator

kwankyu commented Dec 1, 2021

comment:15

Let's wait for the patchbot run once more.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 1, 2021

Changed commit from 60bdd71 to 140575c

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 1, 2021

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

cb1343732174: fix the --show-skipped doctest report
391dca1sage.misc.latex.png: Mark doctest # optional - imagemagick
6f311b3src/sage/doctest/external.py: Revert latex features to 'external'
3bfe1a132174: adapting the doctest listing external softwares
e41cf29src/sage/features/latex.py (TeXFile, LaTeXPackage, 'latex_package_tkz_graph'): New
8d875d5src/sage/features/latex.py: Add missing import
140575cSmall edits

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Dec 1, 2021

comment:23

rebased on top of updated #32174

@seblabbe
Copy link
Contributor

seblabbe commented Dec 1, 2021

comment:24

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.

@kwankyu
Copy link
Collaborator

kwankyu commented Dec 3, 2021

Changed reviewer from Kwankyu Lee to Kwankyu Lee; Sébastien Labbé

@kwankyu
Copy link
Collaborator

kwankyu commented Dec 3, 2021

comment:25

No more thing to do here. Right?

@slel
Copy link
Member

slel commented Dec 3, 2021

comment:26

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.

@kwankyu
Copy link
Collaborator

kwankyu commented Dec 3, 2021

comment:27

Okay then.

@kwankyu

This comment has been minimized.

@kwankyu
Copy link
Collaborator

kwankyu commented Dec 3, 2021

comment:30

As the dependency #32174 just got positive review.

@vbraun
Copy link
Member

vbraun commented Dec 12, 2021

comment:31
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]

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 12, 2021

Changed commit from 140575c to e22c173

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 12, 2021

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

29a0750Merge tag '9.5.beta8' into t/32926/public/32926
e22c173src/sage/doctest/external.py: Update doctest output

@vbraun
Copy link
Member

vbraun commented Dec 19, 2021

Changed branch from public/32926 to e22c173

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 30, 2022

Changed commit from e22c173 to none

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Jan 30, 2022

Changed reviewer from Kwankyu Lee; Sébastien Labbé to Kwankyu Lee, Sébastien Labbé

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

5 participants