summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2018-02-16 16:59:29 -0800
committerTodd Gamblin <tgamblin@llnl.gov>2019-06-05 06:11:18 -0700
commit3f5141d629c18ac47562480ef57df42c98297a1a (patch)
treed46ab965522f94f9e4878c58da4eebf8bd748040 /lib
parent4ac64e6cd88bc0216c6c77e0d50d56287300f7da (diff)
downloadspack-3f5141d629c18ac47562480ef57df42c98297a1a.tar.gz
spack-3f5141d629c18ac47562480ef57df42c98297a1a.tar.bz2
spack-3f5141d629c18ac47562480ef57df42c98297a1a.tar.xz
spack-3f5141d629c18ac47562480ef57df42c98297a1a.zip
refactor: make PackageBase.possible_dependencies() a class method.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/package.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/spack/spack/package.py b/lib/spack/spack/package.py
index 4af53e00d0..d20a6d8e88 100644
--- a/lib/spack/spack/package.py
+++ b/lib/spack/spack/package.py
@@ -525,9 +525,10 @@ class PackageBase(with_metaclass(PackageMeta, PackageViewMixin, object)):
return self._installed_upstream
+ @classmethod
def possible_dependencies(
- self, transitive=True, expand_virtuals=True, visited=None):
- """Return set of possible dependencies of this package.
+ cls, transitive=True, expand_virtuals=True, visited=None):
+ """Return set of possible transitive dependencies of this package.
Note: the set returned *includes* the package itself.
@@ -539,9 +540,9 @@ class PackageBase(with_metaclass(PackageMeta, PackageViewMixin, object)):
visited (set): set of names of dependencies visited so far.
"""
if visited is None:
- visited = set([self.name])
+ visited = set([cls.name])
- for i, name in enumerate(self.dependencies):
+ for i, name in enumerate(cls.dependencies):
if spack.repo.path.is_virtual(name):
if expand_virtuals:
providers = spack.repo.path.providers_for(name)