From 15dcd3c65c6bbf36127c4cc4d0ed767c14d396b2 Mon Sep 17 00:00:00 2001 From: Christian Glusa Date: Sat, 11 Nov 2023 15:24:12 -0700 Subject: py-pynucleus: Add variant, modify dependencies (#41006) --- var/spack/repos/builtin/packages/py-pynucleus/package.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/var/spack/repos/builtin/packages/py-pynucleus/package.py b/var/spack/repos/builtin/packages/py-pynucleus/package.py index c4f2f82b7a..4194bb2c60 100644 --- a/var/spack/repos/builtin/packages/py-pynucleus/package.py +++ b/var/spack/repos/builtin/packages/py-pynucleus/package.py @@ -19,6 +19,9 @@ class PyPynucleus(PythonPackage): for ref in refs: version(ref, branch=ref) + variant("examples", default=True, description="Install examples") + variant("tests", default=True, description="Install tests") + depends_on("python@3.10:", type=("build", "run")) depends_on("py-mpi4py@2.0.0:", type=("build", "link", "run")) depends_on("py-cython@0.29.32:", type=("build", "run")) @@ -30,14 +33,14 @@ class PyPynucleus(PythonPackage): depends_on("py-h5py", type=("build", "run")) depends_on("py-tabulate", type=("build", "run")) depends_on("py-pyyaml", type=("build", "run")) - depends_on("py-matplotlib+latex", type=("build", "run")) + depends_on("py-matplotlib", type=("build", "run")) depends_on("py-scikit-sparse", type=("build", "run")) depends_on("py-modepy", type=("build", "run")) depends_on("py-meshpy", type=("build", "run")) depends_on("py-pytools", type=("build", "run")) depends_on("py-psutil", type="run") - - variant("examples", default=True, description="Install examples") + depends_on("py-pytest", when="+tests", type="run") + depends_on("py-pytest-html", when="+tests", type="run") import_modules = [ "PyNucleus", @@ -64,5 +67,9 @@ class PyPynucleus(PythonPackage): def install_additional_files(self): spec = self.spec prefix = self.prefix - if "+examples" in spec: + if "+examples" in spec or "+tests" in spec: install_tree("drivers", prefix.drivers) + if "+examples" in spec: + install_tree("examples", prefix.examples) + if "+tests" in spec: + install_tree("tests", prefix.tests) -- cgit v1.2.3-70-g09d2