Skip to content

Commit 83dd05a

Browse files
committedSep 18, 2024·
src/sage/features/giac.py: add new feature for the giac program
In preparation for adding a --disable-giac option, we add a new feature that detects the presence of the "giac" executable. We already have a feature for sage.libs.giac, but that only guards the libgiac interface; we still have code that runs "giac" behind pexpect. This will allow us to skip those tests when giac is not installed.
1 parent 24698e7 commit 83dd05a

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed
 

‎src/sage/features/giac.py

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# sage_setup: distribution = sagemath-environment
2+
r"""
3+
Feature for testing the presence of ``giac``
4+
"""
5+
6+
from . import Executable, FeatureTestResult
7+
8+
class Giac(Executable):
9+
r"""
10+
A :class:`~sage.features.Feature` describing the presence of :ref:`giac <spkg_giac>`.
11+
12+
EXAMPLES::
13+
14+
sage: from sage.features.giac import Giac
15+
sage: Giac().is_present() # needs giac
16+
FeatureTestResult('giac', True)
17+
"""
18+
def __init__(self):
19+
r"""
20+
TESTS::
21+
22+
sage: from sage.features.giac import Giac
23+
sage: isinstance(Giac(), Giac)
24+
True
25+
"""
26+
Executable.__init__(self, 'giac', executable='giac',
27+
spkg='giac', type='standard')
28+
29+
def all_features():
30+
return [Giac()]

0 commit comments

Comments
 (0)
Please sign in to comment.