From 7b5d8b135253392a85a1b7b91ba70578ef53fff1 Mon Sep 17 00:00:00 2001 From: bcumming Date: Tue, 17 Mar 2026 12:41:31 +0100 Subject: [PATCH 1/3] use pyproject for dependencies --- bin/stack-config | 1 + pyproject.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/bin/stack-config b/bin/stack-config index 66496991..02f48700 100755 --- a/bin/stack-config +++ b/bin/stack-config @@ -2,6 +2,7 @@ # /// script # requires-python = ">=3.12" # dependencies = [ +# "python-magic", # "jinja2", # "jsonschema", # "pyYAML", diff --git a/pyproject.toml b/pyproject.toml index 583f5d46..25fd1ddf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,6 +11,7 @@ license-files = ["LICENSE"] dynamic = ["version"] requires-python = ">=3.12" dependencies = [ + "python-magic", "Jinja2", "jsonschema", "PyYAML", From 42f9d8d682c808797cd73228a0b1e3b67a0f6b5a Mon Sep 17 00:00:00 2001 From: bcumming Date: Tue, 17 Mar 2026 12:43:53 +0100 Subject: [PATCH 2/3] add unit test and lint hints to readme --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 5c7e0408..265b0ac3 100644 --- a/README.md +++ b/README.md @@ -5,3 +5,17 @@ A tool for building a scientific software stack from a recipe for vClusters on C Read the [documentation](https://eth-cscs.github.io/stackinator/) to get started. Create a ticket in our [GitHub issues](https://github.com/eth-cscs/stackinator/issues) if you find a bug, have a feature request or have a question. + +## running tests: + +Use uv to run the tests, which will in turn ensure that the correct dependencies from `pyproject.toml` are used: + +``` +uv run pytest +``` + +Before pushing, apply the linting rules (this calls uv under the hood): + +``` +./lint +``` From fc2fef3015b7a54fa69fc60f651f38cc71843ffc Mon Sep 17 00:00:00 2001 From: bcumming Date: Tue, 17 Mar 2026 12:44:19 +0100 Subject: [PATCH 3/3] tweak presentation of build cache by recipe --- stackinator/builder.py | 2 +- stackinator/main.py | 2 +- stackinator/recipe.py | 14 ++++++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/stackinator/builder.py b/stackinator/builder.py index ca0f8753..47a73b05 100644 --- a/stackinator/builder.py +++ b/stackinator/builder.py @@ -233,7 +233,7 @@ def generate(self, recipe): spack_version=spack_version, spack_meta=spack_meta, gpg_keys=recipe.mirrors.keys, - cache=recipe.mirrors.buildcache, + cache=recipe.build_cache_mirror, exclude_from_cache=["nvhpc", "cuda", "perl"], verbose=False, ) diff --git a/stackinator/main.py b/stackinator/main.py index 0d0b9bd8..ec384561 100644 --- a/stackinator/main.py +++ b/stackinator/main.py @@ -86,7 +86,7 @@ def make_argparser(): "--build", required=True, type=str, - help="Where to set up the stackinator build directory. ('/tmp' is not allowed, use '/var/tmp'", + help="Where to set up the stackinator build directory. ('/tmp' is not allowed, use '/var/tmp')", ) parser.add_argument("--no-bwrap", action="store_true", required=False) parser.add_argument( diff --git a/stackinator/recipe.py b/stackinator/recipe.py index 76cba826..ff3d8e27 100644 --- a/stackinator/recipe.py +++ b/stackinator/recipe.py @@ -172,8 +172,7 @@ def __init__(self, args): # load the optional mirrors.yaml from system config, and add any additional # mirrors specified on the command line. self._logger.debug("Configuring mirrors.") - self.mirrors = mirror.Mirrors(self.system_config_path, args.cache) - self.cache = self.mirrors.build_cache_mirror + self.mirrors = mirror.Mirrors(self.system_config_path, pathlib.Path(args.cache)) # optional post install hook if self.post_install_hook is not None: @@ -202,6 +201,13 @@ def spack_repo(self): return repo_path return None + # Returns: + # Path: if the recipe specified a build cache mirror + # None: if no build cache mirror is used + @property + def build_cache_mirror(self): + return self.mirrors.build_cache_mirror + # Returns: # Path: of the recipe extra path if it exists # None: if there is no user-provided extra path in the recipe @@ -511,7 +517,7 @@ def compiler_files(self): ) makefile_template = env.get_template("Makefile.compilers") - push_to_cache = self.cache + push_to_cache = self.build_cache_mirror is not None files["makefile"] = makefile_template.render( compilers=self.compilers, push_to_cache=push_to_cache, @@ -542,7 +548,7 @@ def environment_files(self): jenv.filters["py2yaml"] = schema.py2yaml makefile_template = jenv.get_template("Makefile.environments") - push_to_cache = self.cache is not None + push_to_cache = self.build_cache_mirror is not None files["makefile"] = makefile_template.render( environments=self.environments, push_to_cache=push_to_cache,