Skip to content

Commit

Permalink
src/sage/features/giac.py: add new feature for the giac program
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
orlitzky committed Sep 18, 2024
1 parent 24698e7 commit 83dd05a
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/sage/features/giac.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# sage_setup: distribution = sagemath-environment
r"""
Feature for testing the presence of ``giac``
"""

from . import Executable, FeatureTestResult

class Giac(Executable):
r"""
A :class:`~sage.features.Feature` describing the presence of :ref:`giac <spkg_giac>`.
EXAMPLES::
sage: from sage.features.giac import Giac
sage: Giac().is_present() # needs giac
FeatureTestResult('giac', True)
"""
def __init__(self):
r"""
TESTS::
sage: from sage.features.giac import Giac
sage: isinstance(Giac(), Giac)
True
"""
Executable.__init__(self, 'giac', executable='giac',
spkg='giac', type='standard')

def all_features():
return [Giac()]

0 comments on commit 83dd05a

Please sign in to comment.