summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2019-06-06 18:26:43 -0700
committerGitHub <noreply@github.com>2019-06-06 18:26:43 -0700
commit06cc799fd33cf38a3f6acf14d99a7c3c955cab09 (patch)
tree64126c0838d737b7ab978def41faa1106e3a6959 /lib
parent7c8e9ab406b26437f1a0c9036bad892ea61ac6bd (diff)
downloadspack-06cc799fd33cf38a3f6acf14d99a7c3c955cab09.tar.gz
spack-06cc799fd33cf38a3f6acf14d99a7c3c955cab09.tar.bz2
spack-06cc799fd33cf38a3f6acf14d99a7c3c955cab09.tar.xz
spack-06cc799fd33cf38a3f6acf14d99a7c3c955cab09.zip
commands: remove unused `spack list --format=rst` (#11651)
- We use `spack list --foramt=html` now, as it is much faster and doesn't make the docs build take forever. - Remove `spack list --format=rst` as it is no longer used.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/cmd/list.py72
-rw-r--r--lib/spack/spack/test/cmd/list.py7
2 files changed, 0 insertions, 79 deletions
diff --git a/lib/spack/spack/cmd/list.py b/lib/spack/spack/cmd/list.py
index bba1fc5ceb..9fe2809097 100644
--- a/lib/spack/spack/cmd/list.py
+++ b/lib/spack/spack/cmd/list.py
@@ -14,8 +14,6 @@ import re
import sys
import math
-from six import StringIO
-
import llnl.util.tty as tty
from llnl.util.tty.colify import colify
@@ -107,14 +105,6 @@ def github_url(pkg):
return url.format(pkg.name)
-def rst_table(elts):
- """Print out a RST-style table."""
- cols = StringIO()
- ncol, widths = colify(elts, output=cols, tty=True)
- header = ' '.join('=' * (w - 1) for w in widths)
- return '%s\n%s%s' % (header, cols.getvalue(), header)
-
-
def rows_for_ncols(elts, ncols):
"""Print out rows in a table with ncols of elts laid out vertically."""
clen = int(math.ceil(len(elts) / ncols))
@@ -127,68 +117,6 @@ def rows_for_ncols(elts, ncols):
@formatter
-def rst(pkg_names, out):
- """Print out information on all packages in restructured text."""
-
- pkgs = [spack.repo.get(name) for name in pkg_names]
-
- out.write('.. _package-list:\n')
- out.write('\n')
- out.write('============\n')
- out.write('Package List\n')
- out.write('============\n')
- out.write('\n')
- out.write('This is a list of things you can install using Spack. It is\n')
- out.write(
- 'automatically generated based on the packages in the latest Spack\n')
- out.write('release.\n')
- out.write('\n')
- out.write('Spack currently has %d mainline packages:\n' % len(pkgs))
- out.write('\n')
- out.write(rst_table('`%s`_' % p for p in pkg_names))
- out.write('\n')
- out.write('\n')
-
- # Output some text for each package.
- for pkg in pkgs:
- out.write('-----\n')
- out.write('\n')
- out.write('.. _%s:\n' % pkg.name)
- out.write('\n')
- # Must be at least 2 long, breaks for single letter packages like R.
- out.write('-' * max(len(pkg.name), 2))
- out.write('\n')
- out.write(pkg.name)
- out.write('\n')
- out.write('-' * max(len(pkg.name), 2))
- out.write('\n\n')
- out.write('Homepage:\n')
- out.write(
- ' * `%s <%s>`__\n' % (cgi.escape(pkg.homepage), pkg.homepage))
- out.write('\n')
- out.write('Spack package:\n')
- out.write(' * `%s/package.py <%s>`__\n' % (pkg.name, github_url(pkg)))
- out.write('\n')
- if pkg.versions:
- out.write('Versions:\n')
- out.write(' ' + ', '.join(str(v) for v in
- reversed(sorted(pkg.versions))))
- out.write('\n\n')
-
- for deptype in spack.dependency.all_deptypes:
- deps = pkg.dependencies_of_type(deptype)
- if deps:
- out.write('%s Dependencies\n' % deptype.capitalize())
- out.write(' ' + ', '.join('%s_' % d if d in pkg_names
- else d for d in deps))
- out.write('\n\n')
-
- out.write('Description:\n')
- out.write(pkg.format_doc(indent=2))
- out.write('\n\n')
-
-
-@formatter
def html(pkg_names, out):
"""Print out information on all packages in Sphinx HTML.
diff --git a/lib/spack/spack/test/cmd/list.py b/lib/spack/spack/test/cmd/list.py
index 2becd2e148..3cd8207ba2 100644
--- a/lib/spack/spack/test/cmd/list.py
+++ b/lib/spack/spack/test/cmd/list.py
@@ -45,13 +45,6 @@ def test_list_format_name_only():
@pytest.mark.maybeslow
-def test_list_format_rst():
- output = list('--format', 'rst')
- assert '.. _cloverleaf3d:' in output
- assert '.. _hdf5:' in output
-
-
-@pytest.mark.maybeslow
def test_list_format_html():
output = list('--format', 'html')
assert '<div class="section" id="cloverleaf3d">' in output