spack/lib/spack
Massimiliano Culpo 7f2b5e8e57
spack.repo.get() can only be called on concrete specs (#31411)
The goal of this PR is to make clearer where we need a package object in Spack as opposed to a package class.

We currently instantiate a lot of package objects when we could make do with a class.  We should use the class
when we only need metadata, and we should only instantiate and us an instance of `PackageBase` at build time.

Modifications:
- [x] Remove the `spack.repo.get` convenience function (which was used in many places, and not really needed)
- [x] Use `spack.repo.path.get_pkg_class` wherever possible
- [x] Try to route most of the need for `spack.repo.path.get` through `Spec.package`
- [x] Introduce a non-data descriptor, that can be used as a decorator, to have "class level properties"
- [x] Refactor unit tests that had to be modified to reduce code duplication
- [x] `Spec.package` and `Repo.get` now require a concrete spec as input
- [x] Remove `RepoPath.all_packages` and `Repo.all_packages`
2022-07-12 19:45:24 -04:00
..
docs py-hatchling: add new packages, document new build backend (#31512) 2022-07-11 16:23:28 -07:00
env Revert "strip -Werror: all specific or none (#30284)" (#30878) 2022-05-26 14:17:01 -07:00
external archspec: bump to v0.1.4 (#30856) 2022-06-07 08:51:34 +00:00
llnl spack.repo.get() can only be called on concrete specs (#31411) 2022-07-12 19:45:24 -04:00
spack spack.repo.get() can only be called on concrete specs (#31411) 2022-07-12 19:45:24 -04:00