diff --git a/pyproject.toml b/pyproject.toml index 1ce3fda2..315b4437 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,3 +8,7 @@ line-length = 120 [tool.isort] profile = "black" skip = ["external/"] + +[tool.ruff] +line-length = 120 +extend-exclude = ["external/", "unittests/recipes"] diff --git a/stackinator/recipe.py b/stackinator/recipe.py index 66293147..a7f90802 100644 --- a/stackinator/recipe.py +++ b/stackinator/recipe.py @@ -59,11 +59,11 @@ def __init__(self, args): if not self.mount.is_dir(): raise FileNotFoundError(f"the mount point '{self.mount}' must exist") - # required compiler.yaml file + # required compilers.yaml file compiler_path = self.path / "compilers.yaml" self._logger.debug(f"opening {compiler_path}") if not compiler_path.is_file(): - raise FileNotFoundError(f"The recipe path '{compiler_path}' does " f"not contain compilers.yaml") + raise FileNotFoundError(f"The recipe path '{compiler_path}' does not contain compilers.yaml") with compiler_path.open() as fid: raw = yaml.load(fid, Loader=yaml.Loader) @@ -74,7 +74,7 @@ def __init__(self, args): environments_path = self.path / "environments.yaml" self._logger.debug(f"opening {environments_path}") if not environments_path.is_file(): - raise FileNotFoundError(f"The recipe path '{environments_path}' does " f" not contain environments.yaml") + raise FileNotFoundError(f"The recipe path '{environments_path}' does not contain environments.yaml") with environments_path.open() as fid: raw = yaml.load(fid, Loader=yaml.Loader) @@ -102,7 +102,7 @@ def __init__(self, args): mirrors_path = self.path / "mirrors.yaml" if mirrors_path.is_file(): self._logger.warning( - "mirrors.yaml have been removed from recipes," " use the --cache option on stack-config instead." + "mirrors.yaml have been removed from recipes, use the --cache option on stack-config instead." ) raise RuntimeError("Unsupported mirrors.yaml file in recipe.") @@ -200,7 +200,7 @@ def config(self): def config(self, config_path): self._logger.debug(f"opening {config_path}") if not config_path.is_file(): - raise FileNotFoundError(f"The recipe path '{config_path}' does not contain compilers.yaml") + raise FileNotFoundError(f"The recipe path '{config_path}' does not contain config.yaml") with config_path.open() as fid: raw = yaml.load(fid, Loader=yaml.Loader) @@ -378,7 +378,7 @@ def generate_environment_specs(self, raw): environments[name]["view"] = None for i in range(numviews): # pick a name for the environment - cname = name if i == 0 else name + f"-{i+1}__" + cname = name if i == 0 else name + f"-{i + 1}__" if i > 0: environments[cname] = copy.deepcopy(base) @@ -402,7 +402,7 @@ def generate_environment_specs(self, raw): self.environments = environments # creates the self.compilers field that describes the full specifications - # for all of teh compilers from the raw compilers.yaml input + # for all of the compilers from the raw compilers.yaml input def generate_compiler_specs(self, raw): compilers = {} @@ -419,14 +419,6 @@ def generate_compiler_specs(self, raw): "texinfo", "gawk", ], - "variants": { - "gcc": "[build_type=Release ~bootstrap +strip]", - "mpc": "[libs=static]", - "gmp": "[libs=static]", - "mpfr": "[libs=static]", - "zstd": "[libs=static]", - "zlib": "[~shared]", - }, } bootstrap_spec = raw["bootstrap"]["spec"] bootstrap["specs"] = [ @@ -449,14 +441,6 @@ def generate_compiler_specs(self, raw): "texinfo", "gawk", ], - "variants": { - "gcc": "[build_type=Release +profiled +strip]", - "mpc": "[libs=static]", - "gmp": "[libs=static]", - "mpfr": "[libs=static]", - "zstd": "[libs=static]", - "zlib": "[~shared]", - }, } gcc["specs"] = raw["gcc"]["specs"] gcc["requires"] = bootstrap_spec diff --git a/stackinator/templates/Makefile.compilers b/stackinator/templates/Makefile.compilers index 631c110b..37432849 100644 --- a/stackinator/templates/Makefile.compilers +++ b/stackinator/templates/Makefile.compilers @@ -28,10 +28,6 @@ all:{% for compiler in compilers %} {{ compiler }}/generated/build_cache{% endfo {% endfor %} -# Configure the install location. -{% for compiler in compilers %}{{ compiler }}/config.yaml {% endfor %}: | store - $(SPACK) config --scope=user add config:install_tree:root:$(STORE) - # Configure the install location. {% for compiler in compilers %}{{ compiler }}/config.yaml {% endfor %}: | store $(SPACK) config --scope=user add config:install_tree:root:$(STORE) @@ -42,7 +38,6 @@ all:{% for compiler in compilers %} {{ compiler }}/generated/build_cache{% endfo {{ compiler }}/packages.yaml: $(SPACK) external find --scope=user {% for package in config.packages.external %} {{package}}{% endfor %} - {% endif %} {% endfor %} # Configure dependencies between compilers diff --git a/stackinator/templates/compilers.gcc.spack.yaml b/stackinator/templates/compilers.gcc.spack.yaml index cf186e45..44cf0828 100644 --- a/stackinator/templates/compilers.gcc.spack.yaml +++ b/stackinator/templates/compilers.gcc.spack.yaml @@ -13,7 +13,7 @@ spack: reuse: false packages: gcc: - variants: [build_type=Release +strip] + variants: [build_type=Release +bootstrap +strip] mpc: variants: [libs=static] gmp: