Skip to content

Commit b7ae5f9

Browse files
author
Release Manager
committed
gh-37858: `sage.features.topcom` <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes #12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes #12345". --> - Part of #35856 We also change how the SPKG index in the reference manual is generated. `index.rst` is now a static file that uses `.. include` directives to read in generated files `index_standard.rst`, `index_optional.rst`, etc. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - #12345: short description why this is a dependency --> <!-- - #34567: ... --> URL: #37858 Reported by: Matthias Köppe Reviewer(s): Kwankyu Lee, Matthias Köppe
2 parents 81734ed + 1c6e248 commit b7ae5f9

File tree

7 files changed

+182
-117
lines changed

7 files changed

+182
-117
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ build/pkgs/wheel/version_requirements.txt
261261
/src/doc/en/reference/*/sage_docbuild
262262
/src/doc/en/reference/sage
263263
/src/doc/en/reference/spkg/*.rst
264+
!/src/doc/en/reference/spkg/index.rst
264265
/src/doc/output
265266
/src/doc/en/installation/*.txt
266267
/src/doc/en/reference/repl/*.txt

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ distclean: build-clean
173173
bootstrap-clean:
174174
rm -rf config/install-sh config/compile config/config.guess config/config.sub config/missing configure build/make/Makefile-auto.in
175175
rm -f src/doc/en/installation/*.txt
176-
rm -rf src/doc/en/reference/spkg/*.rst
176+
find src/doc/en/reference/spkg -name index.rst -prune -o -maxdepth 1 -name "*.rst" -exec rm -f {} \+
177177
for a in environment environment-optional src/environment src/environment-dev src/environment-optional; do rm -f $$a.yml $$a-3.[89].yml $$a-3.1[0-9].yml; done
178178
rm -f src/Pipfile
179179
rm -f src/requirements.txt

bootstrap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ save () {
225225
config/install-sh config/compile config/config.guess config/config.sub config/missing \
226226
build/make/Makefile-auto.in \
227227
src/doc/en/installation/*.txt \
228-
src/doc/en/reference/spkg/*.rst \
228+
$(find src/doc/en/reference/spkg -name index.rst -prune -o -maxdepth 1 -name "*.rst" -print) \
229229
environment-3.[89].yml environment-3.1[0-9].yml \
230230
src/environment-3.[89].yml src/environment-3.1[0-9].yml \
231231
environment-optional-3.[89].yml environment-optional-3.1[0-9].yml \

src/doc/bootstrap

Lines changed: 18 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -84,169 +84,79 @@ mkdir -p "$OUTPUT_DIR"
8484
if [ "${BOOTSTRAP_QUIET}" = "no" ]; then
8585
echo >&2 $0:$LINENO: installing "$OUTPUT_DIR"/"*.rst"
8686
fi
87-
OUTPUT_INDEX="$OUTPUT_DIR"/index.rst
88-
cat > "$OUTPUT_INDEX" <<EOF
89-
.. _spkg:
90-
91-
Packages and Features
92-
=====================
93-
94-
Standard Packages
95-
-----------------
96-
97-
The Sage distribution includes most programs and libraries on which
98-
Sage depends. It installs them automatically if it does not find
99-
equivalent system packages.
100-
87+
(cat <<EOF
10188
Mathematics
10289
~~~~~~~~~~~
10390
10491
EOF
10592
for PKG_BASE in $(sage-package list --has-file SPKG.rst --has-file math :standard: | grep -v '^sagemath_'); do
10693
echo "* :ref:\`spkg_$PKG_BASE\`"
107-
done >> "$OUTPUT_INDEX"
108-
cat >> "$OUTPUT_INDEX" <<EOF
94+
done
95+
cat <<EOF
10996
11097
Front-end, graphics, document preparation
11198
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11299
113100
EOF
114101
for PKG_BASE in $(sage-package list --has-file SPKG.rst --no-file math --has-file front-end :standard: | grep -v '^sagemath_'); do
115102
echo "* :ref:\`spkg_$PKG_BASE\`"
116-
done >> "$OUTPUT_INDEX"
117-
cat >> "$OUTPUT_INDEX" <<EOF
103+
done
104+
cat <<EOF
118105
119106
Other dependencies
120107
~~~~~~~~~~~~~~~~~~
121108
122109
EOF
123110
for PKG_BASE in $(sage-package list --has-file SPKG.rst --no-file math --no-file front-end :standard: | grep -v '^sagemath_'); do
124111
echo "* :ref:\`spkg_$PKG_BASE\`"
125-
done >> "$OUTPUT_INDEX"
126-
cat >> "$OUTPUT_INDEX" <<EOF
127-
128-
129-
Optional Packages
130-
-----------------
131-
132-
For additional functionality, you can install some of the following
133-
optional packages.
134-
112+
done) > "$OUTPUT_DIR"/index_standard.rst
113+
(cat <<EOF
135114
Mathematics
136115
~~~~~~~~~~~
137116
138117
EOF
139118
for PKG_BASE in $(sage-package list --has-file SPKG.rst --has-file math :optional: | grep -v '^sagemath_'); do
140119
echo "* :ref:\`spkg_$PKG_BASE\`"
141-
done >> "$OUTPUT_INDEX"
142-
cat >> "$OUTPUT_INDEX" <<EOF
120+
done
121+
cat <<EOF
143122
144123
Front-end, graphics, document preparation
145124
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
146125
147126
EOF
148127
for PKG_BASE in $(sage-package list --has-file SPKG.rst --no-file math --has-file front-end :optional: | grep -v '^sagemath_'); do
149128
echo "* :ref:\`spkg_$PKG_BASE\`"
150-
done >> "$OUTPUT_INDEX"
151-
cat >> "$OUTPUT_INDEX" <<EOF
129+
done
130+
cat <<EOF
152131
153132
Other dependencies
154133
~~~~~~~~~~~~~~~~~~
155134
156135
EOF
157136
for PKG_BASE in $(sage-package list --has-file SPKG.rst --no-file math --no-file front-end :optional: | grep -v '^sagemath_'); do
158137
echo "* :ref:\`spkg_$PKG_BASE\`"
159-
done >> "$OUTPUT_INDEX"
160-
cat >> "$OUTPUT_INDEX" <<EOF
161-
162-
163-
Features
164-
--------
165-
166-
.. toctree::
167-
:maxdepth: 1
168-
169-
sage/features
170-
sage/features/join_feature
171-
sage/features/all
172-
sage/features/sagemath
173-
sage/features/pkg_systems
174-
sage/features/bliss
175-
sage/features/csdp
176-
sage/features/databases
177-
sage/features/dvipng
178-
sage/features/ffmpeg
179-
sage/features/four_ti_2
180-
sage/features/gap
181-
sage/features/graph_generators
182-
sage/features/graphviz
183-
sage/features/imagemagick
184-
sage/features/interfaces
185-
sage/features/internet
186-
sage/features/kenzo
187-
sage/features/latex
188-
sage/features/latte
189-
sage/features/lrs
190-
sage/features/mcqd
191-
sage/features/meataxe
192-
sage/features/mip_backends
193-
sage/features/normaliz
194-
sage/features/pandoc
195-
sage/features/pdf2svg
196-
sage/features/polymake
197-
sage/features/rubiks
198-
sage/features/tdlib
199-
EOF
200-
cat >> "$OUTPUT_INDEX" <<EOF
201-
202-
Distribution Packages of the Sage Library
203-
-----------------------------------------
204-
205-
EOF
138+
done) > "$OUTPUT_DIR"/index_optional.rst
206139
for PKG_BASE in $(sage-package list --has-file SPKG.rst | grep '^sagemath_'); do
207140
echo "* :ref:\`spkg_$PKG_BASE\`"
208-
done >> "$OUTPUT_INDEX"
209-
cat >> "$OUTPUT_INDEX" <<EOF
210-
211-
Experimental Packages
212-
---------------------
213-
214-
Some packages that provide additional functionality are marked as
215-
"experimental". Developers are needed in order to improve the
216-
integration of these packages into the Sage distribution.
217-
141+
done > "$OUTPUT_DIR"/index_sagemath.rst
142+
(cat <<EOF
218143
Mathematics
219144
~~~~~~~~~~~
220145
221146
EOF
222147
for PKG_BASE in $(sage-package list --has-file SPKG.rst --has-file math :experimental: | grep -v '^sagemath_'); do
223148
echo "* :ref:\`spkg_$PKG_BASE\`"
224-
done >> "$OUTPUT_INDEX"
149+
done
225150

226-
cat >> "$OUTPUT_INDEX" <<EOF
151+
cat <<EOF
227152
228153
Other dependencies
229154
~~~~~~~~~~~~~~~~~~
230155
231156
EOF
232157
for PKG_BASE in $(sage-package list --has-file SPKG.rst --no-file math :experimental: | grep -v '^sagemath_'); do
233158
echo "* :ref:\`spkg_$PKG_BASE\`"
234-
done >> "$OUTPUT_INDEX"
235-
236-
cat >> "$OUTPUT_INDEX" <<EOF
237-
238-
239-
All External Packages
240-
---------------------
241-
242-
.. toctree::
243-
:maxdepth: 1
244-
245-
index_alph
246-
247-
EOF
248-
249-
OUTPUT_INDEX="$OUTPUT_DIR"/index_alph.rst
159+
done) > "$OUTPUT_DIR"/index_experimental.rst
250160
(cat <<EOF
251161
252162
Details of external packages
@@ -268,5 +178,5 @@ cat <<EOF
268178
.. default-role::
269179
270180
EOF
271-
) > "$OUTPUT_INDEX"
181+
) > "$OUTPUT_DIR"/index_alph.rst
272182
sage-package list --has-file SPKG.rst | OUTPUT_DIR=$OUTPUT_DIR OUTPUT_RST=1 xargs -P 99 -n 1 sage-spkg-info
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
.. _spkg:
2+
3+
Packages and Features
4+
=====================
5+
6+
Standard Packages
7+
-----------------
8+
9+
The Sage distribution includes most programs and libraries on which
10+
Sage depends. It installs them automatically if it does not find
11+
equivalent system packages.
12+
13+
.. include:: index_standard.rst
14+
15+
16+
Optional Packages
17+
-----------------
18+
19+
For additional functionality, you can install some of the following
20+
optional packages.
21+
22+
.. include:: index_optional.rst
23+
24+
25+
Features
26+
--------
27+
28+
.. toctree::
29+
:maxdepth: 1
30+
31+
sage/features
32+
sage/features/join_feature
33+
sage/features/all
34+
sage/features/sagemath
35+
sage/features/pkg_systems
36+
sage/features/bliss
37+
sage/features/csdp
38+
sage/features/databases
39+
sage/features/dvipng
40+
sage/features/ffmpeg
41+
sage/features/four_ti_2
42+
sage/features/gap
43+
sage/features/graph_generators
44+
sage/features/graphviz
45+
sage/features/imagemagick
46+
sage/features/interfaces
47+
sage/features/internet
48+
sage/features/kenzo
49+
sage/features/latex
50+
sage/features/latte
51+
sage/features/lrs
52+
sage/features/mcqd
53+
sage/features/meataxe
54+
sage/features/mip_backends
55+
sage/features/normaliz
56+
sage/features/pandoc
57+
sage/features/pdf2svg
58+
sage/features/polymake
59+
sage/features/rubiks
60+
sage/features/tdlib
61+
sage/features/topcom
62+
63+
64+
Distribution Packages of the Sage Library
65+
-----------------------------------------
66+
67+
.. include:: index_sagemath.rst
68+
69+
70+
Experimental Packages
71+
---------------------
72+
73+
Some packages that provide additional functionality are marked as
74+
"experimental". Developers are needed in order to improve the
75+
integration of these packages into the Sage distribution.
76+
77+
.. include:: index_experimental.rst
78+
79+
80+
All External Packages
81+
---------------------
82+
83+
.. toctree::
84+
:maxdepth: 1
85+
86+
index_alph
87+

src/sage/features/topcom.py

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# sage_setup: distribution = sagemath-environment
2+
r"""
3+
Features for testing the presence of topcom executables
4+
"""
5+
6+
# *****************************************************************************
7+
# Copyright (C) 2022-2024 Matthias Koeppe
8+
#
9+
# Distributed under the terms of the GNU General Public License (GPL)
10+
# as published by the Free Software Foundation; either version 2 of
11+
# the License, or (at your option) any later version.
12+
# https://www.gnu.org/licenses/
13+
# *****************************************************************************
14+
15+
from . import Executable
16+
from .join_feature import JoinFeature
17+
18+
19+
class TOPCOMExecutable(Executable):
20+
r"""
21+
A :class:`~sage.features.Feature` which checks for executables from the :ref:`TOPCOM <spkg_topcom>` package.
22+
23+
EXAMPLES::
24+
25+
sage: from sage.features.topcom import TOPCOMExecutable
26+
sage: TOPCOMExecutable('points2allfinetriangs').is_present() # optional - topcom
27+
FeatureTestResult('topcom_points2allfinetriangs', True)
28+
"""
29+
def __init__(self, name):
30+
r"""
31+
TESTS::
32+
33+
sage: from sage.features.topcom import TOPCOMExecutable
34+
sage: isinstance(TOPCOMExecutable('points2finetriangs'), TOPCOMExecutable)
35+
True
36+
"""
37+
Executable.__init__(self, name=f"topcom_{name}",
38+
executable=name,
39+
spkg="topcom")
40+
41+
42+
class TOPCOM(JoinFeature):
43+
r"""
44+
A :class:`~sage.features.Feature` describing the presence of the executables
45+
which comes as a part of :ref:`TOPCOM <spkg_topcom>`.
46+
47+
EXAMPLES::
48+
49+
sage: from sage.features.topcom import TOPCOM
50+
sage: TOPCOM().is_present() # optional - topcom
51+
FeatureTestResult('topcom', True)
52+
"""
53+
def __init__(self):
54+
r"""
55+
TESTS::
56+
57+
sage: from sage.features.topcom import TOPCOM
58+
sage: isinstance(TOPCOM(), TOPCOM)
59+
True
60+
"""
61+
JoinFeature.__init__(self, "topcom",
62+
[TOPCOMExecutable(name)
63+
for name in ('points2allfinetriangs',)])
64+
65+
66+
def all_features():
67+
return [TOPCOM()]

0 commit comments

Comments
 (0)