summaryrefslogtreecommitdiff
path: root/lib/spack/spack/hooks/__init__.py
AgeCommit message (Collapse)AuthorFilesLines
2021-07-08imports: sort imports everywhere in Spack (#24695)Todd Gamblin1-0/+1
* fix remaining flake8 errors * imports: sort imports everywhere in Spack We enabled import order checking in #23947, but fixing things manually drives people crazy. This used `spack style --fix --all` from #24071 to automatically sort everything in Spack so PR submitters won't have to deal with it. This should go in after #24071, as it assumes we're using `isort`, not `flake8-import-order` to order things. `isort` seems to be more flexible and allows `llnl` mports to be in their own group before `spack` ones, so this seems like a good switch.
2021-05-28Separable module configuration -- without the bugs this time (#23703)Greg Becker1-0/+4
Currently, module configurations are inconsistent because modulefiles are generated with the configs for the active environment, but are shared among all environments (and spack outside any environment). This PR fixes that by allowing Spack environments (or other spack config scopes) to define additional sets of modules to generate. Each set of modules can enable either lmod or tcl modules, and contains all of the previously available module configuration. The user defines the name of each module set -- the set configured in Spack by default is named "default", and is the one returned by module manipulation commands in the absence of user intervention. As part of this change, the module roots configuration moved from the config section to inside each module configuration. Additionally, it adds a feature that the modulefiles for an environment can be configured to be relative to an environment view rather than the underlying prefix. This will not be enabled by default, as it should only be enabled within an environment and for non-default views constructed with separate projections per-spec.
2021-05-17Revert "Separable module configurations (#22588)" (#23674)Harmen Stoppels1-4/+0
This reverts commit cefbe48c89209dc3df654795644973b1885cdea4.
2021-05-14Separable module configurations (#22588)Greg Becker1-0/+4
Currently, module configurations are inconsistent because modulefiles are generated with the configs for the active environment, but are shared among all environments (and spack outside any environment). This PR fixes that by allowing Spack environments (or other spack config scopes) to define additional sets of modules to generate. Each set of modules can enable either lmod or tcl modules, and contains all of the previously available module configuration. The user defines the name of each module set -- the set configured in Spack by default is named "default", and is the one returned by module manipulation commands in the absence of user intervention. As part of this change, the module roots configuration moved from the `config` section to inside each module configuration. Additionally, it adds a feature that the modulefiles for an environment can be configured to be relative to an environment view rather than the underlying prefix. This will not be enabled by default, as it should only be enabled within an environment and for non-default views constructed with separate projections per-spec. TODO: - [x] code changes to support multiple module sets - [x] code changes to support modules relative to a view - [x] Tests for multiple module configurations - [x] Tests for modules relative to a view - [x] Backwards compatibility for module roots from config section - [x] Backwards compatibility for default module set without the name specified - [x] Tests for backwards compatibility
2021-04-27Import hooks using Python's built-in machinery (#23288)Massimiliano Culpo1-52/+66
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-15Merge pull request #21930 from vsoch/add/spack-monitorVanessasaurus1-0/+13
This provides initial support for [spack monitor](https://github.com/spack/spack-monitor), a web application that stores information and analysis about Spack installations. Spack can now contact a monitor server and upload analysis -- even after a build is already done. Specifically, this adds: - [x] monitor options for `spack install` - [x] `spack analyze` command - [x] hook architecture for analyzers - [x] separate build logs (in addition to the existing combined log) - [x] docs for spack analyze - [x] reworked developer docs, with hook docs - [x] analyzers for: - [x] config args - [x] environment variables - [x] installed files - [x] libabigail There is a lot more information in the docs contained in this PR, so consult those for full details on this feature. Additional tests will be added in a future PR.
2021-01-02copyrights: update all files with license headers for 2021Todd Gamblin1-1/+1
- [x] add `concretize.lp`, `spack.yaml`, etc. to licensed files - [x] update all licensed files to say 2013-2021 using `spack license update-copyright-year` - [x] appease mypy with some additions to package.py that needed for oneapi.py
2019-12-31hooks: remove pre_run hook to improve startup time.Todd Gamblin1-6/+0
- Remove legacy yaml_version_check() hook - Remove the pre_run hook from `hook/__init__.py` and `main.py` We want to discourage the use of pre-run hooks because they have to run at startup. To keep Spack fast, we should do things like this lazily instead of in hooks that require spidering directories full of modules.
2019-12-30copyright: update copyright dates for 2020 (#14328)Todd Gamblin1-1/+1
2019-10-15Feature: installed file verification (#12841)Greg Becker1-1/+7
This feature generates a verification manifest for each installed package and provides a command, "spack verify", which can be used to compare the current file checksums/permissions with those calculated at installed time. Verification includes * Checksums of files * File permissions * Modification time * File size Packages installed before this PR will be skipped during verification. To verify such a package you must reinstall it. The spack verify command has three modes. * With the -a,--all option it will check every installed package. * With the -f,--files option, it will check some specific files, determine which package they belong to, and confirm that they have not been changed. * With the -s,--specs option or by default, it will check some specific packages that no files havae changed.
2019-10-02Remove support for generating dotkit files (#11986)Massimiliano Culpo1-1/+1
Dotkit is being used only at a few sites and has been deprecated on new machines. This commit removes all the code that provide support for the generation of dotkit module files. A new validator named "deprecatedProperties" has been added to the jsonschema validators. It permits to prompt a warning message or exit with an error if a property that has been marked as deprecated is encountered. * Removed references to dotkit in the docs * Removed references to dotkit in setup-env-test.sh * Added a unit test for the 'deprecatedProperties' schema validator
2019-01-01copyright: update license headers for 2013-2019 copyright.Todd Gamblin1-1/+1
2018-10-17relicense: replace LGPL headers with Apache-2.0/MIT SPDX headersTodd Gamblin1-23/+4
- remove the old LGPL license headers from all files in Spack - add SPDX headers to all files - core and most packages are (Apache-2.0 OR MIT) - a very small number of remaining packages are LGPL-2.1-only
2018-08-16imports: spack uses importlib instead of imp when availableTodd Gamblin1-2/+2
- `imp` is deprecated and seems to have started having some weird issues on certain Linux versions. - In particular, the file argument to `load_source` is ignored on arch linux with Python 3.7. - `imp` is the only way to do imports in 2.6, so we'll keep it around for now and use it if importlib won't work. - `importlib` is the new import system, and it allows us to get lower-level access to the import implementation. - This consolidates all import logic into `spack.util.imp`, and make it use `importlib` if it's avialable.
2018-05-17use os.path.join instead of join_path in coreTodd Gamblin1-2/+2
- Spack core has long used llnl.util.filesystem.join_path, but os.path.join is pretty much the same thing, and is more efficient. - Use os.path.join in the core Spack code from now on.
2018-05-17init: factor paths out of spack/__init__.py and into spack.paths moduleTodd Gamblin1-3/+3
2018-03-24Update copyright on LLNL files for 2018. (#7592)Todd Gamblin1-1/+1
2017-11-04Replace github.com/llnl/spack with github.com/spack/spack (#6142)Todd Gamblin1-1/+1
We moved to a new GitHub org! Now make the code and docs reflect that.
2017-09-06Update copyright notices for 2017 (#5295)Michael Kuhn1-1/+1
2017-06-24Make LICENSE recognizable by GitHub. (#4598)Todd Gamblin1-1/+1
2017-04-25hooks take spec as an argument (instead of pkg) (#3967)Massimiliano Culpo1-4/+5
2016-12-13Add a test to ensure package names have the right case. (#2562)Todd Gamblin1-2/+5
2016-09-20lmod : added support for the creation of hierarchical lua module files (#1723)Massimiliano Culpo1-7/+7
Includes : - treatment of a generic hierarchy (i.e. lapack + mpi + compiler) - possibility to specify which compilers are to be considered Core - correct treatment of the 'family' directive - unit tests for most new features
2016-08-10Make Spack core PEP8 compliant.Todd Gamblin1-0/+2
2016-05-11Correct LLNL LGPL license template for clarity.Todd Gamblin1-8/+8
2015-12-09Change github.com/scalability-llnl to github.com/llnl everywhere.Todd Gamblin1-1/+1
2015-02-02Add pre-install and pre-uninstall hooks.Todd Gamblin1-1/+6
2014-12-18Fix for SPACK-49.Todd Gamblin1-1/+4
- name conflict in imp.load_source caused this to fail. - Python modules loaded by imp have unique names now.
2014-07-08Adding dotkit support to TAU.Todd Gamblin1-0/+71
- New spack.hooks package - contains modules with pre and post install hooks - New dotkit hook module - generates/removes dotkits on install/uninstall - New spack use, spack unuse commands - use same syntax as install/uninstall - New setup-env.bash script - Sets up path, dotkit support - new spack dotkit command - used by script to parse specs, generate specs of installed pckages for dotkit file names