Skip to content

Commit

Permalink
Trac #30207: Deprecate sage.misc.dist.install_scripts
Browse files Browse the repository at this point in the history
This function does not belong into sagelib. If it is still needed at
all, it should become a script in sage-the-distribution.

`install_scripts` is also mentioned in one place in the sage
installation guide, `src/doc/en/installation/source.rst`. We update it.

https://groups.google.com/d/msg/sage-devel/M6S1bL_qU3Y/twdtVp0rBgAJ

URL: https://trac.sagemath.org/30207
Reported by: mkoeppe
Ticket author(s): John Palmieri
Reviewer(s): Matthias Koeppe
  • Loading branch information
Release Manager committed May 17, 2022
2 parents 60fcded + c77ecb0 commit cc7f3b5
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 27 deletions.
13 changes: 0 additions & 13 deletions build/make/install
Original file line number Diff line number Diff line change
Expand Up @@ -137,16 +137,3 @@ fi

# Build succeeded.
echo "Sage build/upgrade complete!"

if [ "$1" = "all" ]; then
echo
echo "To install small scripts to directly run Sage's versions of GAP,"
echo "the PARI/GP interpreter, Maxima, or Singular etc. (by typing e.g."
echo "just 'gap' or 'gp') into a standard 'bin' directory, start Sage"
echo "by typing 'sage' (or './sage') and enter something like"
echo
echo " install_scripts('/usr/local/bin')"
echo
echo "at the Sage command prompt ('sage:')."
echo
fi
6 changes: 3 additions & 3 deletions build/pkgs/configure/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=configure-VERSION.tar.gz
sha1=95acfff3c4ceaaed213c1c4624464c0f4d610f77
md5=b2f47dca06b6d7d625b602a6a1fc8ee1
cksum=3422257505
sha1=9560890d5c9778e603c0a95e41d60c90989f2db3
md5=4301f48ac4d433a452cf5c6777744a34
cksum=86623889
2 changes: 1 addition & 1 deletion build/pkgs/configure/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b90120d1cf32d0c6cd64c57ace825ca2e918afe3
4effb21e884538364aaf403e946785558fe80282
5 changes: 0 additions & 5 deletions src/doc/en/installation/source.rst
Original file line number Diff line number Diff line change
Expand Up @@ -735,11 +735,6 @@ General procedure
Then type ``sage -i <package-name>`` to automatically download and install
a given package.

#. Optional:
Run the ``install_scripts`` command from within Sage to create GAP, GP,
Maxima, Singular, etc., scripts in your :envvar:`PATH`.
Type ``install_scripts?`` in Sage for details.

#. Have fun! Discover some amazing conjectures!

Rebasing issues on Cygwin
Expand Down
17 changes: 12 additions & 5 deletions src/sage/misc/dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,25 @@

import os

from sage.misc.superseded import deprecation

def install_scripts(directory=None, ignore_existing=False):
r"""
This function has been deprecated.
Running ``install_scripts(directory)`` creates scripts in the
given directory that run various software components included with
Sage. Each of these scripts essentially just runs ``sage --CMD``
where ``CMD`` is also the name of the script:
- 'gap' runs GAP
- 'gp' runs the PARI/GP interpreter
- 'hg' runs Mercurial
- 'ipython' runs IPython
- 'maxima' runs Maxima
- 'mwrank' runs mwrank
- 'R' runs R
- 'singular' runs Singular
- 'sqlite3' runs SQLite version 3
- 'kash' runs Kash if it is installed
- 'M2' runs Macaulay2 if it is installed
This command:
Expand Down Expand Up @@ -69,9 +70,15 @@ def install_scripts(directory=None, ignore_existing=False):
EXAMPLES::
sage: install_scripts(str(SAGE_TMP), ignore_existing=True)
doctest:warning...
the function install_scripts has been deprecated and will be removed in a future version of Sage
See https://trac.sagemath.org/30207 for details.
Checking that Sage has the command 'gap' installed
...
"""
deprecation(30207, 'the function install_scripts has been deprecated and '
'will be removed in a future version of Sage')

if directory is None:
# We do this since the intended user of install_scripts
# will likely be pretty clueless about how to use Sage or
Expand Down Expand Up @@ -110,8 +117,8 @@ def install_scripts(directory=None, ignore_existing=False):
dir_in_path = any(os.path.samefile(directory, d) for d in PATH)
PATH = os.pathsep.join(d for d in PATH
if not os.path.samefile(d, SAGE_BIN))
for cmd in ['gap', 'gp', 'hg', 'ipython', 'maxima',
'mwrank', 'R', 'singular', 'sqlite3', 'M2', 'kash']:
for cmd in ['gap', 'gp', 'ipython', 'maxima',
'mwrank', 'R', 'singular', 'sqlite3']:
print(f"Checking that Sage has the command '{cmd}' installed")
# Check to see if Sage includes cmd.
cmd_inside_sage = have_program(cmd, path=SAGE_BIN)
Expand Down

0 comments on commit cc7f3b5

Please sign in to comment.