directives_meta.py: use startswith to test module part of spack.pkg (#47270)
This commit is contained in:
parent
25a5585f7d
commit
f81ca0cd89
@ -10,6 +10,7 @@
|
|||||||
import llnl.util.lang
|
import llnl.util.lang
|
||||||
|
|
||||||
import spack.error
|
import spack.error
|
||||||
|
import spack.repo
|
||||||
import spack.spec
|
import spack.spec
|
||||||
|
|
||||||
#: Names of possible directives. This list is mostly populated using the @directive decorator.
|
#: Names of possible directives. This list is mostly populated using the @directive decorator.
|
||||||
@ -63,7 +64,7 @@ def __init__(cls, name, bases, attr_dict):
|
|||||||
# The instance is being initialized: if it is a package we must ensure
|
# The instance is being initialized: if it is a package we must ensure
|
||||||
# that the directives are called to set it up.
|
# that the directives are called to set it up.
|
||||||
|
|
||||||
if "spack.pkg" in cls.__module__:
|
if cls.__module__.startswith(spack.repo.ROOT_PYTHON_NAMESPACE):
|
||||||
# Ensure the presence of the dictionaries associated with the directives.
|
# Ensure the presence of the dictionaries associated with the directives.
|
||||||
# All dictionaries are defaultdicts that create lists for missing keys.
|
# All dictionaries are defaultdicts that create lists for missing keys.
|
||||||
for d in DirectiveMeta._directive_dict_names:
|
for d in DirectiveMeta._directive_dict_names:
|
||||||
|
Loading…
Reference in New Issue
Block a user