Add package_dir method to package.py
.
This commit is contained in:
parent
65e3ac4132
commit
055f7f4ab6
@ -397,6 +397,12 @@ def __init__(self, spec):
|
||||
if self.is_extension:
|
||||
spack.repo.get(self.extendee_spec)._check_extendable()
|
||||
|
||||
@property
|
||||
def package_dir(self):
|
||||
"""Return the directory where the package.py file lives."""
|
||||
return os.path.dirname(self.module.__file__)
|
||||
|
||||
|
||||
@property
|
||||
def global_license_dir(self):
|
||||
"""Returns the directory where global license files for all
|
||||
@ -687,7 +693,7 @@ def compiler(self):
|
||||
"""Get the spack.compiler.Compiler object used to build this package"""
|
||||
if not self.spec.concrete:
|
||||
raise ValueError("Can only get a compiler for a concrete package.")
|
||||
return spack.compilers.compiler_for_spec(self.spec.compiler,
|
||||
return spack.compilers.compiler_for_spec(self.spec.compiler,
|
||||
self.spec.architecture)
|
||||
|
||||
def url_version(self, version):
|
||||
|
Loading…
Reference in New Issue
Block a user