Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ build/pkgs/wheel/version_requirements.txt
/src/doc/en/reference/*/sage_docbuild
/src/doc/en/reference/sage
/src/doc/en/reference/spkg/*.rst
!/src/doc/en/reference/spkg/index.rst
/src/doc/output
/src/doc/en/installation/*.txt
/src/doc/en/reference/repl/*.txt
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ distclean: build-clean
bootstrap-clean:
rm -rf config/install-sh config/compile config/config.guess config/config.sub config/missing configure build/make/Makefile-auto.in
rm -f src/doc/en/installation/*.txt
rm -rf src/doc/en/reference/spkg/*.rst
find src/doc/en/reference/spkg -name index.rst -prune -o -maxdepth 1 -name "*.rst" -exec rm -f {} \+
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
Copy link
Collaborator

@kwankyu kwankyu Jun 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is the source of the "bug" Volker was experiencing.

Unlike previous rm -rf src/doc/en/reference/spkg/*.rst, where the option -r is really ineffective, the find command searches the directory src/doc/en/reference/spkg and its subdirectories, and removes all *.rst files. In particular the file src/doc/en/reference/spkg/sage/features.rst is removed.

The file is in control of the doc builder and to be updated by it if necessary. Suppose that the file is created by the doc builder in other git branch. After switching to this PR branch, ./bootstrap removes the file, but the doc builder still believes the file is intact, and the removed file is not recreated. Hence the boom.

Incremental doc build mixed with switching git branches is inherently instable. But the changed behavior caused by this PR (the command in line 176) exacerbates the instability, as Volker could see through.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for this detective work!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Works well with me (that is, no more the bug for me).

rm -f src/Pipfile
rm -f src/requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ save () {
config/install-sh config/compile config/config.guess config/config.sub config/missing \
build/make/Makefile-auto.in \
src/doc/en/installation/*.txt \
src/doc/en/reference/spkg/*.rst \
$(find src/doc/en/reference/spkg -name index.rst -prune -o -maxdepth 1 -name "*.rst" -print) \
environment-3.[89].yml environment-3.1[0-9].yml \
src/environment-3.[89].yml src/environment-3.1[0-9].yml \
environment-optional-3.[89].yml environment-optional-3.1[0-9].yml \
Expand Down
126 changes: 18 additions & 108 deletions src/doc/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -84,169 +84,79 @@ mkdir -p "$OUTPUT_DIR"
if [ "${BOOTSTRAP_QUIET}" = "no" ]; then
echo >&2 $0:$LINENO: installing "$OUTPUT_DIR"/"*.rst"
fi
OUTPUT_INDEX="$OUTPUT_DIR"/index.rst
cat > "$OUTPUT_INDEX" <<EOF
.. _spkg:

Packages and Features
=====================

Standard Packages
-----------------

The Sage distribution includes most programs and libraries on which
Sage depends. It installs them automatically if it does not find
equivalent system packages.

(cat <<EOF
Mathematics
~~~~~~~~~~~

EOF
for PKG_BASE in $(sage-package list --has-file SPKG.rst --has-file math :standard: | grep -v '^sagemath_'); do
echo "* :ref:\`spkg_$PKG_BASE\`"
done >> "$OUTPUT_INDEX"
cat >> "$OUTPUT_INDEX" <<EOF
done
cat <<EOF

Front-end, graphics, document preparation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

EOF
for PKG_BASE in $(sage-package list --has-file SPKG.rst --no-file math --has-file front-end :standard: | grep -v '^sagemath_'); do
echo "* :ref:\`spkg_$PKG_BASE\`"
done >> "$OUTPUT_INDEX"
cat >> "$OUTPUT_INDEX" <<EOF
done
cat <<EOF

Other dependencies
~~~~~~~~~~~~~~~~~~

EOF
for PKG_BASE in $(sage-package list --has-file SPKG.rst --no-file math --no-file front-end :standard: | grep -v '^sagemath_'); do
echo "* :ref:\`spkg_$PKG_BASE\`"
done >> "$OUTPUT_INDEX"
cat >> "$OUTPUT_INDEX" <<EOF


Optional Packages
-----------------

For additional functionality, you can install some of the following
optional packages.

done) > "$OUTPUT_DIR"/index_standard.rst
(cat <<EOF
Mathematics
~~~~~~~~~~~

EOF
for PKG_BASE in $(sage-package list --has-file SPKG.rst --has-file math :optional: | grep -v '^sagemath_'); do
echo "* :ref:\`spkg_$PKG_BASE\`"
done >> "$OUTPUT_INDEX"
cat >> "$OUTPUT_INDEX" <<EOF
done
cat <<EOF

Front-end, graphics, document preparation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

EOF
for PKG_BASE in $(sage-package list --has-file SPKG.rst --no-file math --has-file front-end :optional: | grep -v '^sagemath_'); do
echo "* :ref:\`spkg_$PKG_BASE\`"
done >> "$OUTPUT_INDEX"
cat >> "$OUTPUT_INDEX" <<EOF
done
cat <<EOF

Other dependencies
~~~~~~~~~~~~~~~~~~

EOF
for PKG_BASE in $(sage-package list --has-file SPKG.rst --no-file math --no-file front-end :optional: | grep -v '^sagemath_'); do
echo "* :ref:\`spkg_$PKG_BASE\`"
done >> "$OUTPUT_INDEX"
cat >> "$OUTPUT_INDEX" <<EOF


Features
--------

.. toctree::
:maxdepth: 1

sage/features
sage/features/join_feature
sage/features/all
sage/features/sagemath
sage/features/pkg_systems
sage/features/bliss
sage/features/csdp
sage/features/databases
sage/features/dvipng
sage/features/ffmpeg
sage/features/four_ti_2
sage/features/gap
sage/features/graph_generators
sage/features/graphviz
sage/features/imagemagick
sage/features/interfaces
sage/features/internet
sage/features/kenzo
sage/features/latex
sage/features/latte
sage/features/lrs
sage/features/mcqd
sage/features/meataxe
sage/features/mip_backends
sage/features/normaliz
sage/features/pandoc
sage/features/pdf2svg
sage/features/polymake
sage/features/rubiks
sage/features/tdlib
EOF
cat >> "$OUTPUT_INDEX" <<EOF

Distribution Packages of the Sage Library
-----------------------------------------

EOF
done) > "$OUTPUT_DIR"/index_optional.rst
for PKG_BASE in $(sage-package list --has-file SPKG.rst | grep '^sagemath_'); do
echo "* :ref:\`spkg_$PKG_BASE\`"
done >> "$OUTPUT_INDEX"
cat >> "$OUTPUT_INDEX" <<EOF

Experimental Packages
---------------------

Some packages that provide additional functionality are marked as
"experimental". Developers are needed in order to improve the
integration of these packages into the Sage distribution.

done > "$OUTPUT_DIR"/index_sagemath.rst
(cat <<EOF
Mathematics
~~~~~~~~~~~

EOF
for PKG_BASE in $(sage-package list --has-file SPKG.rst --has-file math :experimental: | grep -v '^sagemath_'); do
echo "* :ref:\`spkg_$PKG_BASE\`"
done >> "$OUTPUT_INDEX"
done

cat >> "$OUTPUT_INDEX" <<EOF
cat <<EOF

Other dependencies
~~~~~~~~~~~~~~~~~~

EOF
for PKG_BASE in $(sage-package list --has-file SPKG.rst --no-file math :experimental: | grep -v '^sagemath_'); do
echo "* :ref:\`spkg_$PKG_BASE\`"
done >> "$OUTPUT_INDEX"

cat >> "$OUTPUT_INDEX" <<EOF


All External Packages
---------------------

.. toctree::
:maxdepth: 1

index_alph

EOF

OUTPUT_INDEX="$OUTPUT_DIR"/index_alph.rst
done) > "$OUTPUT_DIR"/index_experimental.rst
(cat <<EOF

Details of external packages
Expand All @@ -268,5 +178,5 @@ cat <<EOF
.. default-role::

EOF
) > "$OUTPUT_INDEX"
) > "$OUTPUT_DIR"/index_alph.rst
sage-package list --has-file SPKG.rst | OUTPUT_DIR=$OUTPUT_DIR OUTPUT_RST=1 xargs -P 99 -n 1 sage-spkg-info
87 changes: 87 additions & 0 deletions src/doc/en/reference/spkg/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
.. _spkg:

Packages and Features
=====================

Standard Packages
-----------------

The Sage distribution includes most programs and libraries on which
Sage depends. It installs them automatically if it does not find
equivalent system packages.

.. include:: index_standard.rst


Optional Packages
-----------------

For additional functionality, you can install some of the following
optional packages.

.. include:: index_optional.rst


Features
--------

.. toctree::
:maxdepth: 1

sage/features
sage/features/join_feature
sage/features/all
sage/features/sagemath
sage/features/pkg_systems
sage/features/bliss
sage/features/csdp
sage/features/databases
sage/features/dvipng
sage/features/ffmpeg
sage/features/four_ti_2
sage/features/gap
sage/features/graph_generators
sage/features/graphviz
sage/features/imagemagick
sage/features/interfaces
sage/features/internet
sage/features/kenzo
sage/features/latex
sage/features/latte
sage/features/lrs
sage/features/mcqd
sage/features/meataxe
sage/features/mip_backends
sage/features/normaliz
sage/features/pandoc
sage/features/pdf2svg
sage/features/polymake
sage/features/rubiks
sage/features/tdlib
sage/features/topcom


Distribution Packages of the Sage Library
-----------------------------------------

.. include:: index_sagemath.rst


Experimental Packages
---------------------

Some packages that provide additional functionality are marked as
"experimental". Developers are needed in order to improve the
integration of these packages into the Sage distribution.

.. include:: index_experimental.rst


All External Packages
---------------------

.. toctree::
:maxdepth: 1

index_alph

67 changes: 67 additions & 0 deletions src/sage/features/topcom.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# sage_setup: distribution = sagemath-environment
r"""
Features for testing the presence of topcom executables
"""

# *****************************************************************************
# Copyright (C) 2022-2024 Matthias Koeppe
#
# Distributed under the terms of the GNU General Public License (GPL)
# as published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.
# https://www.gnu.org/licenses/
# *****************************************************************************

from . import Executable
from .join_feature import JoinFeature


class TOPCOMExecutable(Executable):
r"""
A :class:`~sage.features.Feature` which checks for executables from the :ref:`TOPCOM <spkg_topcom>` package.

EXAMPLES::

sage: from sage.features.topcom import TOPCOMExecutable
sage: TOPCOMExecutable('points2allfinetriangs').is_present() # optional - topcom
FeatureTestResult('topcom_points2allfinetriangs', True)
"""
def __init__(self, name):
r"""
TESTS::

sage: from sage.features.topcom import TOPCOMExecutable
sage: isinstance(TOPCOMExecutable('points2finetriangs'), TOPCOMExecutable)
True
"""
Executable.__init__(self, name=f"topcom_{name}",
executable=name,
spkg="topcom")


class TOPCOM(JoinFeature):
r"""
A :class:`~sage.features.Feature` describing the presence of the executables
which comes as a part of :ref:`TOPCOM <spkg_topcom>`.

EXAMPLES::

sage: from sage.features.topcom import TOPCOM
sage: TOPCOM().is_present() # optional - topcom
FeatureTestResult('topcom', True)
"""
def __init__(self):
r"""
TESTS::

sage: from sage.features.topcom import TOPCOM
sage: isinstance(TOPCOM(), TOPCOM)
True
"""
JoinFeature.__init__(self, "topcom",
[TOPCOMExecutable(name)
for name in ('points2allfinetriangs',)])


def all_features():
return [TOPCOM()]
Loading