diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2021-04-28 01:55:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-27 16:55:07 -0700 |
commit | 985e101507560c52aa060cdb8d5ef838fbe9cea7 (patch) | |
tree | 6e9d74ed5a65a29083d4d5c7994254a0896ac262 /bin/sbang | |
parent | 24c87e07b5b50099bd2b6fc4ad74e1f27aaa1732 (diff) | |
download | spack-985e101507560c52aa060cdb8d5ef838fbe9cea7.tar.gz spack-985e101507560c52aa060cdb8d5ef838fbe9cea7.tar.bz2 spack-985e101507560c52aa060cdb8d5ef838fbe9cea7.tar.xz spack-985e101507560c52aa060cdb8d5ef838fbe9cea7.zip |
Import hooks using Python's built-in machinery (#23288)
The function we coded in Spack to load Python modules with arbitrary
names from a file seem to have issues with local imports. For
loading hooks though it is unnecessary to use such functions, since
we don't care to bind a custom name to a module nor we have to load
it from an unknown location.
This PR thus modifies spack.hook in the following ways:
- Use __import__ instead of spack.util.imp.load_source (this
addresses #20005)
- Sync module docstring with all the hooks we have
- Avoid using memoization in a module function
- Marked with a leading underscore all the names that are supposed
to stay local
Diffstat (limited to 'bin/sbang')
0 files changed, 0 insertions, 0 deletions