spack/share/spack/qa
Massimiliano Culpo ff04d1bfc1
Use the non-deprecated MetaPathFinder interface (#29745)
* Extract the MetaPathFinder and Loaders for packages in their own classes

https://peps.python.org/pep-0451/

Currently, RepoPath and Repo implement the (deprecated) interface of
MetaPathFinder (find_module) and of Loader (load_module). This commit
extracts both of them and places the code in their own classes.

The MetaPathFinder interface is updated to contain both the deprecated
"find_module" (for Python 2.7 support) and the recommended "find_spec".
Update of the Loader interface is deferred at a subsequent commit.

* Move the lines to be prepended inside "RepoLoader"

Also adjust the naming of a few variables too

* Remove spack.util.imp, since code is only used in spack.repo

* Remove support from loading Python modules Python > 3 but < 3.5

* Remove `Repo._create_namespace`

This function was interacting badly with the MetaPathFinder
and causing issues with "normal" imports. Removing the
function allows to do things like:
```python
import spack.pkg.builtin.mpich
cls = spack.pkg.builtin.mpich.Mpich
```

* Remove code needed to trigger the Singleton evaluation

The finder is coded in a way to trigger the Singleton,
so we don't need external code now that we register it
at module level into `sys.meta_path`.

* Add unit tests
2022-04-07 15:58:20 -07:00
..
configuration Add Github Actions for Windows (#24504) 2022-03-17 09:01:01 -07:00
bashcov Use kcov from official Ubuntu 20.04 repository (#25385) 2021-08-19 14:03:10 -07:00
completion-test.sh Update copyright year to 2022 2022-01-14 22:50:21 -08:00
flake8_formatter.py imports: sort imports everywhere in Spack (#24695) 2021-07-08 22:12:30 +00:00
run-build-tests Update copyright year to 2022 2022-01-14 22:50:21 -08:00
run-shell-tests Update copyright year to 2022 2022-01-14 22:50:21 -08:00
run-style-tests Update copyright year to 2022 2022-01-14 22:50:21 -08:00
run-unit-tests Use the non-deprecated MetaPathFinder interface (#29745) 2022-04-07 15:58:20 -07:00
setup_spack.ps1 Add Github Actions for Windows (#24504) 2022-03-17 09:01:01 -07:00
setup-env-test.csh Update copyright year to 2022 2022-01-14 22:50:21 -08:00
setup-env-test.fish Update copyright year to 2022 2022-01-14 22:50:21 -08:00
setup-env-test.sh Add a new test to catch exit code failure (#29244) 2022-02-28 12:55:24 -08:00
setup.sh Update copyright year to 2022 2022-01-14 22:50:21 -08:00
test-env-cfg.sh Update copyright year to 2022 2022-01-14 22:50:21 -08:00
test-framework.sh Update copyright year to 2022 2022-01-14 22:50:21 -08:00
vcvarsall.ps1 Add Github Actions for Windows (#24504) 2022-03-17 09:01:01 -07:00
windows_test_setup.ps1 Windows Support: Testing Suite integration 2022-03-17 09:01:01 -07:00