summaryrefslogtreecommitdiff
path: root/lib/spack/llnl
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2019-12-29 00:12:14 -0800
committerTodd Gamblin <tgamblin@llnl.gov>2019-12-30 13:01:31 -0800
commit8e8235043d6f4605f338761233178404840baae5 (patch)
tree48f3fc1772a7ef6b89bcc58690713f44bb747494 /lib/spack/llnl
parent0699f8ac9d4d599fa7709cdb694467918a612e49 (diff)
downloadspack-8e8235043d6f4605f338761233178404840baae5.tar.gz
spack-8e8235043d6f4605f338761233178404840baae5.tar.bz2
spack-8e8235043d6f4605f338761233178404840baae5.tar.xz
spack-8e8235043d6f4605f338761233178404840baae5.zip
package_prefs: move class-level cache to PackagePref instance
`PackagePrefs` has had a class-level cache of data from `packages.yaml` for a long time, but it complicates testing and leads to subtle errors, especially now that we frequently manipulate custom config scopes and environments. Moving the cache to instance-level doesn't slow down concretization or the test suite, and it just caches for the life of a `PackagePrefs` instance (i.e., for a single cocncretization) so we don't need to worry about global state anymore. - [x] Remove class-level caches from `PackagePrefs` - [x] Add a cached _spec_order object on each `PackagePrefs` instance - [x] Remove all calls to `PackagePrefs.clear_caches()`
Diffstat (limited to 'lib/spack/llnl')
-rw-r--r--lib/spack/llnl/util/lang.py6
1 files changed, 0 insertions, 6 deletions
diff --git a/lib/spack/llnl/util/lang.py b/lib/spack/llnl/util/lang.py
index bdb551dcad..2fbef0fd46 100644
--- a/lib/spack/llnl/util/lang.py
+++ b/lib/spack/llnl/util/lang.py
@@ -19,12 +19,6 @@ import sys
ignore_modules = [r'^\.#', '~$']
-class classproperty(property):
- """classproperty decorator: like property but for classmethods."""
- def __get__(self, cls, owner):
- return self.fget.__get__(None, owner)()
-
-
def index_by(objects, *funcs):
"""Create a hierarchy of dictionaries by splitting the supplied
set of objects on unique values of the supplied functions.