gaudi: consistent test dependencies when +examples (#32134)

* gaudi: consistent test dependencies when +examples

Gaudi requires testing to be enabled for examples to be built, so all
test dependencies are also there for `+examples`. This PR fixes a
missing pytest dependency when `+examples` is used but no testing is
enabled. The construct with the loop is to ensure the identical
dependencies are always used, even as version ranges my start to differ.

Testing with gaudi_add_tests was added in v35r0. Some nosetests and
QMtests were in the tree before, but not accessible it seems. The
effective dependency since 35.0 is also applied for pytest, extending
the range that was there before disentangling `optional`, at
9d67d1e034/var/spack/repos/builtin/packages/gaudi/package.py

* gaudi: version 36.7 in other PR...
This commit is contained in:
Wouter Deconinck 2022-08-22 16:24:36 -05:00 committed by GitHub
parent afecd70bc8
commit c92db8a22a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -73,7 +73,6 @@ class Gaudi(CMakePackage):
depends_on("python@:2", when="@:32.1", type=("build", "run"))
depends_on("py-networkx@:2.2", when="^python@:2.7")
depends_on("py-networkx", when="^python@3.0.0:")
depends_on("py-nose", type="test")
depends_on("py-setuptools@:45", when="^python@:2.7", type="build")
depends_on("py-six", type=("build", "run"))
depends_on("py-xenv@1:", when="@:34.9", type=("build", "run"))
@ -81,6 +80,16 @@ class Gaudi(CMakePackage):
depends_on("root +python +root7 +ssl +tbb +threads")
depends_on("zlib")
# Testing dependencies
# Note: gaudi only builds examples when testing enabled
for pv in (
["py-nose", "@35:"],
["py-pytest", "@36.2:"],
["py-qmtest", "@35:"],
):
depends_on(pv[0], when=pv[1], type="test")
depends_on(pv[0], when=pv[1] + " +examples")
# Adding these dependencies triggers the build of most optional components
depends_on("cppgsl", when="+cppunit")
depends_on("cppunit", when="+cppunit")
@ -103,6 +112,7 @@ class Gaudi(CMakePackage):
def cmake_args(self):
args = [
# Note: gaudi only builds examples when testing enabled
self.define("BUILD_TESTING", self.run_tests or self.spec.satisfies("+examples")),
self.define_from_variant("GAUDI_USE_AIDA", "aida"),
self.define_from_variant("GAUDI_USE_CPPUNIT", "cppunit"),