diff options
author | Harmen Stoppels <harmenstoppels@gmail.com> | 2021-08-20 04:01:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-19 19:01:37 -0700 |
commit | 220a87812c0af395cb9e455d5aba8e0f6306715b (patch) | |
tree | 3f50814409a20ff07a34450def2f95d5c35c0e0d /etc | |
parent | 10695f1ed36bdaf6f813b261698e6a02b99d1f1c (diff) | |
download | spack-220a87812c0af395cb9e455d5aba8e0f6306715b.tar.gz spack-220a87812c0af395cb9e455d5aba8e0f6306715b.tar.bz2 spack-220a87812c0af395cb9e455d5aba8e0f6306715b.tar.xz spack-220a87812c0af395cb9e455d5aba8e0f6306715b.zip |
New `spack.environment.active_environment` api, and make spack.environment not depend on spack.cmd. (#25439)
* Refactor active environment getters
- Make `spack.environment.active_environment` a trivial getter for the active
environment, replacing `spack.environment.get_env` when the arguments are
not needed
- New method `spack.cmd.require_active_environment(cmd_name)` for
commands that require an environment (rather than abusing
get_env/active_environment)
- Clean up calling code to call spack.environment.active_environment or
spack.cmd.require_active_environment as appropriate
- Remove the `-e` parsing from `active_environment`, because `main.py` is
responsible for processing `-e` and already activates the environment.
- Move `spack.environment.find_environment` to
`spack.cmd.find_environment`, to avoid having spack.environment aware
of argparse.
- Refactor `spack install` command so argument parsing is all handled in the
command, no argparse in spack.environment or spack.installer
- Update documentation
* Python 2: toplevel import errors only with 'as ev'
In two files, `import spack.environment as ev` leads to errors
These errors are not well understood ("'module' object has no attribute
'environment'"). All other files standardize on the above syntax.
Diffstat (limited to 'etc')
0 files changed, 0 insertions, 0 deletions