stacks: use new format string syntax in environments code
- Change old spec expressions to use Spack's new spec formatting sytnax.
This commit is contained in:
parent
2f6af64157
commit
9577ade3ce
@ -667,7 +667,7 @@ excludes those built with the PGI compiler at version 18.5.
|
|||||||
select: [^mpi]
|
select: [^mpi]
|
||||||
exclude: ['%pgi@18.5']
|
exclude: ['%pgi@18.5']
|
||||||
projections:
|
projections:
|
||||||
all: ${package}/${version}-${compilername}
|
all: {name}/{version}-{compiler.name}
|
||||||
|
|
||||||
For more information on using view projections, see the section on
|
For more information on using view projections, see the section on
|
||||||
:ref:`adding_projections_to_views`. The default for the ``select`` and
|
:ref:`adding_projections_to_views`. The default for the ``select`` and
|
||||||
|
@ -87,12 +87,12 @@ def get_job_name(spec, osarch):
|
|||||||
|
|
||||||
def get_spec_string(spec):
|
def get_spec_string(spec):
|
||||||
format_elements = [
|
format_elements = [
|
||||||
'${package}@${version}',
|
'{name}{@version}',
|
||||||
'%${compilername}@${compilerversion}',
|
'{%compiler}',
|
||||||
]
|
]
|
||||||
|
|
||||||
if spec.architecture:
|
if spec.architecture:
|
||||||
format_elements.append(' arch=${architecture}')
|
format_elements.append(' {arch=architecture}')
|
||||||
|
|
||||||
return spec.format(''.join(format_elements))
|
return spec.format(''.join(format_elements))
|
||||||
|
|
||||||
|
@ -397,7 +397,7 @@ def _eval_conditional(string):
|
|||||||
architecture.platform(), 'default_os', 'default_target')
|
architecture.platform(), 'default_os', 'default_target')
|
||||||
valid_variables = {
|
valid_variables = {
|
||||||
'target': str(arch.target),
|
'target': str(arch.target),
|
||||||
'os': str(arch.platform_os),
|
'os': str(arch.os),
|
||||||
'platform': str(arch.platform),
|
'platform': str(arch.platform),
|
||||||
'arch': str(arch),
|
'arch': str(arch),
|
||||||
'architecture': str(arch),
|
'architecture': str(arch),
|
||||||
@ -1204,6 +1204,7 @@ def write(self):
|
|||||||
else:
|
else:
|
||||||
view = False
|
view = False
|
||||||
|
|
||||||
|
yaml_dict = config_dict(self.yaml)
|
||||||
if view is not True:
|
if view is not True:
|
||||||
# The default case is to keep an active view inside of the
|
# The default case is to keep an active view inside of the
|
||||||
# Spack environment directory. To avoid cluttering the config,
|
# Spack environment directory. To avoid cluttering the config,
|
||||||
|
@ -1116,7 +1116,7 @@ def test_stack_combinatorial_view(tmpdir, mock_fetch, mock_packages,
|
|||||||
combinatorial:
|
combinatorial:
|
||||||
root: %s
|
root: %s
|
||||||
projections:
|
projections:
|
||||||
'all': '${package}/${version}-${compilername}'""" % viewdir)
|
'all': '{name}/{version}-{compiler.name}'""" % viewdir)
|
||||||
with tmpdir.as_cwd():
|
with tmpdir.as_cwd():
|
||||||
env('create', 'test', './spack.yaml')
|
env('create', 'test', './spack.yaml')
|
||||||
with ev.read('test'):
|
with ev.read('test'):
|
||||||
@ -1149,7 +1149,7 @@ def test_stack_view_select(tmpdir, mock_fetch, mock_packages,
|
|||||||
root: %s
|
root: %s
|
||||||
select: ['%%gcc']
|
select: ['%%gcc']
|
||||||
projections:
|
projections:
|
||||||
'all': '${package}/${version}-${compilername}'""" % viewdir)
|
'all': '{name}/{version}-{compiler.name}'""" % viewdir)
|
||||||
with tmpdir.as_cwd():
|
with tmpdir.as_cwd():
|
||||||
env('create', 'test', './spack.yaml')
|
env('create', 'test', './spack.yaml')
|
||||||
with ev.read('test'):
|
with ev.read('test'):
|
||||||
@ -1187,7 +1187,7 @@ def test_stack_view_exclude(tmpdir, mock_fetch, mock_packages,
|
|||||||
root: %s
|
root: %s
|
||||||
exclude: [callpath]
|
exclude: [callpath]
|
||||||
projections:
|
projections:
|
||||||
'all': '${package}/${version}-${compilername}'""" % viewdir)
|
'all': '{name}/{version}-{compiler.name}'""" % viewdir)
|
||||||
with tmpdir.as_cwd():
|
with tmpdir.as_cwd():
|
||||||
env('create', 'test', './spack.yaml')
|
env('create', 'test', './spack.yaml')
|
||||||
with ev.read('test'):
|
with ev.read('test'):
|
||||||
@ -1226,7 +1226,7 @@ def test_stack_view_select_and_exclude(tmpdir, mock_fetch, mock_packages,
|
|||||||
select: ['%%gcc']
|
select: ['%%gcc']
|
||||||
exclude: [callpath]
|
exclude: [callpath]
|
||||||
projections:
|
projections:
|
||||||
'all': '${package}/${version}-${compilername}'""" % viewdir)
|
'all': '{name}/{version}-{compiler.name}'""" % viewdir)
|
||||||
with tmpdir.as_cwd():
|
with tmpdir.as_cwd():
|
||||||
env('create', 'test', './spack.yaml')
|
env('create', 'test', './spack.yaml')
|
||||||
with ev.read('test'):
|
with ev.read('test'):
|
||||||
@ -1330,8 +1330,8 @@ def test_stack_view_multiple_views(tmpdir, mock_fetch, mock_packages,
|
|||||||
root: %s
|
root: %s
|
||||||
exclude: [callpath %%gcc]
|
exclude: [callpath %%gcc]
|
||||||
projections:
|
projections:
|
||||||
'all': '${package}/${version}-${compilername}'""" % (default_viewdir,
|
'all': '{name}/{version}-{compiler.name}'""" % (default_viewdir,
|
||||||
combin_viewdir))
|
combin_viewdir))
|
||||||
with tmpdir.as_cwd():
|
with tmpdir.as_cwd():
|
||||||
env('create', 'test', './spack.yaml')
|
env('create', 'test', './spack.yaml')
|
||||||
with ev.read('test'):
|
with ev.read('test'):
|
||||||
|
Loading…
Reference in New Issue
Block a user