From 3b22b340b8e02ed7247fdd14f613069d54d1ceb8 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Thu, 22 Aug 2024 00:35:15 -0600 Subject: [PATCH] Redefine variants in neptune-env virtual package (#1265) This PR defines three variants in the neptune-env virtual package: espc, python, xnrl. In the unified environment and in the skylab environment, the variants espc and xnrl are off, the python variant is on. This is so that py-fortranformat is available in those environments (required by pyiri-jedi). In the neptune standalone environment, all three variants are on. Note that the xnrl variant requires the python variant. --- .../spack-stack/packages/neptune-env/package.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/spack-ext/repos/spack-stack/packages/neptune-env/package.py b/spack-ext/repos/spack-stack/packages/neptune-env/package.py index 1d902454e..917ea8865 100644 --- a/spack-ext/repos/spack-stack/packages/neptune-env/package.py +++ b/spack-ext/repos/spack-stack/packages/neptune-env/package.py @@ -19,7 +19,9 @@ class NeptuneEnv(BundlePackage): version("1.4.0") - variant("python", default=True, description="Build Python libraries") + variant("python", default=True, description="Build Python dependencies") + variant("espc", default=True, description="Build ESPC dependencies") + variant("xnrl", default=True, description="Build XNRL and its extra Python dependencies") depends_on("base-env", type="run") @@ -37,9 +39,11 @@ class NeptuneEnv(BundlePackage): depends_on("nco", type="run") depends_on("mct", type="run") - # Required by ESPC - depends_on("fftw", type="build") - depends_on("netlib-lapack", type="build") + conflicts("+xnrl", when="~python", msg="Variant xnrl requires variant python") + + with when("+espc"): + depends_on("fftw", type="build") + depends_on("netlib-lapack", type="build") with when("+python"): depends_on("py-f90nml", type="run") @@ -53,8 +57,10 @@ class NeptuneEnv(BundlePackage): depends_on("py-pyyaml", type="run") depends_on("py-scipy", type="run") depends_on("py-xarray", type="run") - depends_on("py-xnrl", type="run") depends_on("py-pytest", type="run") depends_on("py-fortranformat", type="run") + with when("+xnrl"): + depends_on("py-xnrl", type="run") + # There is no need for install() since there is no code.