sagemath/sage

Features for interpreter interfaces

mkoeppe opened this issue · 17 comments

Follow-up from #32649

CC: @kwankyu @seblabbe

Component: refactoring

Author: Matthias Koeppe

Branch/Commit: 944bb74

Reviewer: Sébastien Labbé

Issue created by migration from https://trac.sagemath.org/ticket/32866

Author: Matthias Koeppe, ...

New commits:

eaec400src/sage/features/interfaces.py: New

Commit: eaec400

Changed commit from eaec400 to 52ac51e

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

827ca03src/sage/features/interfaces.py: Fix and doctest exception handling
52ac51esrc/sage/features/interfaces.py (all_features): New

Changed commit from 52ac51e to 8081f29

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

7754faesrc/sage/features/interfaces.py: Fix and doctest exception handling (fixup)
8081f29src/sage/doctest/external.py: Use sage.features.interfaces

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

945132bsrc/sage/features/interfaces.py: Fix up

Changed commit from 8081f29 to 945132b

Changed author from Matthias Koeppe, ... to Matthias Koeppe

Changed commit from 945132b to 944bb74

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

944bb74src/sage/features/interfaces.py: Add doctests
comment:8

Looks good to me. Doctests pass. Patchbot is green. The coverage is not 100% because of few docstring missing in staticmethods __classcall__ but these are doctested in the doc of the the class just above. So, LGTM. I tested the functionnality. In particular, I get:

sage: from sage.features.interfaces import all_features
sage: [(f,f.is_present()) for f in all_features()]
[(Feature('magma'), FeatureTestResult('magma', False)),
 (Feature('matlab'), FeatureTestResult('matlab', False)),
 (Feature('mathematica'), FeatureTestResult('mathematica', False)),
 (Feature('maple'), FeatureTestResult('maple', False)),
 (Feature('macaulay2'), FeatureTestResult('macaulay2', False)),
 (Feature('octave'), FeatureTestResult('octave', True)),
 (Feature('scilab'), FeatureTestResult('scilab', False))]

which is sometimes True and sometimes False. Therefore, the routine works.

Reviewer: Sébastien Labbé

comment:9

Thank you!