Skip to content

Commit 603a53d

Browse files
authored
Merge pull request #251 from altheaden/organize-templates
Move all spack templates to their own subdirectory
2 parents 7be81b8 + a3f0667 commit 603a53d

File tree

86 files changed

+21
-11
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+21
-11
lines changed

MANIFEST.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
include mache/cime_machine_config/*.xml
22
include mache/machines/*.cfg
3-
include mache/spack/*.yaml
4-
include mache/spack/*.template
5-
include mache/spack/*.sh
6-
include mache/spack/*.csh
3+
include mache/spack/templates/*.yaml
4+
include mache/spack/templates/*.template
5+
include mache/spack/templates/*.sh
6+
include mache/spack/templates/*.csh

docs/developers_guide/api.md

Lines changed: 1 addition & 1 deletion

mache/spack/__init__.py

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@ def make_spack_env(
120120

121121
for shell_filename in [f'{machine}.sh', f'{machine}_{compiler}_{mpi}.sh']:
122122
# load modules, etc. for this machine
123-
path = importlib_resources.files('mache.spack') / shell_filename
123+
path = (
124+
importlib_resources.files('mache.spack.templates') / shell_filename
125+
)
124126
try:
125127
with open(str(path)) as fp:
126128
template = Template(fp.read())
@@ -135,7 +137,8 @@ def make_spack_env(
135137
modules = f'{modules}\n{bash_script}'
136138

137139
path = (
138-
importlib_resources.files('mache.spack') / 'build_spack_env.template'
140+
importlib_resources.files('mache.spack.templates')
141+
/ 'build_spack_env.template'
139142
)
140143
with open(str(path)) as fp:
141144
template = Template(fp.read())
@@ -270,7 +273,9 @@ def get_spack_script(
270273
f'{machine}_{compiler}_{mpi}.{shell}',
271274
]:
272275
# load modules, etc. for this machine
273-
path = importlib_resources.files('mache.spack') / shell_filename
276+
path = (
277+
importlib_resources.files('mache.spack.templates') / shell_filename
278+
)
274279
try:
275280
with open(str(path)) as fp:
276281
template = Template(fp.read())
@@ -385,7 +390,9 @@ def get_modules_env_vars_and_mpi_compilers(
385390
f'{machine}.{shell}',
386391
f'{machine}_{compiler}_{mpi}.{shell}',
387392
]:
388-
path = importlib_resources.files('mache.spack') / shell_filename
393+
path = (
394+
importlib_resources.files('mache.spack.templates') / shell_filename
395+
)
389396
try:
390397
with open(str(path)) as fp:
391398
template = Template(fp.read())
@@ -417,7 +424,10 @@ def _get_yaml_data(
417424
"""Get the data from the jinja-templated yaml file based on settings"""
418425
if yaml_template is None:
419426
template_filename = f'{machine}_{compiler}_{mpi}.yaml'
420-
path = importlib_resources.files('mache.spack') / template_filename
427+
path = (
428+
importlib_resources.files('mache.spack.templates')
429+
/ template_filename
430+
)
421431
try:
422432
with open(str(path)) as fp:
423433
template = Template(fp.read())

mache/spack/templates/__init__.py

Whitespace-only changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)