From 2b3ba850b31af879312bc1e7c8400c2725a5c038 Mon Sep 17 00:00:00 2001 From: Paul Hopkins Date: Mon, 18 Jul 2016 12:51:58 +0100 Subject: Fix spack package-list to correctly handle deptypes --- lib/spack/spack/cmd/package-list.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/cmd/package-list.py b/lib/spack/spack/cmd/package-list.py index bc64c77eab..ffb656c468 100644 --- a/lib/spack/spack/cmd/package-list.py +++ b/lib/spack/spack/cmd/package-list.py @@ -48,7 +48,8 @@ def rst_table(elts): def print_rst_package_list(): """Print out information on all packages in restructured text.""" - pkgs = sorted(spack.repo.all_packages(), key=lambda s:s.name.lower()) + pkgs = sorted(spack.repo.all_packages(), key=lambda s: s.name.lower()) + pkg_names = [p.name for p in pkgs] print ".. _package-list:" print @@ -62,7 +63,7 @@ def print_rst_package_list(): print "Spack currently has %d mainline packages:" % len(pkgs) print - print rst_table("`%s`_" % p.name for p in pkgs) + print rst_table("`%s`_" % p for p in pkg_names) print print "-----" @@ -79,14 +80,15 @@ def print_rst_package_list(): print if pkg.versions: print "Versions:" - print " " + ", ".join(str(v) for v in reversed(sorted(pkg.versions))) + print " " + ", ".join(str(v) for v in + reversed(sorted(pkg.versions))) - for deptype in ('build', 'link', 'run'): - deps = pkg.dependencies(deptype) + for deptype in spack.alldeps: + deps = pkg.dependencies_of_type(deptype) if deps: print "%s Dependencies" % deptype.capitalize() - print " " + ", ".join("`%s`_" % d if d != "mpi" else d - for d in build_deps) + print " " + ", ".join("%s_" % d if d in pkg_names + else d for d in deps) print print "Description:" -- cgit v1.2.3-70-g09d2 From cc027148ebdafbc58f3ad86b384c38534357062a Mon Sep 17 00:00:00 2001 From: Paul Hopkins Date: Mon, 18 Jul 2016 12:52:23 +0100 Subject: Flake8 fixes in cmd/package-list.py file --- lib/spack/spack/cmd/package-list.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/cmd/package-list.py b/lib/spack/spack/cmd/package-list.py index ffb656c468..2d25ebc63e 100644 --- a/lib/spack/spack/cmd/package-list.py +++ b/lib/spack/spack/cmd/package-list.py @@ -34,15 +34,15 @@ description = "Print a list of all packages in reStructuredText." def github_url(pkg): """Link to a package file on github.""" - return ("https://github.com/llnl/spack/blob/master/var/spack/packages/%s/package.py" % - pkg.name) + url = "https://github.com/llnl/spack/blob/master/var/spack/packages/%s/package.py" # NOQA: ignore=E501 + return (url % 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) + header = " ".join("=" * (w - 1) for w in widths) return "%s\n%s%s" % (header, cols.getvalue(), header) -- cgit v1.2.3-70-g09d2 From a46138dea94cdcddd91f83aaedb7388a0e53f7e4 Mon Sep 17 00:00:00 2001 From: Paul Hopkins Date: Mon, 18 Jul 2016 13:59:58 +0100 Subject: More flake8 fixes for package-list --- lib/spack/spack/cmd/package-list.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'lib') diff --git a/lib/spack/spack/cmd/package-list.py b/lib/spack/spack/cmd/package-list.py index 2d25ebc63e..a27502d30e 100644 --- a/lib/spack/spack/cmd/package-list.py +++ b/lib/spack/spack/cmd/package-list.py @@ -22,10 +22,8 @@ # License along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## -import re import cgi from StringIO import StringIO -import llnl.util.tty as tty from llnl.util.tty.colify import * import spack -- cgit v1.2.3-70-g09d2