Skip to content

Commit ca2c902

Browse files
committed
src/sage/features/mwrank.py: new feature for the mwrank program
The meson build system is now capable of building sagelib without linking to libec, which means that the mwrank program may not be installed. Here we add a new feature to represent it. In particular this allows us to use "needs mwrank" in tests.
1 parent a8e5c42 commit ca2c902

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

src/sage/features/mwrank.py

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

0 commit comments

Comments
 (0)