diff options
author | Gregory Becker <becker33@llnl.gov> | 2019-04-18 09:54:17 -0700 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2019-07-18 19:28:50 -0700 |
commit | 9577ade3cea4afc6d99af3a54010ddf63101a375 (patch) | |
tree | 1a7f857c9d50f2f0af718bd8f6ea2b12c4ca69a8 /lib | |
parent | 2f6af64157f30aa93fcdefa3867203b6d46960b5 (diff) | |
download | spack-9577ade3cea4afc6d99af3a54010ddf63101a375.tar.gz spack-9577ade3cea4afc6d99af3a54010ddf63101a375.tar.bz2 spack-9577ade3cea4afc6d99af3a54010ddf63101a375.tar.xz spack-9577ade3cea4afc6d99af3a54010ddf63101a375.zip |
stacks: use new format string syntax in environments code
- Change old spec expressions to use Spack's new spec formatting sytnax.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/docs/environments.rst | 2 | ||||
-rw-r--r-- | lib/spack/spack/cmd/release_jobs.py | 6 | ||||
-rw-r--r-- | lib/spack/spack/environment.py | 3 | ||||
-rw-r--r-- | lib/spack/spack/test/cmd/env.py | 12 |
4 files changed, 12 insertions, 11 deletions
diff --git a/lib/spack/docs/environments.rst b/lib/spack/docs/environments.rst index aa925de07c..f4c174cd0c 100644 --- a/lib/spack/docs/environments.rst +++ b/lib/spack/docs/environments.rst @@ -667,7 +667,7 @@ excludes those built with the PGI compiler at version 18.5. select: [^mpi] exclude: ['%pgi@18.5'] projections: - all: ${package}/${version}-${compilername} + all: {name}/{version}-{compiler.name} For more information on using view projections, see the section on :ref:`adding_projections_to_views`. The default for the ``select`` and diff --git a/lib/spack/spack/cmd/release_jobs.py b/lib/spack/spack/cmd/release_jobs.py index 78baf81263..fd79acd573 100644 --- a/lib/spack/spack/cmd/release_jobs.py +++ b/lib/spack/spack/cmd/release_jobs.py @@ -87,12 +87,12 @@ def get_job_name(spec, osarch): def get_spec_string(spec): format_elements = [ - '${package}@${version}', - '%${compilername}@${compilerversion}', + '{name}{@version}', + '{%compiler}', ] if spec.architecture: - format_elements.append(' arch=${architecture}') + format_elements.append(' {arch=architecture}') return spec.format(''.join(format_elements)) diff --git a/lib/spack/spack/environment.py b/lib/spack/spack/environment.py index 6320477100..ebb0d30da1 100644 --- a/lib/spack/spack/environment.py +++ b/lib/spack/spack/environment.py @@ -397,7 +397,7 @@ def _eval_conditional(string): architecture.platform(), 'default_os', 'default_target') valid_variables = { 'target': str(arch.target), - 'os': str(arch.platform_os), + 'os': str(arch.os), 'platform': str(arch.platform), 'arch': str(arch), 'architecture': str(arch), @@ -1204,6 +1204,7 @@ class Environment(object): else: view = False + yaml_dict = config_dict(self.yaml) if view is not True: # The default case is to keep an active view inside of the # Spack environment directory. To avoid cluttering the config, diff --git a/lib/spack/spack/test/cmd/env.py b/lib/spack/spack/test/cmd/env.py index fef017bf74..de492c3bec 100644 --- a/lib/spack/spack/test/cmd/env.py +++ b/lib/spack/spack/test/cmd/env.py @@ -1116,7 +1116,7 @@ env: combinatorial: root: %s projections: - 'all': '${package}/${version}-${compilername}'""" % viewdir) + 'all': '{name}/{version}-{compiler.name}'""" % viewdir) with tmpdir.as_cwd(): env('create', 'test', './spack.yaml') with ev.read('test'): @@ -1149,7 +1149,7 @@ env: root: %s select: ['%%gcc'] projections: - 'all': '${package}/${version}-${compilername}'""" % viewdir) + 'all': '{name}/{version}-{compiler.name}'""" % viewdir) with tmpdir.as_cwd(): env('create', 'test', './spack.yaml') with ev.read('test'): @@ -1187,7 +1187,7 @@ env: root: %s exclude: [callpath] projections: - 'all': '${package}/${version}-${compilername}'""" % viewdir) + 'all': '{name}/{version}-{compiler.name}'""" % viewdir) with tmpdir.as_cwd(): env('create', 'test', './spack.yaml') with ev.read('test'): @@ -1226,7 +1226,7 @@ env: select: ['%%gcc'] exclude: [callpath] projections: - 'all': '${package}/${version}-${compilername}'""" % viewdir) + 'all': '{name}/{version}-{compiler.name}'""" % viewdir) with tmpdir.as_cwd(): env('create', 'test', './spack.yaml') with ev.read('test'): @@ -1330,8 +1330,8 @@ env: root: %s exclude: [callpath %%gcc] projections: - 'all': '${package}/${version}-${compilername}'""" % (default_viewdir, - combin_viewdir)) + 'all': '{name}/{version}-{compiler.name}'""" % (default_viewdir, + combin_viewdir)) with tmpdir.as_cwd(): env('create', 'test', './spack.yaml') with ev.read('test'): |