From 9577ade3cea4afc6d99af3a54010ddf63101a375 Mon Sep 17 00:00:00 2001 From: Gregory Becker Date: Thu, 18 Apr 2019 09:54:17 -0700 Subject: stacks: use new format string syntax in environments code - Change old spec expressions to use Spack's new spec formatting sytnax. --- lib/spack/docs/environments.rst | 2 +- lib/spack/spack/cmd/release_jobs.py | 6 +++--- lib/spack/spack/environment.py | 3 ++- lib/spack/spack/test/cmd/env.py | 12 ++++++------ 4 files changed, 12 insertions(+), 11 deletions(-) (limited to 'lib') 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'): -- cgit v1.2.3-60-g2f50