diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2021-04-28 01:55:07 +0200 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2021-05-22 11:51:21 -0700 |
commit | 13fed376f20f11221b83a806cc66e4ae82918c4d (patch) | |
tree | 4b8f898bd978ccf9dc0c66dfdacfb5c54c4436d6 /.flake8_packages | |
parent | fb27c7ad0c5542c10de98de6c825fbd0c7c8a88f (diff) | |
download | spack-13fed376f20f11221b83a806cc66e4ae82918c4d.tar.gz spack-13fed376f20f11221b83a806cc66e4ae82918c4d.tar.bz2 spack-13fed376f20f11221b83a806cc66e4ae82918c4d.tar.xz spack-13fed376f20f11221b83a806cc66e4ae82918c4d.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 '.flake8_packages')
0 files changed, 0 insertions, 0 deletions