'Set PYTHONPATH to include the site-packages directory for the
extension and any other python extensions it depends on.'

def setup_dependent_environment(self, spack_env, run_env, dependent_spec):

    spack_env.set('PYTHONHOME', self.home)
    python_paths = []
    for d in dependent_spec.traverse(deptype=('build', 'run'), deptype_query='run'):
        if d.package.extends(self.spec):
            python_paths.append(join_path(d.prefix, self.site_packages_dir))
    pythonpath = ':'.join(python_paths)
    spack_env.set('PYTHONPATH', pythonpath)
    if dependent_spec.package.extends(self.spec):
        run_env.prepend_path('PYTHONPATH', join_path(dependent_spec.prefix, self.site_packages_dir))
