Add package_dir method to package.py.

This commit is contained in:
Todd Gamblin 2016-06-24 12:33:53 -07:00
parent 65e3ac4132
commit 055f7f4ab6

View File

@ -397,6 +397,12 @@ def __init__(self, spec):
if self.is_extension: if self.is_extension:
spack.repo.get(self.extendee_spec)._check_extendable() 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 @property
def global_license_dir(self): def global_license_dir(self):
"""Returns the directory where global license files for all """Returns the directory where global license files for all