spack/lib/spack
Massimiliano Culpo 985e101507
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
2021-04-27 16:55:07 -07:00
..
docs docs: be more precise on what spack add ... does (#23204) 2021-04-23 13:29:19 +00:00
env bugfix: compiler wrappers should handle extra spaces between arguments (#22725) 2021-04-01 18:39:06 +00:00
external Docs: Updated copyrights in files still using 2020 as ending year (#23215) 2021-04-22 22:23:09 -07:00
llnl Use gethostname() instead of getfqdn() for lock debug mode 2021-04-15 00:01:41 -07:00
spack Import hooks using Python's built-in machinery (#23288) 2021-04-27 16:55:07 -07:00