spack/lib/spack/llnl/util
Harmen Stoppels 220a87812c
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.
2021-08-19 19:01:37 -07:00
..
tty installation: filter padding from all tty output 2021-08-09 01:42:07 -07:00
__init__.py copyrights: update all files with license headers for 2021 2021-01-02 12:12:00 -08:00
argparsewriter.py API Docs: fix broken reference targets 2021-07-16 08:30:56 -07:00
filesystem.py doc: def llnl.util.filesystem.find fix rst (#25350) 2021-08-11 09:14:04 +02:00
lang.py New spack.environment.active_environment api, and make spack.environment not depend on spack.cmd. (#25439) 2021-08-19 19:01:37 -07:00
link_tree.py imports: sort imports everywhere in Spack (#24695) 2021-07-08 22:12:30 +00:00
lock.py API Docs: fix broken reference targets 2021-07-16 08:30:56 -07:00
multiproc.py copyrights: update all files with license headers for 2021 2021-01-02 12:12:00 -08:00