From 6cd20748e844eea36684e7b2394746287881d39c Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Tue, 7 Oct 2025 13:17:11 -0600 Subject: [PATCH 01/40] Current progress (see full commit message for details) - NWX_MODULE_DIRECTORY is set correctly for all NWChemExBasePybindings-based packages - ParallelZone and PluginPlay bindings appear to be working - TensorWrapper and above are in-progress - The value of NWX_MODULE_DIRECTORY needs to be generalized to any Python version. It currently only works for Python 3.13. --- spack_repo/nwchemex/common/mixins/nwchemex.py | 41 +++++++++++-------- .../packages/nwchemex_chemcache/package.py | 3 +- .../core/packages/nwchemex_chemist/package.py | 4 +- .../packages/nwchemex_pluginplay/package.py | 2 +- .../core/packages/nwchemex_simde/package.py | 4 +- .../nwchemex_tensorwrapper/package.py | 11 ++++- 6 files changed, 39 insertions(+), 26 deletions(-) diff --git a/spack_repo/nwchemex/common/mixins/nwchemex.py b/spack_repo/nwchemex/common/mixins/nwchemex.py index f9f41ea..dbc71ac 100644 --- a/spack_repo/nwchemex/common/mixins/nwchemex.py +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -74,6 +74,12 @@ def cmake_args(self): args.append(self.define("CMAKE_POLICY_DEFAULT_CMP0152", "NEW")) # DEBUG REMOVE ME + args.append( + self.define( + "FETCHCONTENT_SOURCE_DIR_NWX_CMAKE", + "/home/zachcran/workspaces/nwchemex/repos_dev/nwxcmake", + ) + ) args.append( self.define( "CMAKE_VERBOSE_MAKEFILE", @@ -87,13 +93,17 @@ def cmake_args(self): class NWChemExBasePybindings(NWChemExBaseCXX): pkg.variant( - "pybindings", + "python", default=False, - description="Build the Python bindings with Pybind11", + description="Build the Python bindings", sticky=True, ) - pkg.depends_on("py-pybind11", when="+pybindings") + # https://spack.readthedocs.io/en/latest/build_systems/pythonpackage.html#extends-vs-depends-on + pkg.extends("python", when="+python") + # TODO: decouple from python 3.13 + pkg.depends_on("python@3.13", when="+python") + pkg.depends_on("py-pybind11", when="+python") def cmake_args(self): args = super().cmake_args() @@ -101,25 +111,20 @@ def cmake_args(self): args.extend( [ self.define_from_variant( - "BUILD_PYBIND11_PYBINDINGS", "pybindings" + "BUILD_PYBIND11_PYBINDINGS", "python" ), - self.define_from_variant("PYBIND11_FINDPYTHON", "pybindings"), + self.define_from_variant("PYBIND11_FINDPYTHON", "python"), ] ) - if self.spec.satisfies("+pybindings"): - if "NWX_MODULE_DIRECTORY" in os.environ: - args.append( - self.define( - "NWX_MODULE_DIRECTORY", - os.environ["NWX_MODULE_DIRECTORY"], - ) + if self.spec.satisfies("+python"): + args.append( + self.define( + "NWX_MODULE_DIRECTORY", + # lib64 is used for platlib from Python package + # TODO: Decouple this from Python 3.13 + self.prefix.lib64.join("python3.13").join("site-packages"), ) - # TODO: Allow the user to configure this? - # args.append( - # "-DNWX_MODULE_DIRECTORY={}".format( - # self.prefix.lib.join(self.project.lower()).join("python") - # ) - # ) + ) return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py b/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py index c366f5c..d59a36b 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py @@ -21,7 +21,6 @@ # ---------------------------------------------------------------------------- from spack import package as pkg - from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings @@ -48,7 +47,7 @@ class NwchemexChemcache(NWChemExBasePybindings): pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran") pkg.license("Apache-2.0", checked_by="zachcran") - pkg.version("generated_data", branch="generated_data") + pkg.version("generated_data", branch="generated_data", preferred=True) # Versions from git tags pkg.version( diff --git a/spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py b/spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py index e6e3bb5..67d4f50 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py @@ -63,8 +63,8 @@ class NwchemexChemist(NWChemExBasePybindings): # First-party pkg.depends_on("nwchemex-utilities") - pkg.depends_on("nwchemex-parallelzone") - pkg.depends_on("nwchemex-tensorwrapper") + pkg.depends_on("nwchemex-parallelzone", type=("build", "link", "run")) + pkg.depends_on("nwchemex-tensorwrapper", type=("build", "link", "run")) # Although we have a variant, technically it is not a direct dependency # of this package diff --git a/spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py b/spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py index f8c5006..cbd52d4 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py @@ -63,7 +63,7 @@ class NwchemexPluginplay(NWChemExBasePybindings): pkg.depends_on("rocksdb", when="+rocksdb") # First-party pkg.depends_on("nwchemex-utilities") - pkg.depends_on("nwchemex-parallelzone") + pkg.depends_on("nwchemex-parallelzone", type=("build", "link", "run")) # Start with CMaize sanity check locations sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( diff --git a/spack_repo/nwchemex/core/packages/nwchemex_simde/package.py b/spack_repo/nwchemex/core/packages/nwchemex_simde/package.py index 809253b..ae3303a 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_simde/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_simde/package.py @@ -59,8 +59,8 @@ class NwchemexSimde(NWChemExBasePybindings): ) # First-party - pkg.depends_on("nwchemex-chemist") - pkg.depends_on("nwchemex-pluginplay") + pkg.depends_on("nwchemex-chemist", type=("build", "link", "run")) + pkg.depends_on("nwchemex-pluginplay", type=("build", "link", "run")) pkg.depends_on("sigma+eigen", when="+sigma") diff --git a/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py b/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py index 43c8bd4..642c819 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py @@ -64,7 +64,16 @@ class NwchemexTensorwrapper(NWChemExBasePybindings): # First-party pkg.depends_on("nwchemex-utilities") - pkg.depends_on("nwchemex-parallelzone") + pkg.depends_on( + "nwchemex-parallelzone~python", + type=("build", "link", "run"), + when="~python", + ) + pkg.depends_on( + "nwchemex-parallelzone+python", + type=("build", "link", "run"), + when="+python", + ) pkg.depends_on("sigma+eigen", when="+sigma") From df0cc8820fb92d9ad28ba2794d73d0f41c31c09e Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Tue, 7 Oct 2025 13:42:37 -0600 Subject: [PATCH 02/40] Add depends_on() 'when' kwarg to pluginplay --- .../core/packages/nwchemex_pluginplay/package.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py b/spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py index cbd52d4..2fcd7ff 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py @@ -21,6 +21,7 @@ # ---------------------------------------------------------------------------- from spack import package as pkg + from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings @@ -63,7 +64,16 @@ class NwchemexPluginplay(NWChemExBasePybindings): pkg.depends_on("rocksdb", when="+rocksdb") # First-party pkg.depends_on("nwchemex-utilities") - pkg.depends_on("nwchemex-parallelzone", type=("build", "link", "run")) + pkg.depends_on( + "nwchemex-parallelzone+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-parallelzone~python", + type=("build", "link", "run"), + when="~python", + ) # Start with CMaize sanity check locations sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( From 40f4bff9315afcbb6ecae2e7d4c1bca7dc0505d5 Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Mon, 13 Oct 2025 12:45:03 -0600 Subject: [PATCH 03/40] Add dependency on numpy for the build tests to pass --- .../nwchemex/core/packages/nwchemex_tensorwrapper/package.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py b/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py index 642c819..67f4118 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py @@ -74,6 +74,11 @@ class NwchemexTensorwrapper(NWChemExBasePybindings): type=("build", "link", "run"), when="+python", ) + pkg.depends_on( + "py-numpy", + type=("build", "link", "run"), + when="+python", + ) pkg.depends_on("sigma+eigen", when="+sigma") From 7111ceafd4a2e7fcd45f6e51dded1e1fea225c3d Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Mon, 13 Oct 2025 12:46:38 -0600 Subject: [PATCH 04/40] prefix.lib64 does not properly get loaded in the PYTHONPATH --- spack_repo/nwchemex/common/mixins/nwchemex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spack_repo/nwchemex/common/mixins/nwchemex.py b/spack_repo/nwchemex/common/mixins/nwchemex.py index dbc71ac..d2de7b2 100644 --- a/spack_repo/nwchemex/common/mixins/nwchemex.py +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -123,7 +123,7 @@ def cmake_args(self): "NWX_MODULE_DIRECTORY", # lib64 is used for platlib from Python package # TODO: Decouple this from Python 3.13 - self.prefix.lib64.join("python3.13").join("site-packages"), + self.prefix.lib.join("python3.13").join("site-packages"), ) ) From b233a11207b0d9071207edf32efe6b22b6d5547d Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Tue, 21 Oct 2025 14:06:44 -0500 Subject: [PATCH 05/40] python conditional depends_on statements; decouple python version --- spack_repo/nwchemex/common/mixins/nwchemex.py | 8 +-- .../packages/nwchemex_chemcache/package.py | 11 +++- .../core/packages/nwchemex_chemist/package.py | 23 +++++++- .../packages/nwchemex_friendzone/package.py | 11 +++- .../packages/nwchemex_integrals/package.py | 11 +++- .../core/packages/nwchemex_nux/package.py | 11 +++- .../packages/nwchemex_nwchemex/package.py | 55 +++++++++++++++++-- .../core/packages/nwchemex_scf/package.py | 11 +++- .../core/packages/nwchemex_simde/package.py | 22 +++++++- 9 files changed, 145 insertions(+), 18 deletions(-) diff --git a/spack_repo/nwchemex/common/mixins/nwchemex.py b/spack_repo/nwchemex/common/mixins/nwchemex.py index d2de7b2..6f96ce4 100644 --- a/spack_repo/nwchemex/common/mixins/nwchemex.py +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -101,8 +101,7 @@ class NWChemExBasePybindings(NWChemExBaseCXX): # https://spack.readthedocs.io/en/latest/build_systems/pythonpackage.html#extends-vs-depends-on pkg.extends("python", when="+python") - # TODO: decouple from python 3.13 - pkg.depends_on("python@3.13", when="+python") + pkg.depends_on("python@3:", when="+python") pkg.depends_on("py-pybind11", when="+python") def cmake_args(self): @@ -122,8 +121,9 @@ def cmake_args(self): self.define( "NWX_MODULE_DIRECTORY", # lib64 is used for platlib from Python package - # TODO: Decouple this from Python 3.13 - self.prefix.lib.join("python3.13").join("site-packages"), + self.prefix.lib.join( + "python{}".format(self.spec["python"].version[:-1]) + ).join("site-packages"), ) ) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py b/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py index d59a36b..b2f09d7 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py @@ -72,7 +72,16 @@ class NwchemexChemcache(NWChemExBasePybindings): # Runtime dependencies # First-party - pkg.depends_on("nwchemex-simde") + pkg.depends_on( + "nwchemex-simde+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-simde~python", + type=("build", "link", "run"), + when="~python", + ) # Start with CMaize sanity check locations sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( diff --git a/spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py b/spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py index 67d4f50..b075f91 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py @@ -63,8 +63,27 @@ class NwchemexChemist(NWChemExBasePybindings): # First-party pkg.depends_on("nwchemex-utilities") - pkg.depends_on("nwchemex-parallelzone", type=("build", "link", "run")) - pkg.depends_on("nwchemex-tensorwrapper", type=("build", "link", "run")) + pkg.depends_on( + "nwchemex-parallelzone+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-parallelzone~python", + type=("build", "link", "run"), + when="~python", + ) + + pkg.depends_on( + "nwchemex-tensorwrapper+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-tensorwrapper~python", + type=("build", "link", "run"), + when="~python", + ) # Although we have a variant, technically it is not a direct dependency # of this package diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py index 1203f76..d840e79 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py @@ -70,7 +70,16 @@ class NwchemexFriendzone(NWChemExBasePybindings): pkg.depends_on("nwchem") # First-party - pkg.depends_on("nwchemex-simde") + pkg.depends_on( + "nwchemex-simde+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-simde~python", + type=("build", "link", "run"), + when="~python", + ) # Start with CMaize sanity check locations sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( diff --git a/spack_repo/nwchemex/core/packages/nwchemex_integrals/package.py b/spack_repo/nwchemex/core/packages/nwchemex_integrals/package.py index 295ce03..a2ca584 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_integrals/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_integrals/package.py @@ -67,7 +67,16 @@ class NwchemexIntegrals(NWChemExBasePybindings): # pkg.depends_on("sigma+eigen", when="+sigma") # First-party - pkg.depends_on("nwchemex-simde") + pkg.depends_on( + "nwchemex-simde+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-simde~python", + type=("build", "link", "run"), + when="~python", + ) # Start with CMaize sanity check locations sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( diff --git a/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py b/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py index bb85011..ef68e91 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py @@ -61,7 +61,16 @@ class NwchemexNux(NWChemExBasePybindings): # ) # First-party - pkg.depends_on("nwchemex-simde") + pkg.depends_on( + "nwchemex-simde+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-simde~python", + type=("build", "link", "run"), + when="~python", + ) # Start with CMaize sanity check locations sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( diff --git a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py index b4e2de4..ed364c2 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py @@ -80,11 +80,56 @@ class NwchemexNwchemex(NWChemExBasePybindings): # pkg.depends_on("exachem", when="+tamm") # First-party - pkg.depends_on("nwchemex-friendzone") - pkg.depends_on("nwchemex-scf") - pkg.depends_on("nwchemex-nux") - pkg.depends_on("nwchemex-chemcache") - pkg.depends_on("nwchemex-integrals") + pkg.depends_on( + "nwchemex-friendzone+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-friendzone~python", + type=("build", "link", "run"), + when="~python", + ) + pkg.depends_on( + "nwchemex-scf+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-scf~python", + type=("build", "link", "run"), + when="~python", + ) + pkg.depends_on( + "nwchemex-nux+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-nux~python", + type=("build", "link", "run"), + when="~python", + ) + pkg.depends_on( + "nwchemex-chemcache+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-chemcache~python", + type=("build", "link", "run"), + when="~python", + ) + pkg.depends_on( + "nwchemex-integrals+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-integrals~python", + type=("build", "link", "run"), + when="~python", + ) # Start with CMaize sanity check locations sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( diff --git a/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py b/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py index ce7b1b9..c59921b 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py @@ -90,7 +90,16 @@ class NwchemexScf(NWChemExBasePybindings): # pkg.depends_on("sigma+eigen", when="+sigma") # First-party - pkg.depends_on("nwchemex-simde") + pkg.depends_on( + "nwchemex-simde+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-simde~python", + type=("build", "link", "run"), + when="~python", + ) # Start with CMaize sanity check locations sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( diff --git a/spack_repo/nwchemex/core/packages/nwchemex_simde/package.py b/spack_repo/nwchemex/core/packages/nwchemex_simde/package.py index ae3303a..6abe88f 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_simde/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_simde/package.py @@ -59,8 +59,26 @@ class NwchemexSimde(NWChemExBasePybindings): ) # First-party - pkg.depends_on("nwchemex-chemist", type=("build", "link", "run")) - pkg.depends_on("nwchemex-pluginplay", type=("build", "link", "run")) + pkg.depends_on( + "nwchemex-chemist+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-chemist~python", + type=("build", "link", "run"), + when="~python", + ) + pkg.depends_on( + "nwchemex-pluginplay+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-pluginplay~python", + type=("build", "link", "run"), + when="~python", + ) pkg.depends_on("sigma+eigen", when="+sigma") From b443bcfa49d6f4b69d0727c025e9f4e1e9a296c1 Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Thu, 23 Oct 2025 10:42:42 -0600 Subject: [PATCH 06/40] Require pybind >= 3.0 --- spack_repo/nwchemex/common/mixins/nwchemex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spack_repo/nwchemex/common/mixins/nwchemex.py b/spack_repo/nwchemex/common/mixins/nwchemex.py index 6f96ce4..4a85e26 100644 --- a/spack_repo/nwchemex/common/mixins/nwchemex.py +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -102,7 +102,7 @@ class NWChemExBasePybindings(NWChemExBaseCXX): # https://spack.readthedocs.io/en/latest/build_systems/pythonpackage.html#extends-vs-depends-on pkg.extends("python", when="+python") pkg.depends_on("python@3:", when="+python") - pkg.depends_on("py-pybind11", when="+python") + pkg.depends_on("py-pybind11@3:", when="+python") def cmake_args(self): args = super().cmake_args() From 6c0aa1f107600595f98cf9174aa60984e067e993 Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Thu, 23 Oct 2025 12:23:33 -0500 Subject: [PATCH 07/40] various updates to packages --- spack_repo/nwchemex/common/mixins/nwchemex.py | 12 ++++++++++-- .../core/packages/nwchemex_chemcache/package.py | 2 +- .../core/packages/nwchemex_friendzone/package.py | 4 ++-- .../core/packages/nwchemex_nwchemex/package.py | 7 ------- .../nwchemex/core/packages/nwchemex_scf/package.py | 10 +--------- 5 files changed, 14 insertions(+), 21 deletions(-) diff --git a/spack_repo/nwchemex/common/mixins/nwchemex.py b/spack_repo/nwchemex/common/mixins/nwchemex.py index 4a85e26..7546096 100644 --- a/spack_repo/nwchemex/common/mixins/nwchemex.py +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -101,8 +101,16 @@ class NWChemExBasePybindings(NWChemExBaseCXX): # https://spack.readthedocs.io/en/latest/build_systems/pythonpackage.html#extends-vs-depends-on pkg.extends("python", when="+python") - pkg.depends_on("python@3:", when="+python") - pkg.depends_on("py-pybind11@3:", when="+python") + pkg.depends_on( + "py-pybind11@3:", + type=("build", "link", "run", "test"), + when="+python", + ) + pkg.depends_on( + "python@3:", + type=("build", "link", "run", "test"), + when="+python", + ) def cmake_args(self): args = super().cmake_args() diff --git a/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py b/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py index b2f09d7..5b3370e 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py @@ -69,7 +69,7 @@ class NwchemexChemcache(NWChemExBasePybindings): sticky=False, ) - # Runtime dependencies + pkg.depends_on("py-requests") # First-party pkg.depends_on( diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py index d840e79..c053fb0 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py @@ -66,8 +66,8 @@ class NwchemexFriendzone(NWChemExBasePybindings): sticky=False, ) - pkg.depends_on("py-ase") - pkg.depends_on("nwchem") + pkg.depends_on("py-ase", type=("build", "link", "run")) + pkg.depends_on("nwchem", type=("build", "link", "run")) # First-party pkg.depends_on( diff --git a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py index ed364c2..897dcfb 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py @@ -72,13 +72,6 @@ class NwchemexNwchemex(NWChemExBasePybindings): sticky=False, ) - # TODO: Create this package - # pkg.depends_on("gauxc") - pkg.depends_on("eigen") - pkg.depends_on("libint", when="+tamm") - # pkg.depends_on("tamm", when="+tamm") - # pkg.depends_on("exachem", when="+tamm") - # First-party pkg.depends_on( "nwchemex-friendzone+python", diff --git a/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py b/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py index c59921b..fdd1aba 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py @@ -63,12 +63,6 @@ class NwchemexScf(NWChemExBasePybindings): default=False, description="Build modules that rely on TAMM/Exachem", ) - pkg.variant( - "experimental", - default=False, - description="Enable experimental features", - sticky=False, - ) # For building GauXC, I think pkg.depends_on("c", type="build") @@ -82,6 +76,7 @@ class NwchemexScf(NWChemExBasePybindings): pkg.depends_on("libint@2.6:", when="+tamm") pkg.depends_on("mpi") pkg.depends_on("py-numpy") + pkg.depends_on("libxc") # pkg.depends_on("tamm", when="+tamm") # pkg.depends_on("exachem", when="+tamm") @@ -115,9 +110,6 @@ def cmake_args(self): args.extend( [ - self.define_from_variant( - "ENABLE_EXPERIMENTAL_FEATURES", "experimental" - ), self.define_from_variant("ENABLE_SIGMA", "sigma"), ] ) From 730cd196c14d0f4bafd1e8f887fc18882e56b44a Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Thu, 23 Oct 2025 15:07:39 -0500 Subject: [PATCH 08/40] add dependencies for FriendZone --- .../nwchemex/core/packages/nwchemex_friendzone/package.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py index c053fb0..645e423 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py @@ -66,6 +66,8 @@ class NwchemexFriendzone(NWChemExBasePybindings): sticky=False, ) + pkg.depends_on("py-pydantic", type=("build", "link", "run")) + pkg.depends_on("py-networkx", type=("build", "link", "run")) pkg.depends_on("py-ase", type=("build", "link", "run")) pkg.depends_on("nwchem", type=("build", "link", "run")) From 81317211704595ca9f1025f6a45862a793fa8ff9 Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Thu, 23 Oct 2025 15:07:57 -0500 Subject: [PATCH 09/40] remove reference to unused variant in NUX --- .../core/packages/nwchemex_nux/package.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py b/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py index ef68e91..dccc8e3 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py @@ -81,13 +81,13 @@ class NwchemexNux(NWChemExBasePybindings): ) # Append more sanity checks as needed - def cmake_args(self): - args = super().cmake_args() + # def cmake_args(self): + # args = super().cmake_args() - args.extend( - [ - self.define_from_variant("ENABLE_SIGMA", "sigma"), - ] - ) + # args.extend( + # [ + # self.define_from_variant("ENABLE_SIGMA", "sigma"), + # ] + # ) - return args + # return args From b39493a6e0a93a4456b61a0a5fa752d68b5e7902 Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Tue, 28 Oct 2025 11:41:00 -0500 Subject: [PATCH 10/40] molssi dependencies --- .../packages/nwchemex_friendzone/package.py | 1 + .../core/packages/py_qcelemental/package.py | 90 +++++++++++++++++++ .../core/packages/py_qcengine/package.py | 88 ++++++++++++++++++ 3 files changed, 179 insertions(+) create mode 100644 spack_repo/nwchemex/core/packages/py_qcelemental/package.py create mode 100644 spack_repo/nwchemex/core/packages/py_qcengine/package.py diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py index 645e423..c34b9af 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py @@ -68,6 +68,7 @@ class NwchemexFriendzone(NWChemExBasePybindings): pkg.depends_on("py-pydantic", type=("build", "link", "run")) pkg.depends_on("py-networkx", type=("build", "link", "run")) + pkg.depends_on("py-qcengine", type=("build", "link", "run")) pkg.depends_on("py-ase", type=("build", "link", "run")) pkg.depends_on("nwchem", type=("build", "link", "run")) diff --git a/spack_repo/nwchemex/core/packages/py_qcelemental/package.py b/spack_repo/nwchemex/core/packages/py_qcelemental/package.py new file mode 100644 index 0000000..00f2ee8 --- /dev/null +++ b/spack_repo/nwchemex/core/packages/py_qcelemental/package.py @@ -0,0 +1,90 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# ---------------------------------------------------------------------------- +# If you submit this package back to Spack as a pull request, +# please first remove this boilerplate and all FIXME comments. +# +# This is a template package file for Spack. We've put "FIXME" +# next to all the things you'll want to change. Once you've handled +# them, you can save this file and test your package like this: +# +# spack install py-qcelemental +# +# You can edit this file again by typing: +# +# spack edit py-qcelemental +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack_repo.builtin.build_systems.python import PythonPackage + +from spack import package as pkg + + +class PyQcelemental(PythonPackage): + """FIXME: Put a proper description of your package here.""" + + homepage = "https://github.com/MolSSI/QCElemental" + pypi = "qcelemental/qcelemental-0.29.0.tar.gz" + + pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran") + + pkg.license("BSD-3-Clause") + + pkg.version( + "0.29.0", + sha256="3571b9bc6c67faba8ea9d988948fd8efc593bf3b5d533486f84ee2e423d60c1e", + ) + pkg.version( + "0.28.0", + sha256="59f2104095b2d5bd78b02149c50c06fa884cde9fc2f49272edd0ec2e7f5fdd3d", + ) + pkg.version( + "0.27.1", + sha256="10686a022e7e85259d6ee1730c29cedff1b67c8a21d753b336fb4c42529922b1", + ) + pkg.version( + "0.27.0", + sha256="bf9ce6d6e134e905a5818c5907a3b8fa9fd8754eeb6b7519bd58c1a6a8177f1a", + ) + pkg.version( + "0.26.0", + sha256="fe198b92298c2a922b5e780757c055a522b31e46178851594185924df82bc00a", + ) + pkg.version( + "0.25.1", + sha256="87decd18ff6fffbbded4c77fe974c332a12573b9075247f461d57ec88301ac8b", + ) + pkg.version( + "0.25.0", + sha256="aad969fb10ac803a659f400a8ffd452f8bfa98409c092a136761dc99eb8374a8", + ) + pkg.version( + "0.24.0", + sha256="154367a7afa0a532325972caa16fd55b27c711fc4520a371eb9db56f4c2c62d1", + ) + pkg.version( + "0.23.0", + sha256="a6c9b77e66241b0862bcad8507aa94c40d5f54d299f46484363e3413caa93185", + ) + pkg.version( + "0.22.0", + sha256="e8d5e2cb00e5d8cd996157150e7270b304760c8a2bb569c68ad8ce279d5702d0", + ) + + pkg.depends_on("python@3.7:", type=("build", "run")) + + pkg.depends_on("py-poetry-core", type="build") + + pkg.depends_on("py-numpy@1.26:", type=("build", "run")) + pkg.depends_on("py-packaging@24.1:", type=("build", "run")) + pkg.depends_on("py-pint@0.24:", type=("build", "run")) + pkg.depends_on("py-pydantic@1.8.2:", type=("build", "run")) + pkg.depends_on("py-importlib-metadata@4.8:", type=("build", "run")) + pkg.depends_on("py-networkx", type=("build", "run")) + pkg.depends_on("py-scipy@1.9.0:", type=("build", "run")) + pkg.depends_on("py-setuptools@68.0.0:", type=("build", "run")) + pkg.depends_on("py-pytest@7.2.2:", type=("build", "run")) diff --git a/spack_repo/nwchemex/core/packages/py_qcengine/package.py b/spack_repo/nwchemex/core/packages/py_qcengine/package.py new file mode 100644 index 0000000..b57e1a5 --- /dev/null +++ b/spack_repo/nwchemex/core/packages/py_qcengine/package.py @@ -0,0 +1,88 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# ---------------------------------------------------------------------------- +# If you submit this package back to Spack as a pull request, +# please first remove this boilerplate and all FIXME comments. +# +# This is a template package file for Spack. We've put "FIXME" +# next to all the things you'll want to change. Once you've handled +# them, you can save this file and test your package like this: +# +# spack install py-qcengine +# +# You can edit this file again by typing: +# +# spack edit py-qcengine +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack_repo.builtin.build_systems.python import PythonPackage + +from spack import package as pkg + + +class PyQcengine(PythonPackage): + """QCEngine provides a wrapper to ingest and produce QCSchema for a variety + of quantum chemistry programs.""" + + homepage = "https://github.com/MolSSI/QCEngine" + pypi = "qcengine/qcengine-0.33.0.tar.gz" + + pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran") + + pkg.license("BSD-3-Clause") + + pkg.version( + "0.33.0", + sha256="1d83cda4d1b3214f5710f84ba8ad8586fb9b7949236ed6699f4b036bbd4c077b", + ) + pkg.version( + "0.32.0", + sha256="666ae2eeec6758904548ac72199964c2141a1fcd2f14fed5dbe8bc324e43e4ac", + ) + pkg.version( + "0.31.0", + sha256="1d220c32efa813191a95a5c6a7aa8035551e4126230b60dccea4af236eeff810", + ) + pkg.version( + "0.30.0", + sha256="896c690fa82a5f65b6d702775ac61606dc54050f8642f0c04b6497c5f9bdca62", + ) + pkg.version( + "0.29.0", + sha256="a790f733d9132675636216011286415872ce815e6a4e7f7029ccde8c90293bfc", + ) + pkg.version( + "0.28.1", + sha256="11555cfc475fe6d048da6335fc1e2150a6c5f8082a415c45fe596e4fc96588ee", + ) + pkg.version( + "0.28.0", + sha256="c4b27a7a2f06e02e0ddfabf9b9b95adcc4f92acdd9a55678ae603d79a8464e60", + ) + pkg.version( + "0.27.0", + sha256="d339976c880c79cfe2da7cdb8458895a97322ca2abd134734b0b15031f5e3eeb", + ) + pkg.version( + "0.26.0", + sha256="0659fc6e92d0b8bd2252e4d0290543fdbf6fd5361943b4a43d429fe3074ab2dc", + ) + pkg.version( + "0.25.0", + sha256="2b651ed588c606cb9a734d4cfe04f8dfdee5ce7ccc64885c38f1a4e7798dadea", + ) + + pkg.depends_on("python@3.7:", type=("build", "run")) + + pkg.depends_on("py-setuptools", type="build") + + pkg.depends_on("py-pyyaml", type=("build", "run")) + pkg.depends_on("py-py-cpuinfo", type=("build", "run")) + pkg.depends_on("py-psutil", type=("build", "run")) + pkg.depends_on("py-pydantic@1.8.2:", type=("build", "run")) + pkg.depends_on("py-packaging", type=("build", "run")) + pkg.depends_on("py-qcelemental", type=("build", "run")) From 4d1305f47e37d1d473b58aeba8e07e5c6d488a76 Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Tue, 28 Oct 2025 16:11:11 -0500 Subject: [PATCH 11/40] molssi patches --- .../core/packages/nwchemex_friendzone/package.py | 13 ++++++++----- .../core/packages/py_qcelemental/package.py | 6 ++++-- .../nwchemex/core/packages/py_qcengine/package.py | 4 +++- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py index c34b9af..5fbb81f 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py @@ -67,9 +67,9 @@ class NwchemexFriendzone(NWChemExBasePybindings): ) pkg.depends_on("py-pydantic", type=("build", "link", "run")) - pkg.depends_on("py-networkx", type=("build", "link", "run")) + pkg.depends_on("py-networkx~default", type=("build", "link", "run")) pkg.depends_on("py-qcengine", type=("build", "link", "run")) - pkg.depends_on("py-ase", type=("build", "link", "run")) + # pkg.depends_on("py-ase", type=("build", "link", "run")) pkg.depends_on("nwchem", type=("build", "link", "run")) # First-party @@ -97,9 +97,12 @@ def cmake_args(self): args = super().cmake_args() args.extend( - self.define_from_variant( - "ENABLE_EXPERIMENTAL_FEATURES", "experimental" - ), + [ + self.define_from_variant( + "ENABLE_EXPERIMENTAL_FEATURES", "experimental" + ), + self.define("ENABLE_ASE", "OFF"), + ] ) return args diff --git a/spack_repo/nwchemex/core/packages/py_qcelemental/package.py b/spack_repo/nwchemex/core/packages/py_qcelemental/package.py index 00f2ee8..963d564 100644 --- a/spack_repo/nwchemex/core/packages/py_qcelemental/package.py +++ b/spack_repo/nwchemex/core/packages/py_qcelemental/package.py @@ -28,7 +28,9 @@ class PyQcelemental(PythonPackage): """FIXME: Put a proper description of your package here.""" homepage = "https://github.com/MolSSI/QCElemental" - pypi = "qcelemental/qcelemental-0.29.0.tar.gz" + url = "https://github.com/MolSSI/QCElemental/archive/refs/tags/v0.29.0.tar.gz" + git = "https://github.com/MolSSI/QCElemental.git" + # pypi = "qcelemental/qcelemental-0.29.0.tar.gz" pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran") @@ -84,7 +86,7 @@ class PyQcelemental(PythonPackage): pkg.depends_on("py-pint@0.24:", type=("build", "run")) pkg.depends_on("py-pydantic@1.8.2:", type=("build", "run")) pkg.depends_on("py-importlib-metadata@4.8:", type=("build", "run")) - pkg.depends_on("py-networkx", type=("build", "run")) + pkg.depends_on("py-networkx~default", type=("build", "run")) pkg.depends_on("py-scipy@1.9.0:", type=("build", "run")) pkg.depends_on("py-setuptools@68.0.0:", type=("build", "run")) pkg.depends_on("py-pytest@7.2.2:", type=("build", "run")) diff --git a/spack_repo/nwchemex/core/packages/py_qcengine/package.py b/spack_repo/nwchemex/core/packages/py_qcengine/package.py index b57e1a5..8c5d3bd 100644 --- a/spack_repo/nwchemex/core/packages/py_qcengine/package.py +++ b/spack_repo/nwchemex/core/packages/py_qcengine/package.py @@ -29,7 +29,9 @@ class PyQcengine(PythonPackage): of quantum chemistry programs.""" homepage = "https://github.com/MolSSI/QCEngine" - pypi = "qcengine/qcengine-0.33.0.tar.gz" + url = "https://github.com/MolSSI/QCEngine/archive/refs/tags/v0.29.0.tar.gz" + git = "https://github.com/MolSSI/QCEngine.git" + # pypi = "qcengine/qcengine-0.33.0.tar.gz" pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran") From 0f14c5ce6b861704a4540afe80bcf66262a45cc9 Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Tue, 28 Oct 2025 17:45:51 -0500 Subject: [PATCH 12/40] FriendZone deps patch --- .../nwchemex/core/packages/nwchemex_friendzone/package.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py index 5fbb81f..7aedbba 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py @@ -66,8 +66,10 @@ class NwchemexFriendzone(NWChemExBasePybindings): sticky=False, ) + pkg.depends_on("py-pip", type=("build", "link")) pkg.depends_on("py-pydantic", type=("build", "link", "run")) pkg.depends_on("py-networkx~default", type=("build", "link", "run")) + pkg.depends_on("py-qcelemental", type=("build", "link", "run")) pkg.depends_on("py-qcengine", type=("build", "link", "run")) # pkg.depends_on("py-ase", type=("build", "link", "run")) pkg.depends_on("nwchem", type=("build", "link", "run")) From 055e8e38e312251c8acb37205435436f08c8ac6c Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Wed, 29 Oct 2025 12:44:03 -0500 Subject: [PATCH 13/40] FriendZone and NWX updates --- .../packages/nwchemex_friendzone/package.py | 34 ++++++++++++------- .../packages/nwchemex_nwchemex/package.py | 33 ++++++++---------- 2 files changed, 35 insertions(+), 32 deletions(-) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py index 7aedbba..4c48266 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py @@ -66,13 +66,21 @@ class NwchemexFriendzone(NWChemExBasePybindings): sticky=False, ) - pkg.depends_on("py-pip", type=("build", "link")) - pkg.depends_on("py-pydantic", type=("build", "link", "run")) - pkg.depends_on("py-networkx~default", type=("build", "link", "run")) - pkg.depends_on("py-qcelemental", type=("build", "link", "run")) - pkg.depends_on("py-qcengine", type=("build", "link", "run")) - # pkg.depends_on("py-ase", type=("build", "link", "run")) - pkg.depends_on("nwchem", type=("build", "link", "run")) + pkg.depends_on("py-pip", when="+python", type=("build", "link")) + pkg.depends_on( + "py-pydantic", when="+python", type=("build", "link", "run") + ) + pkg.depends_on( + "py-networkx~default", when="+python", type=("build", "link", "run") + ) + pkg.depends_on( + "py-qcelemental", when="+python", type=("build", "link", "run") + ) + pkg.depends_on( + "py-qcengine", when="+python", type=("build", "link", "run") + ) + # pkg.depends_on("py-ase", when="+python", type=("build", "link", "run")) + pkg.depends_on("nwchem", when="+python", type=("build", "link", "run")) # First-party pkg.depends_on( @@ -87,12 +95,12 @@ class NwchemexFriendzone(NWChemExBasePybindings): ) # Start with CMaize sanity check locations - sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( - project.lower() - ) - sanity_check_is_file = NWChemExBasePybindings.cmaize_sanity_check_files( - project.lower() - ) + # sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( + # project.lower() + # ) + # sanity_check_is_file = NWChemExBasePybindings.cmaize_sanity_check_files( + # project.lower() + # ) # Append more sanity checks as needed def cmake_args(self): diff --git a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py index 897dcfb..adcc9ba 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py @@ -78,11 +78,6 @@ class NwchemexNwchemex(NWChemExBasePybindings): type=("build", "link", "run"), when="+python", ) - pkg.depends_on( - "nwchemex-friendzone~python", - type=("build", "link", "run"), - when="~python", - ) pkg.depends_on( "nwchemex-scf+python", type=("build", "link", "run"), @@ -125,21 +120,21 @@ class NwchemexNwchemex(NWChemExBasePybindings): ) # Start with CMaize sanity check locations - sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( - project.lower() - ) - sanity_check_is_file = NWChemExBasePybindings.cmaize_sanity_check_files( - project.lower() - ) + # sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( + # project.lower() + # ) + # sanity_check_is_file = NWChemExBasePybindings.cmaize_sanity_check_files( + # project.lower() + # ) # Append more sanity checks as needed - def cmake_args(self): - args = super().cmake_args() + # def cmake_args(self): + # args = super().cmake_args() - args.extend( - self.define_from_variant( - "ENABLE_EXPERIMENTAL_FEATURES", "experimental" - ), - ) + # args.extend( + # self.define_from_variant( + # "ENABLE_EXPERIMENTAL_FEATURES", "experimental" + # ), + # ) - return args + # return args From 221f99780e9d4765eec46f18165c153abc9f0c37 Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Mon, 3 Nov 2025 11:06:11 -0700 Subject: [PATCH 14/40] Add base class for NWChemEx Python-only packages --- spack_repo/nwchemex/common/mixins/__init__.py | 13 +++++++++++-- spack_repo/nwchemex/common/mixins/nwchemex.py | 7 ++++++- .../core/packages/nwchemex_friendzone/package.py | 4 ++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/spack_repo/nwchemex/common/mixins/__init__.py b/spack_repo/nwchemex/common/mixins/__init__.py index 63c84d2..5d82e1a 100644 --- a/spack_repo/nwchemex/common/mixins/__init__.py +++ b/spack_repo/nwchemex/common/mixins/__init__.py @@ -1,4 +1,13 @@ from .cmaize import CMaizePackage -from .nwchemex import NWChemExBaseCXX, NWChemExBasePybindings +from .nwchemex import ( + NWChemExBaseCXX, + NWChemExBasePybindings, + NWChemExBasePython, +) -__all__ = ["CMaizePackage", "NWChemExBaseCXX", "NWChemExBasePybindings"] +__all__ = [ + "CMaizePackage", + "NWChemExBaseCXX", + "NWChemExBasePybindings", + "NWChemExBasePython", +] diff --git a/spack_repo/nwchemex/common/mixins/nwchemex.py b/spack_repo/nwchemex/common/mixins/nwchemex.py index 7546096..2e2f1e6 100644 --- a/spack_repo/nwchemex/common/mixins/nwchemex.py +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -2,6 +2,7 @@ from spack import package as pkg from spack.package_base import PackageBase +from spack_repo.builtin.build_systems.python import PythonPackage from .cmaize import CMaizePackage @@ -96,7 +97,7 @@ class NWChemExBasePybindings(NWChemExBaseCXX): "python", default=False, description="Build the Python bindings", - sticky=True, + # sticky=True, ) # https://spack.readthedocs.io/en/latest/build_systems/pythonpackage.html#extends-vs-depends-on @@ -136,3 +137,7 @@ def cmake_args(self): ) return args + + +class NWChemExBasePython(NWChemExBaseGit, PythonPackage): + pass diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py index 4c48266..8a92bc0 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py @@ -11,11 +11,11 @@ # next to all the things you'll want to change. Once you've handled # them, you can save this file and test your package like this: # -# spack install nwchemex-simde +# spack install nwchemex-friendzone # # You can edit this file again by typing: # -# spack edit nwchemex-simde +# spack edit nwchemex-friendzone # # See the Spack documentation for more information on packaging. # ---------------------------------------------------------------------------- From e8656e27dd2edabfce62eafa6d1fe84a532ad3b5 Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Mon, 3 Nov 2025 11:56:59 -0700 Subject: [PATCH 15/40] Progress on switching friendzone and nwchemex packages to PythonPackage --- .../packages/nwchemex_friendzone/_package.py | 118 +++++++++++++++ .../packages/nwchemex_friendzone/package.py | 80 +++++----- .../packages/nwchemex_nwchemex/_package.py | 140 ++++++++++++++++++ .../packages/nwchemex_nwchemex/package.py | 63 +++----- 4 files changed, 318 insertions(+), 83 deletions(-) create mode 100644 spack_repo/nwchemex/core/packages/nwchemex_friendzone/_package.py create mode 100644 spack_repo/nwchemex/core/packages/nwchemex_nwchemex/_package.py diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/_package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/_package.py new file mode 100644 index 0000000..4c48266 --- /dev/null +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/_package.py @@ -0,0 +1,118 @@ +# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# ---------------------------------------------------------------------------- +# If you submit this package back to Spack as a pull request, +# please first remove this boilerplate and all FIXME comments. +# +# This is a template package file for Spack. We've put "FIXME" +# next to all the things you'll want to change. Once you've handled +# them, you can save this file and test your package like this: +# +# spack install nwchemex-simde +# +# You can edit this file again by typing: +# +# spack edit nwchemex-simde +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack import package as pkg + +from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings + + +class NwchemexFriendzone(NWChemExBasePybindings): + """Generic, helpful C++ classes used by the NWChemEx project.""" + + project = "FriendZone" + + homepage = f"https://github.com/NWChemEx/{project}" + url = f"https://github.com/NWChemEx/{project}/archive/refs/tags/v1.0.9.tar.gz" + git = f"https://github.com/NWChemEx/{project}.git" # For the latest commit + + # Versions are hosted under GitHub tags right now + list_url = f"https://github.com/NWChemEx/{project}/tags" + # To get older versions, uncomment 'list_depth' below and set it to a + # value >0 to get list_depth + 1 pages of versions. + # WARNING: This increases the number of links that the search spider will + # follow, meaning even 'list_depth = 1' may increase the search time + # significantly! + # list_depth = 1 + + pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran") + pkg.license("Apache-2.0", checked_by="zachcran") + + # Versions from git tags + pkg.version( + "1.0.9", + sha256="fbf3b4a8f392e88e675696976d4d4927af1f158a2602f761796d415c1fbaeab1", + ) + + # TODO: Should this still be here for SimDE propagation? + # pkg.variant( + # "sigma", + # default=False, + # description="Enable Sigma for uncertainty tracking", + # sticky=True, + # ) + pkg.variant( + "experimental", + default=False, + description="Enable experimental features", + sticky=False, + ) + + pkg.depends_on("py-pip", when="+python", type=("build", "link")) + pkg.depends_on( + "py-pydantic", when="+python", type=("build", "link", "run") + ) + pkg.depends_on( + "py-networkx~default", when="+python", type=("build", "link", "run") + ) + pkg.depends_on( + "py-qcelemental", when="+python", type=("build", "link", "run") + ) + pkg.depends_on( + "py-qcengine", when="+python", type=("build", "link", "run") + ) + # pkg.depends_on("py-ase", when="+python", type=("build", "link", "run")) + pkg.depends_on("nwchem", when="+python", type=("build", "link", "run")) + + # First-party + pkg.depends_on( + "nwchemex-simde+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-simde~python", + type=("build", "link", "run"), + when="~python", + ) + + # Start with CMaize sanity check locations + # sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( + # project.lower() + # ) + # sanity_check_is_file = NWChemExBasePybindings.cmaize_sanity_check_files( + # project.lower() + # ) + # Append more sanity checks as needed + + def cmake_args(self): + args = super().cmake_args() + + args.extend( + [ + self.define_from_variant( + "ENABLE_EXPERIMENTAL_FEATURES", "experimental" + ), + self.define("ENABLE_ASE", "OFF"), + ] + ) + + return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py index 8a92bc0..a9dc1eb 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py @@ -22,11 +22,11 @@ from spack import package as pkg -from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings +from spack_repo.nwchemex.common.mixins import NWChemExBasePython -class NwchemexFriendzone(NWChemExBasePybindings): - """Generic, helpful C++ classes used by the NWChemEx project.""" +class NwchemexFriendzone(NWChemExBasePython): + """Provides SimDE-compatible APIs so that NWChemEx can play nicely with its friends.""" project = "FriendZone" @@ -48,8 +48,8 @@ class NwchemexFriendzone(NWChemExBasePybindings): # Versions from git tags pkg.version( - "1.0.9", - sha256="fbf3b4a8f392e88e675696976d4d4927af1f158a2602f761796d415c1fbaeab1", + "1.0.14", + sha256="b504cb1f20ed5839a1fc926650b2f4114b8ff985f2295f81980e05281c74d652", ) # TODO: Should this still be here for SimDE propagation? @@ -59,41 +59,47 @@ class NwchemexFriendzone(NWChemExBasePybindings): # description="Enable Sigma for uncertainty tracking", # sticky=True, # ) + # Not currently available in the Python package + # pkg.variant( + # "experimental", + # default=False, + # description="Enable experimental features", + # sticky=False, + # ) pkg.variant( - "experimental", - default=False, - description="Enable experimental features", - sticky=False, + "friends", + values=pkg.any_combination_of("nwchem", "ase"), + # pkg.any_combination_of() automatically adds a "none" option and sets + # the following two options + # default="none", + # multi=True, + description=( + "Which friends to include. For multiple friends, use a " + "comma-separated list " + "(e.g. `spack install friendzone friends=nwchem,ase`)" + ), ) - pkg.depends_on("py-pip", when="+python", type=("build", "link")) - pkg.depends_on( - "py-pydantic", when="+python", type=("build", "link", "run") - ) - pkg.depends_on( - "py-networkx~default", when="+python", type=("build", "link", "run") - ) - pkg.depends_on( - "py-qcelemental", when="+python", type=("build", "link", "run") - ) - pkg.depends_on( - "py-qcengine", when="+python", type=("build", "link", "run") - ) - # pkg.depends_on("py-ase", when="+python", type=("build", "link", "run")) - pkg.depends_on("nwchem", when="+python", type=("build", "link", "run")) + # TODO: Many of these may be able to be switched to ("build", "run") + # instead of ("build", "link", "run") + pkg.depends_on("python@3.10:", type=("build", "run")) + pkg.depends_on("py-pip", type=("build", "link")) + pkg.depends_on("py-pydantic", type=("build", "link", "run")) + with pkg.when("friends=nwchem"): + pkg.depends_on("py-networkx~default", type=("build", "link", "run")) + pkg.depends_on("py-qcelemental", type=("build", "link", "run")) + pkg.depends_on("py-qcengine", type=("build", "link", "run")) + pkg.depends_on("nwchem", type=("build", "link", "run")) + with pkg.when("friends=ase"): + pkg.depends_on("py-ase", type=("build", "link", "run")) # First-party pkg.depends_on( "nwchemex-simde+python", type=("build", "link", "run"), - when="+python", - ) - pkg.depends_on( - "nwchemex-simde~python", - type=("build", "link", "run"), - when="~python", ) + # TODO: Add sanity checks # Start with CMaize sanity check locations # sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( # project.lower() @@ -102,17 +108,3 @@ class NwchemexFriendzone(NWChemExBasePybindings): # project.lower() # ) # Append more sanity checks as needed - - def cmake_args(self): - args = super().cmake_args() - - args.extend( - [ - self.define_from_variant( - "ENABLE_EXPERIMENTAL_FEATURES", "experimental" - ), - self.define("ENABLE_ASE", "OFF"), - ] - ) - - return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/_package.py b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/_package.py new file mode 100644 index 0000000..adcc9ba --- /dev/null +++ b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/_package.py @@ -0,0 +1,140 @@ +# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +# ---------------------------------------------------------------------------- +# If you submit this package back to Spack as a pull request, +# please first remove this boilerplate and all FIXME comments. +# +# This is a template package file for Spack. We've put "FIXME" +# next to all the things you'll want to change. Once you've handled +# them, you can save this file and test your package like this: +# +# spack install nwchemex-simde +# +# You can edit this file again by typing: +# +# spack edit nwchemex-simde +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack import package as pkg + +from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings + + +class NwchemexNwchemex(NWChemExBasePybindings): + """Generic, helpful C++ classes used by the NWChemEx project.""" + + project = "NWChemEx" + + homepage = f"https://github.com/NWChemEx/{project}" + url = f"https://github.com/NWChemEx/{project}/archive/refs/tags/v0.0.27.tar.gz" + git = f"https://github.com/NWChemEx/{project}.git" # For the latest commit + + # Versions are hosted under GitHub tags right now + list_url = f"https://github.com/NWChemEx/{project}/tags" + # To get older versions, uncomment 'list_depth' below and set it to a + # value >0 to get list_depth + 1 pages of versions. + # WARNING: This increases the number of links that the search spider will + # follow, meaning even 'list_depth = 1' may increase the search time + # significantly! + # list_depth = 1 + + pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran") + pkg.license("Apache-2.0", checked_by="zachcran") + + # Versions from git tags + pkg.version( + "0.0.27", + sha256="1bd22792ca0fbe74f95b2065f2f2d674f2c62d186a340150e8ed1e0f27c2d334", + ) + + # TODO: Should this still be here for SimDE propagation? + # pkg.variant( + # "sigma", + # default=False, + # description="Enable Sigma for uncertainty tracking", + # sticky=True, + # ) + # TODO: Handle this turned on + pkg.variant( + "tamm", + default=False, + description="Build modules that rely on TAMM/Exachem", + ) + pkg.variant( + "full-chemcache", + default=False, + description="If ChemCache isn't found, build the full version", + sticky=False, + ) + + # First-party + pkg.depends_on( + "nwchemex-friendzone+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-scf+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-scf~python", + type=("build", "link", "run"), + when="~python", + ) + pkg.depends_on( + "nwchemex-nux+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-nux~python", + type=("build", "link", "run"), + when="~python", + ) + pkg.depends_on( + "nwchemex-chemcache+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-chemcache~python", + type=("build", "link", "run"), + when="~python", + ) + pkg.depends_on( + "nwchemex-integrals+python", + type=("build", "link", "run"), + when="+python", + ) + pkg.depends_on( + "nwchemex-integrals~python", + type=("build", "link", "run"), + when="~python", + ) + + # Start with CMaize sanity check locations + # sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( + # project.lower() + # ) + # sanity_check_is_file = NWChemExBasePybindings.cmaize_sanity_check_files( + # project.lower() + # ) + # Append more sanity checks as needed + + # def cmake_args(self): + # args = super().cmake_args() + + # args.extend( + # self.define_from_variant( + # "ENABLE_EXPERIMENTAL_FEATURES", "experimental" + # ), + # ) + + # return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py index adcc9ba..ded50b3 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py @@ -22,10 +22,10 @@ from spack import package as pkg -from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings +from spack_repo.nwchemex.common.mixins import NWChemExBasePython -class NwchemexNwchemex(NWChemExBasePybindings): +class NwchemexNwchemex(NWChemExBasePython): """Generic, helpful C++ classes used by the NWChemEx project.""" project = "NWChemEx" @@ -65,60 +65,56 @@ class NwchemexNwchemex(NWChemExBasePybindings): default=False, description="Build modules that rely on TAMM/Exachem", ) + # TODO: This is not used anywhere pkg.variant( "full-chemcache", default=False, description="If ChemCache isn't found, build the full version", sticky=False, ) + pkg.variant( + "friends", + values=pkg.any_combination_of("nwchem", "ase"), + # pkg.any_combination_of() automatically adds a "none" option and sets + # the following two options + # default="none", + # multi=True, + description=( + "Which friends to include. For multiple friends, use a " + "comma-separated list " + "(e.g. `spack install friendzone friends=nwchem,ase`)" + ), + ) + + # TODO: Many of these may be able to be switched to ("build", "run") + # instead of ("build", "link", "run") + pkg.depends_on("python@3.10:", type=("build", "run")) # First-party + # TODO: Figure out how to ensure that the correct value for the "friends" + # variant can be propagated, or switch each friend to a separate variant pkg.depends_on( - "nwchemex-friendzone+python", + "nwchemex-friendzone", type=("build", "link", "run"), - when="+python", ) pkg.depends_on( "nwchemex-scf+python", type=("build", "link", "run"), - when="+python", - ) - pkg.depends_on( - "nwchemex-scf~python", - type=("build", "link", "run"), - when="~python", ) pkg.depends_on( "nwchemex-nux+python", type=("build", "link", "run"), - when="+python", - ) - pkg.depends_on( - "nwchemex-nux~python", - type=("build", "link", "run"), - when="~python", ) pkg.depends_on( "nwchemex-chemcache+python", type=("build", "link", "run"), - when="+python", - ) - pkg.depends_on( - "nwchemex-chemcache~python", - type=("build", "link", "run"), - when="~python", ) pkg.depends_on( "nwchemex-integrals+python", type=("build", "link", "run"), - when="+python", - ) - pkg.depends_on( - "nwchemex-integrals~python", - type=("build", "link", "run"), - when="~python", ) + # TODO: Add sanity checks # Start with CMaize sanity check locations # sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( # project.lower() @@ -127,14 +123,3 @@ class NwchemexNwchemex(NWChemExBasePybindings): # project.lower() # ) # Append more sanity checks as needed - - # def cmake_args(self): - # args = super().cmake_args() - - # args.extend( - # self.define_from_variant( - # "ENABLE_EXPERIMENTAL_FEATURES", "experimental" - # ), - # ) - - # return args From 25cfac1d2ff3f635e33218e0352b4e4d92fa29e9 Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Tue, 4 Nov 2025 15:56:42 -0600 Subject: [PATCH 16/40] remove stale references to experimental features --- .../packages/nwchemex_chemcache/package.py | 19 ------------------- .../packages/nwchemex_friendzone/_package.py | 9 --------- .../packages/nwchemex_friendzone/package.py | 7 ------- .../packages/nwchemex_nwchemex/_package.py | 11 ----------- 4 files changed, 46 deletions(-) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py b/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py index 5b3370e..dde069a 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py @@ -62,12 +62,6 @@ class NwchemexChemcache(NWChemExBasePybindings): # description="Enable Sigma for uncertainty tracking", # sticky=True, # ) - pkg.variant( - "experimental", - default=False, - description="Enable experimental features", - sticky=False, - ) pkg.depends_on("py-requests") @@ -91,16 +85,3 @@ class NwchemexChemcache(NWChemExBasePybindings): project.lower() ) # Append more sanity checks as needed - - def cmake_args(self): - args = super().cmake_args() - - args.extend( - [ - self.define_from_variant( - "ENABLE_EXPERIMENTAL_FEATURES", "experimental" - ), - ] - ) - - return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/_package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/_package.py index 4c48266..1f1774e 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/_package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/_package.py @@ -59,12 +59,6 @@ class NwchemexFriendzone(NWChemExBasePybindings): # description="Enable Sigma for uncertainty tracking", # sticky=True, # ) - pkg.variant( - "experimental", - default=False, - description="Enable experimental features", - sticky=False, - ) pkg.depends_on("py-pip", when="+python", type=("build", "link")) pkg.depends_on( @@ -108,9 +102,6 @@ def cmake_args(self): args.extend( [ - self.define_from_variant( - "ENABLE_EXPERIMENTAL_FEATURES", "experimental" - ), self.define("ENABLE_ASE", "OFF"), ] ) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py index a9dc1eb..027de00 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py @@ -59,13 +59,6 @@ class NwchemexFriendzone(NWChemExBasePython): # description="Enable Sigma for uncertainty tracking", # sticky=True, # ) - # Not currently available in the Python package - # pkg.variant( - # "experimental", - # default=False, - # description="Enable experimental features", - # sticky=False, - # ) pkg.variant( "friends", values=pkg.any_combination_of("nwchem", "ase"), diff --git a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/_package.py b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/_package.py index adcc9ba..12e729a 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/_package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/_package.py @@ -127,14 +127,3 @@ class NwchemexNwchemex(NWChemExBasePybindings): # project.lower() # ) # Append more sanity checks as needed - - # def cmake_args(self): - # args = super().cmake_args() - - # args.extend( - # self.define_from_variant( - # "ENABLE_EXPERIMENTAL_FEATURES", "experimental" - # ), - # ) - - # return args From f68ef5ea4e356d72dcf9844ec23a0e41f52ef978 Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Mon, 10 Nov 2025 16:12:58 -0600 Subject: [PATCH 17/40] FriendZon and NWX updates; some cleaning on various packages --- .../packages/nwchemex_chemcache/package.py | 8 ----- .../packages/nwchemex_friendzone/package.py | 9 ++--- .../core/packages/nwchemex_nux/package.py | 19 ---------- .../packages/nwchemex_nwchemex/package.py | 36 ++----------------- .../packages/nwchemex_parallelzone/package.py | 11 ++++++ .../core/packages/nwchemex_scf/package.py | 34 ------------------ .../nwchemex_tensorwrapper/package.py | 1 + 7 files changed, 16 insertions(+), 102 deletions(-) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py b/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py index dde069a..9698c28 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py @@ -55,14 +55,6 @@ class NwchemexChemcache(NWChemExBasePybindings): sha256="5efb2a60d75aaa57e08e8b2a0b84a24e502083fa5bacae416406ec59bd2839b8", ) - # TODO: Are we sure this shouldn't be here to propagate down to SimDE? - # pkg.variant( - # "sigma", - # default=False, - # description="Enable Sigma for uncertainty tracking", - # sticky=True, - # ) - pkg.depends_on("py-requests") # First-party diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py index 027de00..5e72ca0 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py @@ -47,18 +47,12 @@ class NwchemexFriendzone(NWChemExBasePython): pkg.license("Apache-2.0", checked_by="zachcran") # Versions from git tags + pkg.version("python_package", branch="python_package") pkg.version( "1.0.14", sha256="b504cb1f20ed5839a1fc926650b2f4114b8ff985f2295f81980e05281c74d652", ) - # TODO: Should this still be here for SimDE propagation? - # pkg.variant( - # "sigma", - # default=False, - # description="Enable Sigma for uncertainty tracking", - # sticky=True, - # ) pkg.variant( "friends", values=pkg.any_combination_of("nwchem", "ase"), @@ -77,6 +71,7 @@ class NwchemexFriendzone(NWChemExBasePython): # instead of ("build", "link", "run") pkg.depends_on("python@3.10:", type=("build", "run")) pkg.depends_on("py-pip", type=("build", "link")) + pkg.depends_on("py-setuptools", type="build") pkg.depends_on("py-pydantic", type=("build", "link", "run")) with pkg.when("friends=nwchem"): pkg.depends_on("py-networkx~default", type=("build", "link", "run")) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py b/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py index dccc8e3..9a97ef7 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py @@ -52,14 +52,6 @@ class NwchemexNux(NWChemExBasePybindings): sha256="58cb55b4975baf3255208333fd4366293efe55b0aeaab3c269f7485f75f2061b", ) - # TODO: Should this still be here for SimDE propagation? - # pkg.variant( - # "sigma", - # default=False, - # description="Enable Sigma for uncertainty tracking", - # sticky=True, - # ) - # First-party pkg.depends_on( "nwchemex-simde+python", @@ -80,14 +72,3 @@ class NwchemexNux(NWChemExBasePybindings): project.lower() ) # Append more sanity checks as needed - - # def cmake_args(self): - # args = super().cmake_args() - - # args.extend( - # [ - # self.define_from_variant("ENABLE_SIGMA", "sigma"), - # ] - # ) - - # return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py index ded50b3..d8afa69 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py @@ -47,48 +47,16 @@ class NwchemexNwchemex(NWChemExBasePython): pkg.license("Apache-2.0", checked_by="zachcran") # Versions from git tags + pkg.version("python_package", branch="python_package") pkg.version( "0.0.27", sha256="1bd22792ca0fbe74f95b2065f2f2d674f2c62d186a340150e8ed1e0f27c2d334", ) - # TODO: Should this still be here for SimDE propagation? - # pkg.variant( - # "sigma", - # default=False, - # description="Enable Sigma for uncertainty tracking", - # sticky=True, - # ) - # TODO: Handle this turned on - pkg.variant( - "tamm", - default=False, - description="Build modules that rely on TAMM/Exachem", - ) - # TODO: This is not used anywhere - pkg.variant( - "full-chemcache", - default=False, - description="If ChemCache isn't found, build the full version", - sticky=False, - ) - pkg.variant( - "friends", - values=pkg.any_combination_of("nwchem", "ase"), - # pkg.any_combination_of() automatically adds a "none" option and sets - # the following two options - # default="none", - # multi=True, - description=( - "Which friends to include. For multiple friends, use a " - "comma-separated list " - "(e.g. `spack install friendzone friends=nwchem,ase`)" - ), - ) - # TODO: Many of these may be able to be switched to ("build", "run") # instead of ("build", "link", "run") pkg.depends_on("python@3.10:", type=("build", "run")) + pkg.depends_on("py-setuptools", type="build") # First-party # TODO: Figure out how to ensure that the correct value for the "friends" diff --git a/spack_repo/nwchemex/core/packages/nwchemex_parallelzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_parallelzone/package.py index a4a55c1..6111d81 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_parallelzone/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_parallelzone/package.py @@ -85,4 +85,15 @@ class NwchemexParallelzone(NWChemExBasePybindings): sanity_check_is_file = NWChemExBasePybindings.cmaize_sanity_check_files( project.lower() ) + # Append more sanity checks as needed + def cmake_args(self): + args = super().cmake_args() + + args.extend( + [ + self.define_from_variant("BUILD_PAPI_BINDINGS ", "papi"), + ] + ) + + return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py b/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py index fdd1aba..68bc685 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py @@ -51,38 +51,15 @@ class NwchemexScf(NWChemExBasePybindings): sha256="b175c15e8c814cd288817c970f4e049c7eab248975ff7c891d8927d7555d0cd8", ) - pkg.variant( - "sigma", - default=False, - description="Enable Sigma for uncertainty tracking", - sticky=True, - ) - # TODO: Handle this turned on - pkg.variant( - "tamm", - default=False, - description="Build modules that rely on TAMM/Exachem", - ) - # For building GauXC, I think pkg.depends_on("c", type="build") # TODO: Create this package # pkg.depends_on("gauxc") pkg.depends_on("eigen") - # The "tune" variant is not available prior to v2.6 - # TODO: A value of "tune=none" or any of the molgw-* options likely break - # the unit tests, but I don't know how to add them as conflicts yet. - pkg.depends_on("libint@2.6:", when="+tamm") pkg.depends_on("mpi") pkg.depends_on("py-numpy") pkg.depends_on("libxc") - # pkg.depends_on("tamm", when="+tamm") - # pkg.depends_on("exachem", when="+tamm") - - # Although we have a variant, technically it is not a direct dependency - # of this package - # pkg.depends_on("sigma+eigen", when="+sigma") # First-party pkg.depends_on( @@ -104,14 +81,3 @@ class NwchemexScf(NWChemExBasePybindings): project.lower() ) # Append more sanity checks as needed - - def cmake_args(self): - args = super().cmake_args() - - args.extend( - [ - self.define_from_variant("ENABLE_SIGMA", "sigma"), - ] - ) - - return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py b/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py index 67f4118..fc2bd9c 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py @@ -61,6 +61,7 @@ class NwchemexTensorwrapper(NWChemExBasePybindings): # Runtime dependencies pkg.depends_on("boost") pkg.depends_on("eigen") + pkg.depends_on("py-numpy", when="+python", type=("build", "run")) # First-party pkg.depends_on("nwchemex-utilities") From 430e5410e52d9a9e559e39f8c8e5cc311fbb8b9d Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Wed, 12 Nov 2025 12:17:54 -0600 Subject: [PATCH 18/40] Python is default --- spack_repo/nwchemex/common/mixins/nwchemex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spack_repo/nwchemex/common/mixins/nwchemex.py b/spack_repo/nwchemex/common/mixins/nwchemex.py index 2e2f1e6..2342a7e 100644 --- a/spack_repo/nwchemex/common/mixins/nwchemex.py +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -95,7 +95,7 @@ class NWChemExBasePybindings(NWChemExBaseCXX): pkg.variant( "python", - default=False, + default=True, description="Build the Python bindings", # sticky=True, ) From 611dfe0ccb823aaba3f24952ff4737da7153fa0c Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Fri, 14 Nov 2025 16:08:20 -0600 Subject: [PATCH 19/40] update FriendZone --- .../nwchemex/core/packages/nwchemex_friendzone/package.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py index 5e72ca0..ba28ad3 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py @@ -55,7 +55,7 @@ class NwchemexFriendzone(NWChemExBasePython): pkg.variant( "friends", - values=pkg.any_combination_of("nwchem", "ase"), + values=pkg.any_combination_of("molssi", "ase", "nwchem"), # pkg.any_combination_of() automatically adds a "none" option and sets # the following two options # default="none", @@ -63,7 +63,7 @@ class NwchemexFriendzone(NWChemExBasePython): description=( "Which friends to include. For multiple friends, use a " "comma-separated list " - "(e.g. `spack install friendzone friends=nwchem,ase`)" + "(e.g. `spack install friendzone friends=molssi,ase`)" ), ) @@ -73,10 +73,11 @@ class NwchemexFriendzone(NWChemExBasePython): pkg.depends_on("py-pip", type=("build", "link")) pkg.depends_on("py-setuptools", type="build") pkg.depends_on("py-pydantic", type=("build", "link", "run")) - with pkg.when("friends=nwchem"): + with pkg.when("friends=molssi"): pkg.depends_on("py-networkx~default", type=("build", "link", "run")) pkg.depends_on("py-qcelemental", type=("build", "link", "run")) pkg.depends_on("py-qcengine", type=("build", "link", "run")) + with pkg.when("friends=nwchem"): pkg.depends_on("nwchem", type=("build", "link", "run")) with pkg.when("friends=ase"): pkg.depends_on("py-ase", type=("build", "link", "run")) From 6af16e328119a7010d7984f36f9a684dbbc9327e Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Thu, 20 Nov 2025 15:31:19 -0600 Subject: [PATCH 20/40] remove cxx standard from NWChemExBaseCXX --- spack_repo/nwchemex/common/mixins/nwchemex.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/spack_repo/nwchemex/common/mixins/nwchemex.py b/spack_repo/nwchemex/common/mixins/nwchemex.py index 2342a7e..a2fa8a1 100644 --- a/spack_repo/nwchemex/common/mixins/nwchemex.py +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -30,17 +30,6 @@ class NWChemExBaseCXX(NWChemExBaseGit, CMaizePackage): sticky=True, ) - pkg.variant( - "cxxstd", - default="17", - # NOTE: Comma after "17" is necessary so Spack doesn't split it into - # individual characters - values=("17",), - multi=False, - description="Use the specified C++ standard when building", - sticky=True, - ) - pkg.depends_on("cxx", type="build") # Test dependencies @@ -56,7 +45,6 @@ def cmake_args(self): ), self.define_from_variant("BUILD_SHARED_LIBS", "shared"), self.define_from_variant("BUILD_DOCS", "docs"), - self.define_from_variant("CMAKE_CXX_STANDARD", "cxxstd"), self.define("BUILD_TESTING", self.run_tests), ] ) @@ -75,12 +63,6 @@ def cmake_args(self): args.append(self.define("CMAKE_POLICY_DEFAULT_CMP0152", "NEW")) # DEBUG REMOVE ME - args.append( - self.define( - "FETCHCONTENT_SOURCE_DIR_NWX_CMAKE", - "/home/zachcran/workspaces/nwchemex/repos_dev/nwxcmake", - ) - ) args.append( self.define( "CMAKE_VERBOSE_MAKEFILE", From 41ab70532374de639a067220c488dfcfb07f771b Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Fri, 21 Nov 2025 13:27:07 -0600 Subject: [PATCH 21/40] dependency updates; checksum update for qcengine --- spack_repo/nwchemex/core/packages/nwchemex_scf/package.py | 3 ++- .../nwchemex/core/packages/nwchemex_tensorwrapper/package.py | 2 +- spack_repo/nwchemex/core/packages/py_qcengine/package.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py b/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py index 68bc685..1194533 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py @@ -59,7 +59,8 @@ class NwchemexScf(NWChemExBasePybindings): pkg.depends_on("eigen") pkg.depends_on("mpi") pkg.depends_on("py-numpy") - pkg.depends_on("libxc") + # Uncomment when GauXC/Libxc interactions are sorted out + # pkg.depends_on("libxc") # First-party pkg.depends_on( diff --git a/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py b/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py index fc2bd9c..675bd6c 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py @@ -60,7 +60,7 @@ class NwchemexTensorwrapper(NWChemExBasePybindings): # Runtime dependencies pkg.depends_on("boost") - pkg.depends_on("eigen") + pkg.depends_on("eigen", type=("build", "link", "run")) pkg.depends_on("py-numpy", when="+python", type=("build", "run")) # First-party diff --git a/spack_repo/nwchemex/core/packages/py_qcengine/package.py b/spack_repo/nwchemex/core/packages/py_qcengine/package.py index 8c5d3bd..e6b92b6 100644 --- a/spack_repo/nwchemex/core/packages/py_qcengine/package.py +++ b/spack_repo/nwchemex/core/packages/py_qcengine/package.py @@ -39,7 +39,7 @@ class PyQcengine(PythonPackage): pkg.version( "0.33.0", - sha256="1d83cda4d1b3214f5710f84ba8ad8586fb9b7949236ed6699f4b036bbd4c077b", + sha256="7d9317355294b2118b9e959e57394eb3f2205db004d9ebe7441cd5026a7fc6c4", ) pkg.version( "0.32.0", From 184edc18e6b2145aef8c97d854c577e7d7b5e989 Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Mon, 24 Nov 2025 13:27:03 -0700 Subject: [PATCH 22/40] ChemCache: Add minimum version constraint to py-requests --- .../nwchemex/core/packages/nwchemex_chemcache/package.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py b/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py index 9698c28..bb28e16 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py @@ -21,6 +21,7 @@ # ---------------------------------------------------------------------------- from spack import package as pkg + from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings @@ -55,7 +56,7 @@ class NwchemexChemcache(NWChemExBasePybindings): sha256="5efb2a60d75aaa57e08e8b2a0b84a24e502083fa5bacae416406ec59bd2839b8", ) - pkg.depends_on("py-requests") + pkg.depends_on("py-requests@2.16:") # First-party pkg.depends_on( From d7258b7b93ba6769498b4718ff7d49f078c486ca Mon Sep 17 00:00:00 2001 From: "Jonathan M. Waldrop" Date: Tue, 25 Nov 2025 02:15:56 -0600 Subject: [PATCH 23/40] Remove stale FriendZone version --- spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py | 1 - 1 file changed, 1 deletion(-) diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py index ba28ad3..03b9113 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py @@ -47,7 +47,6 @@ class NwchemexFriendzone(NWChemExBasePython): pkg.license("Apache-2.0", checked_by="zachcran") # Versions from git tags - pkg.version("python_package", branch="python_package") pkg.version( "1.0.14", sha256="b504cb1f20ed5839a1fc926650b2f4114b8ff985f2295f81980e05281c74d652", From f957c325f4290ac3f8f4fdfc5200597c7f3881be Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Mon, 15 Dec 2025 12:47:57 -0700 Subject: [PATCH 24/40] Fix nested double quotes issue --- spack_repo/nwchemex/common/mixins/nwchemex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spack_repo/nwchemex/common/mixins/nwchemex.py b/spack_repo/nwchemex/common/mixins/nwchemex.py index a2fa8a1..3d25c28 100644 --- a/spack_repo/nwchemex/common/mixins/nwchemex.py +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -51,7 +51,7 @@ def cmake_args(self): if "CMAKE_TOOLCHAIN_FILE" in os.environ: args.append( - f"-DCMAKE_TOOLCHAIN_FILE={os.environ["CMAKE_TOOLCHAIN_FILE"]}" + f"-DCMAKE_TOOLCHAIN_FILE={os.environ['CMAKE_TOOLCHAIN_FILE']}" ) # TODO: +debug flag? +verbose flag? args.append(self.define("CMAKE_MESSAGE_LOG_LEVEL", "DEBUG")) From 3352af7502c2152795a038422576996807529d18 Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Mon, 26 Jan 2026 09:48:36 -0700 Subject: [PATCH 25/40] Document the nwchemex.common namespace more explicitly --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 4b8c288..277b8b1 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,11 @@ This GitHub repository provides various package repositories for the NWChemEx pr ``` spack_repo └── nwchemex + ├── common + │ ├── mixins + │ │ └── ... + │ ├── ... + │ └── repo.yaml ├── core │ ├── packages │ │ ├── package_1 @@ -94,6 +99,10 @@ In Spack, package repositories are namespaced as `nwchemex.` and Packages can be distinguished by prefixing the package name with the package repository namespace it is defined in (e.g. `nwchemex.repo_a.package_1`). This is useful to determine from which repository a package originated, like to confirm that you are using the correct override of a package. However, in general, namespaces are not needed when identifying a package in a package specification and should be avoided. Spack actually strongly discourages using explicit namespacing in `depends_on()` statements of packages, as "It makes the package non-portable and tightly coupled to a specific repository configuration, hindering sharing and composition of repositories." (see warning at the bottom of Spack's [Search Order and Overriding Packages](https://spack.readthedocs.io/en/latest/repositories.html#search-order-and-overriding-packages)). +### `nwchemex.common` + +Spack package repository for common components used to build up NWChemEx Spack packages, like various mixin classes composing the package classes. + ### `nwchemex.core` Spack package repository for core (first-party) packages in the NWChemEx software stack. From 6be2f25566c400f458fb2647ff300b93df7b2713 Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Mon, 26 Jan 2026 10:15:49 -0700 Subject: [PATCH 26/40] Add initial test script that imports each package for initial error screening --- test/check_errors.sh | 61 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100755 test/check_errors.sh diff --git a/test/check_errors.sh b/test/check_errors.sh new file mode 100755 index 0000000..3940f45 --- /dev/null +++ b/test/check_errors.sh @@ -0,0 +1,61 @@ +#!/usr/bin/env bash + +# Performs import of all NWChemEx Spack package components to check for errors. +# +# With v2.0 of the Spack package API, Spack packages can be treated as normal +# Python-importable packages. This allows a first-pass error check by just +# importing the packages before even installing them, catching potential +# programming errors up the stack quickly. +# +# Usage: .sh +# +# Environment: +# SPACK_ROOT Used to find the location of your Spack install. +# SPACK_NWCHEMEX_ENV Env to activate that has the NWChemEx repo set up. +# Does not activate an env if undefined or empty. + +set -e + +_main() { + # Ensure that Spack is available for the script + local _spack_root="${SPACK_ROOT:-}" + if [[ "${_spack_root}" == "" ]]; then + printf 'ERROR: SPACK_ROOT environment variable not found! Make sure that Spack is installed and sourced correctly in your shell.\n' + exit 1 + fi + . "${_spack_root}"/share/spack/setup-env.sh + + # Check if an environment should be activated + local _nwchemex_env="${SPACK_NWCHEMEX_ENV:-}" + if [[ "${_nwchemex_env}" != "" ]]; then + spack env activate "${_nwchemex_env}" + fi + + # These are the imports to be executed + commands=( + "from spack_repo.nwchemex.common.mixins import *" + "from spack_repo.nwchemex.core.packages.utilities.package import Utilities" + "from spack_repo.nwchemex.core.packages.parallelzone.package import Parallelzone" + "from spack_repo.nwchemex.core.packages.pluginplay.package import Pluginplay" + "from spack_repo.nwchemex.core.packages.tensorwrapper.package import Tensorwrapper" + "from spack_repo.nwchemex.core.packages.chemist.package import Chemist" + "from spack_repo.nwchemex.core.packages.simde.package import Simde" + "from spack_repo.nwchemex.core.packages.integrals.package import Integrals" + "from spack_repo.nwchemex.core.packages.nux.package import Nux" + "from spack_repo.nwchemex.core.packages.chemcache.package import Chemcache" + "from spack_repo.nwchemex.core.packages.friendzone.package import Friendzone" + "from spack_repo.nwchemex.core.packages.scf.package import Scf" + "from spack_repo.nwchemex.core.packages.nwchemex.package import Nwchemex" + ) + + # Perform each import; this currently exits on the first error, but could + # continue if the python call was changed to avoid triggering 'set -e' with + # the colon no-op operator on error, like this: + # spack python -c "$cmd" || : + for cmd in "${commands[@]}"; do + printf 'Testing %s\n' "$cmd" + spack python -c "$cmd" + done +} + +_main "$@" From 31c03e32d46c909f8f12162e4729daf9130af065 Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Mon, 26 Jan 2026 10:28:19 -0700 Subject: [PATCH 27/40] Remove 'nwchemex-' prefixes and template documentation --- spack_repo/nwchemex/common/mixins/nwchemex.py | 7 ++++ .../package.py | 24 ++----------- .../{nwchemex_chemist => chemist}/package.py | 25 +++----------- .../_package.py | 7 ++-- .../package.py | 24 ++----------- .../package.py | 25 +++----------- .../packages/{nwchemex_nux => nux}/package.py | 24 ++----------- .../_package.py | 7 ++-- .../package.py | 24 ++----------- .../package.py | 34 +++++++------------ .../package.py | 26 +++----------- .../packages/{nwchemex_scf => scf}/package.py | 25 +++----------- .../{nwchemex_simde => simde}/package.py | 25 +++----------- .../package.py | 25 +++----------- .../package.py | 25 +++----------- 15 files changed, 66 insertions(+), 261 deletions(-) rename spack_repo/nwchemex/core/packages/{nwchemex_chemcache => chemcache}/package.py (66%) rename spack_repo/nwchemex/core/packages/{nwchemex_chemist => chemist}/package.py (73%) rename spack_repo/nwchemex/core/packages/{nwchemex_friendzone => friendzone}/_package.py (93%) rename spack_repo/nwchemex/core/packages/{nwchemex_friendzone => friendzone}/package.py (75%) rename spack_repo/nwchemex/core/packages/{nwchemex_integrals => integrals}/package.py (72%) rename spack_repo/nwchemex/core/packages/{nwchemex_nux => nux}/package.py (65%) rename spack_repo/nwchemex/core/packages/{nwchemex_nwchemex => nwchemex}/_package.py (93%) rename spack_repo/nwchemex/core/packages/{nwchemex_nwchemex => nwchemex}/package.py (72%) rename spack_repo/nwchemex/core/packages/{nwchemex_parallelzone => parallelzone}/package.py (69%) rename spack_repo/nwchemex/core/packages/{nwchemex_pluginplay => pluginplay}/package.py (71%) rename spack_repo/nwchemex/core/packages/{nwchemex_scf => scf}/package.py (69%) rename spack_repo/nwchemex/core/packages/{nwchemex_simde => simde}/package.py (72%) rename spack_repo/nwchemex/core/packages/{nwchemex_tensorwrapper => tensorwrapper}/package.py (72%) rename spack_repo/nwchemex/core/packages/{nwchemex_utilities => utilities}/package.py (60%) diff --git a/spack_repo/nwchemex/common/mixins/nwchemex.py b/spack_repo/nwchemex/common/mixins/nwchemex.py index 3d25c28..b343de4 100644 --- a/spack_repo/nwchemex/common/mixins/nwchemex.py +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -69,6 +69,13 @@ def cmake_args(self): True, ) ) + # DEBUG REMOVE ME + args.append( + self.define( + "FETCHCONTENT_SOURCE_DIR_NWX_CMAKE", + "/home/zachcran/workspaces/nwchemex/projects/spack_packaging/nwx/nwxcmake", + ) + ) return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py b/spack_repo/nwchemex/core/packages/chemcache/package.py similarity index 66% rename from spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py rename to spack_repo/nwchemex/core/packages/chemcache/package.py index bb28e16..682cafc 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_chemcache/package.py +++ b/spack_repo/nwchemex/core/packages/chemcache/package.py @@ -1,31 +1,13 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. +# Copyright 2025-2026 NWChemEx Developers. # -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -# ---------------------------------------------------------------------------- -# If you submit this package back to Spack as a pull request, -# please first remove this boilerplate and all FIXME comments. -# -# This is a template package file for Spack. We've put "FIXME" -# next to all the things you'll want to change. Once you've handled -# them, you can save this file and test your package like this: -# -# spack install nwchemex-chemist -# -# You can edit this file again by typing: -# -# spack edit nwchemex-chemist -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- +# SPDX-License-Identifier: Apache-2.0 from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings -class NwchemexChemcache(NWChemExBasePybindings): +class Chemcache(NWChemExBasePybindings): """Generic, helpful C++ classes used by the NWChemEx project.""" project = "ChemCache" diff --git a/spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py b/spack_repo/nwchemex/core/packages/chemist/package.py similarity index 73% rename from spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py rename to spack_repo/nwchemex/core/packages/chemist/package.py index b075f91..bd5b2ef 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_chemist/package.py +++ b/spack_repo/nwchemex/core/packages/chemist/package.py @@ -1,30 +1,13 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. +# Copyright 2025-2026 NWChemEx Developers. # -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -# ---------------------------------------------------------------------------- -# If you submit this package back to Spack as a pull request, -# please first remove this boilerplate and all FIXME comments. -# -# This is a template package file for Spack. We've put "FIXME" -# next to all the things you'll want to change. Once you've handled -# them, you can save this file and test your package like this: -# -# spack install nwchemex-chemist -# -# You can edit this file again by typing: -# -# spack edit nwchemex-chemist -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- +# SPDX-License-Identifier: Apache-2.0 from spack import package as pkg + from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings -class NwchemexChemist(NWChemExBasePybindings): +class Chemist(NWChemExBasePybindings): """Generic, helpful C++ classes used by the NWChemEx project.""" project = "Chemist" diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/_package.py b/spack_repo/nwchemex/core/packages/friendzone/_package.py similarity index 93% rename from spack_repo/nwchemex/core/packages/nwchemex_friendzone/_package.py rename to spack_repo/nwchemex/core/packages/friendzone/_package.py index 1f1774e..eece430 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/_package.py +++ b/spack_repo/nwchemex/core/packages/friendzone/_package.py @@ -1,7 +1,6 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. +# Copyright 2025-2026 NWChemEx Developers. # -# SPDX-License-Identifier: (Apache-2.0 OR MIT) +# SPDX-License-Identifier: Apache-2.0 # ---------------------------------------------------------------------------- # If you submit this package back to Spack as a pull request, @@ -25,7 +24,7 @@ from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings -class NwchemexFriendzone(NWChemExBasePybindings): +class Friendzone(NWChemExBasePybindings): """Generic, helpful C++ classes used by the NWChemEx project.""" project = "FriendZone" diff --git a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py b/spack_repo/nwchemex/core/packages/friendzone/package.py similarity index 75% rename from spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py rename to spack_repo/nwchemex/core/packages/friendzone/package.py index 03b9113..6c8e9f5 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_friendzone/package.py +++ b/spack_repo/nwchemex/core/packages/friendzone/package.py @@ -1,31 +1,13 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. +# Copyright 2025-2026 NWChemEx Developers. # -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -# ---------------------------------------------------------------------------- -# If you submit this package back to Spack as a pull request, -# please first remove this boilerplate and all FIXME comments. -# -# This is a template package file for Spack. We've put "FIXME" -# next to all the things you'll want to change. Once you've handled -# them, you can save this file and test your package like this: -# -# spack install nwchemex-friendzone -# -# You can edit this file again by typing: -# -# spack edit nwchemex-friendzone -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- +# SPDX-License-Identifier: Apache-2.0 from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBasePython -class NwchemexFriendzone(NWChemExBasePython): +class Friendzone(NWChemExBasePython): """Provides SimDE-compatible APIs so that NWChemEx can play nicely with its friends.""" project = "FriendZone" diff --git a/spack_repo/nwchemex/core/packages/nwchemex_integrals/package.py b/spack_repo/nwchemex/core/packages/integrals/package.py similarity index 72% rename from spack_repo/nwchemex/core/packages/nwchemex_integrals/package.py rename to spack_repo/nwchemex/core/packages/integrals/package.py index a2ca584..378cce1 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_integrals/package.py +++ b/spack_repo/nwchemex/core/packages/integrals/package.py @@ -1,30 +1,13 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. +# Copyright 2025-2026 NWChemEx Developers. # -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -# ---------------------------------------------------------------------------- -# If you submit this package back to Spack as a pull request, -# please first remove this boilerplate and all FIXME comments. -# -# This is a template package file for Spack. We've put "FIXME" -# next to all the things you'll want to change. Once you've handled -# them, you can save this file and test your package like this: -# -# spack install nwchemex-simde -# -# You can edit this file again by typing: -# -# spack edit nwchemex-simde -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- +# SPDX-License-Identifier: Apache-2.0 from spack import package as pkg + from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings -class NwchemexIntegrals(NWChemExBasePybindings): +class Integrals(NWChemExBasePybindings): """Generic, helpful C++ classes used by the NWChemEx project.""" project = "Integrals" diff --git a/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py b/spack_repo/nwchemex/core/packages/nux/package.py similarity index 65% rename from spack_repo/nwchemex/core/packages/nwchemex_nux/package.py rename to spack_repo/nwchemex/core/packages/nux/package.py index 9a97ef7..97a7e32 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_nux/package.py +++ b/spack_repo/nwchemex/core/packages/nux/package.py @@ -1,31 +1,13 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. +# Copyright 2025-2026 NWChemEx Developers. # -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -# ---------------------------------------------------------------------------- -# If you submit this package back to Spack as a pull request, -# please first remove this boilerplate and all FIXME comments. -# -# This is a template package file for Spack. We've put "FIXME" -# next to all the things you'll want to change. Once you've handled -# them, you can save this file and test your package like this: -# -# spack install nwchemex-simde -# -# You can edit this file again by typing: -# -# spack edit nwchemex-simde -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- +# SPDX-License-Identifier: Apache-2.0 from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings -class NwchemexNux(NWChemExBasePybindings): +class Nux(NWChemExBasePybindings): """Generic, helpful C++ classes used by the NWChemEx project.""" project = "NUX" diff --git a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/_package.py b/spack_repo/nwchemex/core/packages/nwchemex/_package.py similarity index 93% rename from spack_repo/nwchemex/core/packages/nwchemex_nwchemex/_package.py rename to spack_repo/nwchemex/core/packages/nwchemex/_package.py index 12e729a..53024c1 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/_package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex/_package.py @@ -1,7 +1,6 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. +# Copyright 2025-2026 NWChemEx Developers. # -# SPDX-License-Identifier: (Apache-2.0 OR MIT) +# SPDX-License-Identifier: Apache-2.0 # ---------------------------------------------------------------------------- # If you submit this package back to Spack as a pull request, @@ -25,7 +24,7 @@ from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings -class NwchemexNwchemex(NWChemExBasePybindings): +class (NWChemExBasePybindings): """Generic, helpful C++ classes used by the NWChemEx project.""" project = "NWChemEx" diff --git a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py b/spack_repo/nwchemex/core/packages/nwchemex/package.py similarity index 72% rename from spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py rename to spack_repo/nwchemex/core/packages/nwchemex/package.py index d8afa69..255a7cf 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_nwchemex/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex/package.py @@ -1,31 +1,13 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. +# Copyright 2025-2026 NWChemEx Developers. # -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -# ---------------------------------------------------------------------------- -# If you submit this package back to Spack as a pull request, -# please first remove this boilerplate and all FIXME comments. -# -# This is a template package file for Spack. We've put "FIXME" -# next to all the things you'll want to change. Once you've handled -# them, you can save this file and test your package like this: -# -# spack install nwchemex-simde -# -# You can edit this file again by typing: -# -# spack edit nwchemex-simde -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- +# SPDX-License-Identifier: Apache-2.0 from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBasePython -class NwchemexNwchemex(NWChemExBasePython): +class Nwchemex(NWChemExBasePython): """Generic, helpful C++ classes used by the NWChemEx project.""" project = "NWChemEx" diff --git a/spack_repo/nwchemex/core/packages/nwchemex_parallelzone/package.py b/spack_repo/nwchemex/core/packages/parallelzone/package.py similarity index 69% rename from spack_repo/nwchemex/core/packages/nwchemex_parallelzone/package.py rename to spack_repo/nwchemex/core/packages/parallelzone/package.py index 6111d81..658f0b3 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_parallelzone/package.py +++ b/spack_repo/nwchemex/core/packages/parallelzone/package.py @@ -1,30 +1,15 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. +# Copyright 2025-2026 NWChemEx Developers. # -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -# ---------------------------------------------------------------------------- -# If you submit this package back to Spack as a pull request, -# please first remove this boilerplate and all FIXME comments. -# -# This is a template package file for Spack. We've put "FIXME" -# next to all the things you'll want to change. Once you've handled -# them, you can save this file and test your package like this: -# -# spack install nwchemex-parallelzone -# -# You can edit this file again by typing: -# -# spack edit nwchemex-parallelzone -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- +# SPDX-License-Identifier: Apache-2.0 from spack.package import depends_on, license, maintainers, variant, version + from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings +# TODO: Use from spack import package as pkg like other packages -class NwchemexParallelzone(NWChemExBasePybindings): + +class Parallelzone(NWChemExBasePybindings): """Generic, helpful C++ classes used by the NWChemEx project.""" project = "ParallelZone" @@ -45,6 +30,8 @@ class NwchemexParallelzone(NWChemExBasePybindings): maintainers("ryanmrichard", "jwaldrop107", "zachcran") license("Apache-2.0", checked_by="zachcran") + version("develop", branch="find_package_wrapper") + # Versions from git tags version( "0.1.34", @@ -75,7 +62,10 @@ class NwchemexParallelzone(NWChemExBasePybindings): # Runtime dependencies depends_on("mpi") depends_on("spdlog") - depends_on("cereal@1.3.0") # v1.3.1 changed the installed target... + depends_on( + "cereal@1.3.1:", when="@0.1.41:" + ) # v1.3.1 changed the installed target from "cereal" to "cereal::cereal" + depends_on("cereal@:1.3.0", when="@:0.1.40") depends_on("papi", when="+papi") # Start with CMaize sanity check locations diff --git a/spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py b/spack_repo/nwchemex/core/packages/pluginplay/package.py similarity index 71% rename from spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py rename to spack_repo/nwchemex/core/packages/pluginplay/package.py index 2fcd7ff..993b1a6 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_pluginplay/package.py +++ b/spack_repo/nwchemex/core/packages/pluginplay/package.py @@ -1,31 +1,13 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. +# Copyright 2025-2026 NWChemEx Developers. # -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -# ---------------------------------------------------------------------------- -# If you submit this package back to Spack as a pull request, -# please first remove this boilerplate and all FIXME comments. -# -# This is a template package file for Spack. We've put "FIXME" -# next to all the things you'll want to change. Once you've handled -# them, you can save this file and test your package like this: -# -# spack install nwchemex-pluginplay -# -# You can edit this file again by typing: -# -# spack edit nwchemex-pluginplay -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- +# SPDX-License-Identifier: Apache-2.0 from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings -class NwchemexPluginplay(NWChemExBasePybindings): +class Pluginplay(NWChemExBasePybindings): """Generic, helpful C++ classes used by the NWChemEx project.""" project = "PluginPlay" @@ -46,6 +28,8 @@ class NwchemexPluginplay(NWChemExBasePybindings): pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran") pkg.license("Apache-2.0", checked_by="zachcran") + pkg.version("develop", branch="find_package_wrapper") + # Versions from git tags pkg.version( "1.0.46", diff --git a/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py b/spack_repo/nwchemex/core/packages/scf/package.py similarity index 69% rename from spack_repo/nwchemex/core/packages/nwchemex_scf/package.py rename to spack_repo/nwchemex/core/packages/scf/package.py index 1194533..5411e58 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_scf/package.py +++ b/spack_repo/nwchemex/core/packages/scf/package.py @@ -1,30 +1,13 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. +# Copyright 2025-2026 NWChemEx Developers. # -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -# ---------------------------------------------------------------------------- -# If you submit this package back to Spack as a pull request, -# please first remove this boilerplate and all FIXME comments. -# -# This is a template package file for Spack. We've put "FIXME" -# next to all the things you'll want to change. Once you've handled -# them, you can save this file and test your package like this: -# -# spack install nwchemex-simde -# -# You can edit this file again by typing: -# -# spack edit nwchemex-simde -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- +# SPDX-License-Identifier: Apache-2.0 from spack import package as pkg + from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings -class NwchemexScf(NWChemExBasePybindings): +class Scf(NWChemExBasePybindings): """Generic, helpful C++ classes used by the NWChemEx project.""" project = "SCF" diff --git a/spack_repo/nwchemex/core/packages/nwchemex_simde/package.py b/spack_repo/nwchemex/core/packages/simde/package.py similarity index 72% rename from spack_repo/nwchemex/core/packages/nwchemex_simde/package.py rename to spack_repo/nwchemex/core/packages/simde/package.py index 6abe88f..3903114 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_simde/package.py +++ b/spack_repo/nwchemex/core/packages/simde/package.py @@ -1,30 +1,13 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. +# Copyright 2025-2026 NWChemEx Developers. # -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -# ---------------------------------------------------------------------------- -# If you submit this package back to Spack as a pull request, -# please first remove this boilerplate and all FIXME comments. -# -# This is a template package file for Spack. We've put "FIXME" -# next to all the things you'll want to change. Once you've handled -# them, you can save this file and test your package like this: -# -# spack install nwchemex-simde -# -# You can edit this file again by typing: -# -# spack edit nwchemex-simde -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- +# SPDX-License-Identifier: Apache-2.0 from spack import package as pkg + from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings -class NwchemexSimde(NWChemExBasePybindings): +class Simde(NWChemExBasePybindings): """Generic, helpful C++ classes used by the NWChemEx project.""" project = "SimDE" diff --git a/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py b/spack_repo/nwchemex/core/packages/tensorwrapper/package.py similarity index 72% rename from spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py rename to spack_repo/nwchemex/core/packages/tensorwrapper/package.py index 675bd6c..daf34fe 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_tensorwrapper/package.py +++ b/spack_repo/nwchemex/core/packages/tensorwrapper/package.py @@ -1,30 +1,13 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. +# Copyright 2025-2026 NWChemEx Developers. # -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -# ---------------------------------------------------------------------------- -# If you submit this package back to Spack as a pull request, -# please first remove this boilerplate and all FIXME comments. -# -# This is a template package file for Spack. We've put "FIXME" -# next to all the things you'll want to change. Once you've handled -# them, you can save this file and test your package like this: -# -# spack install nwchemex-tensorwrapper -# -# You can edit this file again by typing: -# -# spack edit nwchemex-tensorwrapper -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- +# SPDX-License-Identifier: Apache-2.0 from spack import package as pkg + from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings -class NwchemexTensorwrapper(NWChemExBasePybindings): +class Tensorwrapper(NWChemExBasePybindings): """Generic, helpful C++ classes used by the NWChemEx project.""" project = "TensorWrapper" diff --git a/spack_repo/nwchemex/core/packages/nwchemex_utilities/package.py b/spack_repo/nwchemex/core/packages/utilities/package.py similarity index 60% rename from spack_repo/nwchemex/core/packages/nwchemex_utilities/package.py rename to spack_repo/nwchemex/core/packages/utilities/package.py index aa21cb0..7db70fc 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex_utilities/package.py +++ b/spack_repo/nwchemex/core/packages/utilities/package.py @@ -1,30 +1,13 @@ -# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other -# Spack Project Developers. See the top-level COPYRIGHT file for details. +# Copyright 2025-2026 NWChemEx Developers. # -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -# ---------------------------------------------------------------------------- -# If you submit this package back to Spack as a pull request, -# please first remove this boilerplate and all FIXME comments. -# -# This is a template package file for Spack. We've put "FIXME" -# next to all the things you'll want to change. Once you've handled -# them, you can save this file and test your package like this: -# -# spack install nwchemex-utilities -# -# You can edit this file again by typing: -# -# spack edit nwchemex-utilities -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- +# SPDX-License-Identifier: Apache-2.0 from spack import package as pkg + from spack_repo.nwchemex.common.mixins import NWChemExBaseCXX -class NwchemexUtilities(NWChemExBaseCXX): +class Utilities(NWChemExBaseCXX): """Generic, helpful C++ classes used by the NWChemEx project.""" project = "Utilities" From 6cdd06c0e8f6ddcc975ab4644f10fc3956e02afe Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Mon, 26 Jan 2026 16:37:46 -0700 Subject: [PATCH 28/40] Remove template headers and add accurate, brief description comments --- .../core/packages/chemcache/package.py | 6 +-- .../nwchemex/core/packages/chemist/package.py | 9 ++--- .../core/packages/friendzone/_package.py | 23 +---------- .../core/packages/friendzone/package.py | 4 -- .../core/packages/integrals/package.py | 6 +-- .../nwchemex/core/packages/nux/package.py | 8 ++-- .../core/packages/nwchemex/_package.py | 25 +----------- .../core/packages/nwchemex/package.py | 6 +-- .../core/packages/parallelzone/package.py | 40 +++++++++---------- .../core/packages/pluginplay/package.py | 6 +-- .../nwchemex/core/packages/scf/package.py | 6 +-- .../nwchemex/core/packages/simde/package.py | 9 ++--- .../core/packages/tensorwrapper/package.py | 6 +-- .../core/packages/utilities/package.py | 4 -- 14 files changed, 40 insertions(+), 118 deletions(-) diff --git a/spack_repo/nwchemex/core/packages/chemcache/package.py b/spack_repo/nwchemex/core/packages/chemcache/package.py index 682cafc..e486d8d 100644 --- a/spack_repo/nwchemex/core/packages/chemcache/package.py +++ b/spack_repo/nwchemex/core/packages/chemcache/package.py @@ -1,14 +1,10 @@ -# Copyright 2025-2026 NWChemEx Developers. -# -# SPDX-License-Identifier: Apache-2.0 - from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings class Chemcache(NWChemExBasePybindings): - """Generic, helpful C++ classes used by the NWChemEx project.""" + """Basis sets, physical constants, geometries, basically any data you can just look up.""" project = "ChemCache" diff --git a/spack_repo/nwchemex/core/packages/chemist/package.py b/spack_repo/nwchemex/core/packages/chemist/package.py index bd5b2ef..5d993fa 100644 --- a/spack_repo/nwchemex/core/packages/chemist/package.py +++ b/spack_repo/nwchemex/core/packages/chemist/package.py @@ -1,14 +1,13 @@ -# Copyright 2025-2026 NWChemEx Developers. -# -# SPDX-License-Identifier: Apache-2.0 - from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings class Chemist(NWChemExBasePybindings): - """Generic, helpful C++ classes used by the NWChemEx project.""" + """Chemist provides chemistry-related data structures. This includes data + structures for chemistry concepts including atoms, molecules, and + atomic-orbital basis sets. + """ project = "Chemist" diff --git a/spack_repo/nwchemex/core/packages/friendzone/_package.py b/spack_repo/nwchemex/core/packages/friendzone/_package.py index eece430..7343b5a 100644 --- a/spack_repo/nwchemex/core/packages/friendzone/_package.py +++ b/spack_repo/nwchemex/core/packages/friendzone/_package.py @@ -1,31 +1,10 @@ -# Copyright 2025-2026 NWChemEx Developers. -# -# SPDX-License-Identifier: Apache-2.0 - -# ---------------------------------------------------------------------------- -# If you submit this package back to Spack as a pull request, -# please first remove this boilerplate and all FIXME comments. -# -# This is a template package file for Spack. We've put "FIXME" -# next to all the things you'll want to change. Once you've handled -# them, you can save this file and test your package like this: -# -# spack install nwchemex-simde -# -# You can edit this file again by typing: -# -# spack edit nwchemex-simde -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- - from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings class Friendzone(NWChemExBasePybindings): - """Generic, helpful C++ classes used by the NWChemEx project.""" + """Provides SimDE-compatible APIs so that NWChemEx can play nicely with its friends.""" project = "FriendZone" diff --git a/spack_repo/nwchemex/core/packages/friendzone/package.py b/spack_repo/nwchemex/core/packages/friendzone/package.py index 6c8e9f5..d05e591 100644 --- a/spack_repo/nwchemex/core/packages/friendzone/package.py +++ b/spack_repo/nwchemex/core/packages/friendzone/package.py @@ -1,7 +1,3 @@ -# Copyright 2025-2026 NWChemEx Developers. -# -# SPDX-License-Identifier: Apache-2.0 - from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBasePython diff --git a/spack_repo/nwchemex/core/packages/integrals/package.py b/spack_repo/nwchemex/core/packages/integrals/package.py index 378cce1..27cba85 100644 --- a/spack_repo/nwchemex/core/packages/integrals/package.py +++ b/spack_repo/nwchemex/core/packages/integrals/package.py @@ -1,14 +1,10 @@ -# Copyright 2025-2026 NWChemEx Developers. -# -# SPDX-License-Identifier: Apache-2.0 - from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings class Integrals(NWChemExBasePybindings): - """Generic, helpful C++ classes used by the NWChemEx project.""" + """Generic integral API and implementations for specific integral libraries.""" project = "Integrals" diff --git a/spack_repo/nwchemex/core/packages/nux/package.py b/spack_repo/nwchemex/core/packages/nux/package.py index 97a7e32..4223ec3 100644 --- a/spack_repo/nwchemex/core/packages/nux/package.py +++ b/spack_repo/nwchemex/core/packages/nux/package.py @@ -1,14 +1,12 @@ -# Copyright 2025-2026 NWChemEx Developers. -# -# SPDX-License-Identifier: Apache-2.0 - from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings class Nux(NWChemExBasePybindings): - """Generic, helpful C++ classes used by the NWChemEx project.""" + """NWChemEx User Experience (NUX): Tools, functions, etc. to facilitate + user workflows. + """ project = "NUX" diff --git a/spack_repo/nwchemex/core/packages/nwchemex/_package.py b/spack_repo/nwchemex/core/packages/nwchemex/_package.py index 53024c1..d4020e2 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex/_package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex/_package.py @@ -1,31 +1,10 @@ -# Copyright 2025-2026 NWChemEx Developers. -# -# SPDX-License-Identifier: Apache-2.0 - -# ---------------------------------------------------------------------------- -# If you submit this package back to Spack as a pull request, -# please first remove this boilerplate and all FIXME comments. -# -# This is a template package file for Spack. We've put "FIXME" -# next to all the things you'll want to change. Once you've handled -# them, you can save this file and test your package like this: -# -# spack install nwchemex-simde -# -# You can edit this file again by typing: -# -# spack edit nwchemex-simde -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- - from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings -class (NWChemExBasePybindings): - """Generic, helpful C++ classes used by the NWChemEx project.""" +class Nwchemex(NWChemExBasePybindings): + """A top-level, user-focused, conglomerate repo for the NWChemEx project.""" project = "NWChemEx" diff --git a/spack_repo/nwchemex/core/packages/nwchemex/package.py b/spack_repo/nwchemex/core/packages/nwchemex/package.py index 255a7cf..77d45f3 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex/package.py @@ -1,14 +1,10 @@ -# Copyright 2025-2026 NWChemEx Developers. -# -# SPDX-License-Identifier: Apache-2.0 - from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBasePython class Nwchemex(NWChemExBasePython): - """Generic, helpful C++ classes used by the NWChemEx project.""" + """A top-level, user-focused, conglomerate repo for the NWChemEx project.""" project = "NWChemEx" diff --git a/spack_repo/nwchemex/core/packages/parallelzone/package.py b/spack_repo/nwchemex/core/packages/parallelzone/package.py index 658f0b3..29f4fdd 100644 --- a/spack_repo/nwchemex/core/packages/parallelzone/package.py +++ b/spack_repo/nwchemex/core/packages/parallelzone/package.py @@ -1,8 +1,4 @@ -# Copyright 2025-2026 NWChemEx Developers. -# -# SPDX-License-Identifier: Apache-2.0 - -from spack.package import depends_on, license, maintainers, variant, version +from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings @@ -10,7 +6,11 @@ class Parallelzone(NWChemExBasePybindings): - """Generic, helpful C++ classes used by the NWChemEx project.""" + """You're travelling through another dimension, a dimension not only of + CPUs and threads but of GPUs; a journey into a wondrous land whose + boundaries are bandwidth limited. That's the signpost up ahead - your next + stop, the ParallelZone! + """ project = "ParallelZone" @@ -27,46 +27,46 @@ class Parallelzone(NWChemExBasePybindings): # significantly! # list_depth = 1 - maintainers("ryanmrichard", "jwaldrop107", "zachcran") - license("Apache-2.0", checked_by="zachcran") + pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran") + pkg.license("Apache-2.0", checked_by="zachcran") - version("develop", branch="find_package_wrapper") + pkg.version("develop", branch="find_package_wrapper") # Versions from git tags - version( + pkg.version( "0.1.34", sha256="ca47108832ddefc600c9b4782bbe0faf89da403a4cdac5b379f508be39ece934", ) - variant( + pkg.variant( "papi", default=False, description="Enable PAPI bindings", ) - # variant( + # pkg.variant( # "cuda", # default=False, # description="Enable CUDA bindings", # ) - # variant( + # pkg.variant( # "hip", # default=False, # description="Enable HIP bindings", # ) - # variant( + # pkg.variant( # "sycl", # default=False, # description="Enable SYCL bindings", # ) # Runtime dependencies - depends_on("mpi") - depends_on("spdlog") - depends_on( + pkg.depends_on("mpi") + pkg.depends_on("spdlog") + pkg.depends_on( "cereal@1.3.1:", when="@0.1.41:" ) # v1.3.1 changed the installed target from "cereal" to "cereal::cereal" - depends_on("cereal@:1.3.0", when="@:0.1.40") - depends_on("papi", when="+papi") + pkg.depends_on("cereal@:1.3.0", when="@:0.1.40") + pkg.depends_on("papi", when="+papi") # Start with CMaize sanity check locations sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( @@ -82,7 +82,7 @@ def cmake_args(self): args.extend( [ - self.define_from_variant("BUILD_PAPI_BINDINGS ", "papi"), + self.define_from_pkg.variant("BUILD_PAPI_BINDINGS ", "papi"), ] ) diff --git a/spack_repo/nwchemex/core/packages/pluginplay/package.py b/spack_repo/nwchemex/core/packages/pluginplay/package.py index 993b1a6..48b7925 100644 --- a/spack_repo/nwchemex/core/packages/pluginplay/package.py +++ b/spack_repo/nwchemex/core/packages/pluginplay/package.py @@ -1,14 +1,10 @@ -# Copyright 2025-2026 NWChemEx Developers. -# -# SPDX-License-Identifier: Apache-2.0 - from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings class Pluginplay(NWChemExBasePybindings): - """Generic, helpful C++ classes used by the NWChemEx project.""" + """An inversion-of-control framework for developing modular scientific software.""" project = "PluginPlay" diff --git a/spack_repo/nwchemex/core/packages/scf/package.py b/spack_repo/nwchemex/core/packages/scf/package.py index 5411e58..74dd1ad 100644 --- a/spack_repo/nwchemex/core/packages/scf/package.py +++ b/spack_repo/nwchemex/core/packages/scf/package.py @@ -1,14 +1,10 @@ -# Copyright 2025-2026 NWChemEx Developers. -# -# SPDX-License-Identifier: Apache-2.0 - from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings class Scf(NWChemExBasePybindings): - """Generic, helpful C++ classes used by the NWChemEx project.""" + """Provides SCF driver for the NWChemEx project.""" project = "SCF" diff --git a/spack_repo/nwchemex/core/packages/simde/package.py b/spack_repo/nwchemex/core/packages/simde/package.py index 3903114..b63095a 100644 --- a/spack_repo/nwchemex/core/packages/simde/package.py +++ b/spack_repo/nwchemex/core/packages/simde/package.py @@ -1,14 +1,13 @@ -# Copyright 2025-2026 NWChemEx Developers. -# -# SPDX-License-Identifier: Apache-2.0 - from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings class Simde(NWChemExBasePybindings): - """Generic, helpful C++ classes used by the NWChemEx project.""" + """The Simulation Development Environment (SimDE) includes software + designed to facilitate the creation of modular computational chemistry + software. + """ project = "SimDE" diff --git a/spack_repo/nwchemex/core/packages/tensorwrapper/package.py b/spack_repo/nwchemex/core/packages/tensorwrapper/package.py index daf34fe..01ebd18 100644 --- a/spack_repo/nwchemex/core/packages/tensorwrapper/package.py +++ b/spack_repo/nwchemex/core/packages/tensorwrapper/package.py @@ -1,14 +1,10 @@ -# Copyright 2025-2026 NWChemEx Developers. -# -# SPDX-License-Identifier: Apache-2.0 - from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings class Tensorwrapper(NWChemExBasePybindings): - """Generic, helpful C++ classes used by the NWChemEx project.""" + """A type-erased wrapper around various tensor backends.""" project = "TensorWrapper" diff --git a/spack_repo/nwchemex/core/packages/utilities/package.py b/spack_repo/nwchemex/core/packages/utilities/package.py index 7db70fc..33749d4 100644 --- a/spack_repo/nwchemex/core/packages/utilities/package.py +++ b/spack_repo/nwchemex/core/packages/utilities/package.py @@ -1,7 +1,3 @@ -# Copyright 2025-2026 NWChemEx Developers. -# -# SPDX-License-Identifier: Apache-2.0 - from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBaseCXX From accd573ca3e47700ccdc6b8c23b4f09179896b08 Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Mon, 26 Jan 2026 16:42:11 -0700 Subject: [PATCH 29/40] Remove 'nwchemex-' prefixes in dependencies --- .../core/packages/chemcache/package.py | 4 ++-- .../nwchemex/core/packages/chemist/package.py | 10 +++++----- .../core/packages/friendzone/_package.py | 4 ++-- .../core/packages/friendzone/package.py | 2 +- .../core/packages/integrals/package.py | 4 ++-- .../nwchemex/core/packages/nux/package.py | 4 ++-- .../core/packages/nwchemex/_package.py | 18 +++++++++--------- .../nwchemex/core/packages/nwchemex/package.py | 10 +++++----- .../core/packages/pluginplay/package.py | 6 +++--- .../nwchemex/core/packages/scf/package.py | 4 ++-- .../nwchemex/core/packages/simde/package.py | 8 ++++---- .../core/packages/tensorwrapper/package.py | 6 +++--- 12 files changed, 40 insertions(+), 40 deletions(-) diff --git a/spack_repo/nwchemex/core/packages/chemcache/package.py b/spack_repo/nwchemex/core/packages/chemcache/package.py index e486d8d..45f1c18 100644 --- a/spack_repo/nwchemex/core/packages/chemcache/package.py +++ b/spack_repo/nwchemex/core/packages/chemcache/package.py @@ -38,12 +38,12 @@ class Chemcache(NWChemExBasePybindings): # First-party pkg.depends_on( - "nwchemex-simde+python", + "simde+python", type=("build", "link", "run"), when="+python", ) pkg.depends_on( - "nwchemex-simde~python", + "simde~python", type=("build", "link", "run"), when="~python", ) diff --git a/spack_repo/nwchemex/core/packages/chemist/package.py b/spack_repo/nwchemex/core/packages/chemist/package.py index 5d993fa..66872de 100644 --- a/spack_repo/nwchemex/core/packages/chemist/package.py +++ b/spack_repo/nwchemex/core/packages/chemist/package.py @@ -44,25 +44,25 @@ class Chemist(NWChemExBasePybindings): pkg.depends_on("boost") # First-party - pkg.depends_on("nwchemex-utilities") + pkg.depends_on("utilities") pkg.depends_on( - "nwchemex-parallelzone+python", + "parallelzone+python", type=("build", "link", "run"), when="+python", ) pkg.depends_on( - "nwchemex-parallelzone~python", + "parallelzone~python", type=("build", "link", "run"), when="~python", ) pkg.depends_on( - "nwchemex-tensorwrapper+python", + "tensorwrapper+python", type=("build", "link", "run"), when="+python", ) pkg.depends_on( - "nwchemex-tensorwrapper~python", + "tensorwrapper~python", type=("build", "link", "run"), when="~python", ) diff --git a/spack_repo/nwchemex/core/packages/friendzone/_package.py b/spack_repo/nwchemex/core/packages/friendzone/_package.py index 7343b5a..833e187 100644 --- a/spack_repo/nwchemex/core/packages/friendzone/_package.py +++ b/spack_repo/nwchemex/core/packages/friendzone/_package.py @@ -56,12 +56,12 @@ class Friendzone(NWChemExBasePybindings): # First-party pkg.depends_on( - "nwchemex-simde+python", + "simde+python", type=("build", "link", "run"), when="+python", ) pkg.depends_on( - "nwchemex-simde~python", + "simde~python", type=("build", "link", "run"), when="~python", ) diff --git a/spack_repo/nwchemex/core/packages/friendzone/package.py b/spack_repo/nwchemex/core/packages/friendzone/package.py index d05e591..155a61c 100644 --- a/spack_repo/nwchemex/core/packages/friendzone/package.py +++ b/spack_repo/nwchemex/core/packages/friendzone/package.py @@ -61,7 +61,7 @@ class Friendzone(NWChemExBasePython): # First-party pkg.depends_on( - "nwchemex-simde+python", + "simde+python", type=("build", "link", "run"), ) diff --git a/spack_repo/nwchemex/core/packages/integrals/package.py b/spack_repo/nwchemex/core/packages/integrals/package.py index 27cba85..ee68363 100644 --- a/spack_repo/nwchemex/core/packages/integrals/package.py +++ b/spack_repo/nwchemex/core/packages/integrals/package.py @@ -47,12 +47,12 @@ class Integrals(NWChemExBasePybindings): # First-party pkg.depends_on( - "nwchemex-simde+python", + "simde+python", type=("build", "link", "run"), when="+python", ) pkg.depends_on( - "nwchemex-simde~python", + "simde~python", type=("build", "link", "run"), when="~python", ) diff --git a/spack_repo/nwchemex/core/packages/nux/package.py b/spack_repo/nwchemex/core/packages/nux/package.py index 4223ec3..5a9cf9e 100644 --- a/spack_repo/nwchemex/core/packages/nux/package.py +++ b/spack_repo/nwchemex/core/packages/nux/package.py @@ -34,12 +34,12 @@ class Nux(NWChemExBasePybindings): # First-party pkg.depends_on( - "nwchemex-simde+python", + "simde+python", type=("build", "link", "run"), when="+python", ) pkg.depends_on( - "nwchemex-simde~python", + "simde~python", type=("build", "link", "run"), when="~python", ) diff --git a/spack_repo/nwchemex/core/packages/nwchemex/_package.py b/spack_repo/nwchemex/core/packages/nwchemex/_package.py index d4020e2..5503787 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex/_package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex/_package.py @@ -52,47 +52,47 @@ class Nwchemex(NWChemExBasePybindings): # First-party pkg.depends_on( - "nwchemex-friendzone+python", + "friendzone+python", type=("build", "link", "run"), when="+python", ) pkg.depends_on( - "nwchemex-scf+python", + "scf+python", type=("build", "link", "run"), when="+python", ) pkg.depends_on( - "nwchemex-scf~python", + "scf~python", type=("build", "link", "run"), when="~python", ) pkg.depends_on( - "nwchemex-nux+python", + "nux+python", type=("build", "link", "run"), when="+python", ) pkg.depends_on( - "nwchemex-nux~python", + "nux~python", type=("build", "link", "run"), when="~python", ) pkg.depends_on( - "nwchemex-chemcache+python", + "chemcache+python", type=("build", "link", "run"), when="+python", ) pkg.depends_on( - "nwchemex-chemcache~python", + "chemcache~python", type=("build", "link", "run"), when="~python", ) pkg.depends_on( - "nwchemex-integrals+python", + "integrals+python", type=("build", "link", "run"), when="+python", ) pkg.depends_on( - "nwchemex-integrals~python", + "integrals~python", type=("build", "link", "run"), when="~python", ) diff --git a/spack_repo/nwchemex/core/packages/nwchemex/package.py b/spack_repo/nwchemex/core/packages/nwchemex/package.py index 77d45f3..6dd28a4 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex/package.py @@ -40,23 +40,23 @@ class Nwchemex(NWChemExBasePython): # TODO: Figure out how to ensure that the correct value for the "friends" # variant can be propagated, or switch each friend to a separate variant pkg.depends_on( - "nwchemex-friendzone", + "friendzone", type=("build", "link", "run"), ) pkg.depends_on( - "nwchemex-scf+python", + "scf+python", type=("build", "link", "run"), ) pkg.depends_on( - "nwchemex-nux+python", + "nux+python", type=("build", "link", "run"), ) pkg.depends_on( - "nwchemex-chemcache+python", + "chemcache+python", type=("build", "link", "run"), ) pkg.depends_on( - "nwchemex-integrals+python", + "integrals+python", type=("build", "link", "run"), ) diff --git a/spack_repo/nwchemex/core/packages/pluginplay/package.py b/spack_repo/nwchemex/core/packages/pluginplay/package.py index 48b7925..a01dfed 100644 --- a/spack_repo/nwchemex/core/packages/pluginplay/package.py +++ b/spack_repo/nwchemex/core/packages/pluginplay/package.py @@ -43,14 +43,14 @@ class Pluginplay(NWChemExBasePybindings): pkg.depends_on("libfort enable_testing=false") pkg.depends_on("rocksdb", when="+rocksdb") # First-party - pkg.depends_on("nwchemex-utilities") + pkg.depends_on("utilities") pkg.depends_on( - "nwchemex-parallelzone+python", + "parallelzone+python", type=("build", "link", "run"), when="+python", ) pkg.depends_on( - "nwchemex-parallelzone~python", + "parallelzone~python", type=("build", "link", "run"), when="~python", ) diff --git a/spack_repo/nwchemex/core/packages/scf/package.py b/spack_repo/nwchemex/core/packages/scf/package.py index 74dd1ad..f640e13 100644 --- a/spack_repo/nwchemex/core/packages/scf/package.py +++ b/spack_repo/nwchemex/core/packages/scf/package.py @@ -43,12 +43,12 @@ class Scf(NWChemExBasePybindings): # First-party pkg.depends_on( - "nwchemex-simde+python", + "simde+python", type=("build", "link", "run"), when="+python", ) pkg.depends_on( - "nwchemex-simde~python", + "simde~python", type=("build", "link", "run"), when="~python", ) diff --git a/spack_repo/nwchemex/core/packages/simde/package.py b/spack_repo/nwchemex/core/packages/simde/package.py index b63095a..812b847 100644 --- a/spack_repo/nwchemex/core/packages/simde/package.py +++ b/spack_repo/nwchemex/core/packages/simde/package.py @@ -42,22 +42,22 @@ class Simde(NWChemExBasePybindings): # First-party pkg.depends_on( - "nwchemex-chemist+python", + "chemist+python", type=("build", "link", "run"), when="+python", ) pkg.depends_on( - "nwchemex-chemist~python", + "chemist~python", type=("build", "link", "run"), when="~python", ) pkg.depends_on( - "nwchemex-pluginplay+python", + "pluginplay+python", type=("build", "link", "run"), when="+python", ) pkg.depends_on( - "nwchemex-pluginplay~python", + "pluginplay~python", type=("build", "link", "run"), when="~python", ) diff --git a/spack_repo/nwchemex/core/packages/tensorwrapper/package.py b/spack_repo/nwchemex/core/packages/tensorwrapper/package.py index 01ebd18..738c316 100644 --- a/spack_repo/nwchemex/core/packages/tensorwrapper/package.py +++ b/spack_repo/nwchemex/core/packages/tensorwrapper/package.py @@ -43,14 +43,14 @@ class Tensorwrapper(NWChemExBasePybindings): pkg.depends_on("py-numpy", when="+python", type=("build", "run")) # First-party - pkg.depends_on("nwchemex-utilities") + pkg.depends_on("utilities") pkg.depends_on( - "nwchemex-parallelzone~python", + "parallelzone~python", type=("build", "link", "run"), when="~python", ) pkg.depends_on( - "nwchemex-parallelzone+python", + "parallelzone+python", type=("build", "link", "run"), when="+python", ) From c73b3cc12f0902419f4cfb0714a6117708927fab Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Mon, 26 Jan 2026 17:09:54 -0700 Subject: [PATCH 30/40] Add Apache-2.0 license, license header yaml file, and run pre-commit --- .gitignore | 18 +- .licenserc.yaml | 29 +++ LICENSE | 177 ++++++++++++++++++ README.md | 16 ++ spack-repo-index.yaml | 14 ++ spack_repo/nwchemex/common/README.md | 16 ++ spack_repo/nwchemex/common/mixins/__init__.py | 14 ++ spack_repo/nwchemex/common/mixins/cmaize.py | 15 +- spack_repo/nwchemex/common/mixins/nwchemex.py | 22 ++- spack_repo/nwchemex/common/repo.yaml | 14 ++ spack_repo/nwchemex/core/packages/README.md | 16 ++ .../core/packages/chemcache/package.py | 18 +- .../nwchemex/core/packages/chemist/package.py | 14 ++ .../core/packages/friendzone/_package.py | 18 +- .../core/packages/friendzone/package.py | 18 +- .../core/packages/integrals/package.py | 14 ++ .../nwchemex/core/packages/nux/package.py | 14 ++ .../core/packages/nwchemex/_package.py | 14 ++ .../core/packages/nwchemex/package.py | 14 ++ .../core/packages/parallelzone/package.py | 14 ++ .../core/packages/pluginplay/package.py | 14 ++ .../core/packages/py_qcelemental/package.py | 17 +- .../core/packages/py_qcengine/package.py | 17 +- .../nwchemex/core/packages/scf/package.py | 14 ++ .../nwchemex/core/packages/simde/package.py | 14 ++ .../core/packages/tensorwrapper/package.py | 14 ++ .../core/packages/utilities/package.py | 14 ++ spack_repo/nwchemex/core/repo.yaml | 14 ++ .../nwchemex/overrides/packages/README.md | 16 ++ spack_repo/nwchemex/overrides/repo.yaml | 14 ++ test/check_errors.sh | 14 ++ 31 files changed, 637 insertions(+), 14 deletions(-) create mode 100644 .licenserc.yaml create mode 100644 LICENSE diff --git a/.gitignore b/.gitignore index b7faf40..40d7a79 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,17 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Byte-compiled / optimized / DLL files __pycache__/ *.py[codz] @@ -182,9 +196,9 @@ cython_debug/ .abstra/ # Visual Studio Code -# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore +# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore -# and can be added to the global gitignore or merged into this file. However, if you prefer, +# and can be added to the global gitignore or merged into this file. However, if you prefer, # you could uncomment the following to ignore the entire vscode folder # .vscode/ diff --git a/.licenserc.yaml b/.licenserc.yaml new file mode 100644 index 0000000..c274745 --- /dev/null +++ b/.licenserc.yaml @@ -0,0 +1,29 @@ +# Copyright 2021 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +header: + license: + spdx-id: Apache-2.0 + copyright-owner: NWChemEx-Project + + paths-ignore: + - .github/ + - docs/Makefile + - docs/requirements.txt + - cmake/generate_module_docs.cpp.in + - LICENSE + - version.txt + - build/ + + comment: never diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f433b1a --- /dev/null +++ b/LICENSE @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/README.md b/README.md index 277b8b1..7948f35 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,19 @@ + + # NWChemEx Spack Package Repositories **WARNING:** Under heavy construction and subject to change at any moment. Not ready for use yet! diff --git a/spack-repo-index.yaml b/spack-repo-index.yaml index 6cd40b9..f8995e2 100644 --- a/spack-repo-index.yaml +++ b/spack-repo-index.yaml @@ -1,3 +1,17 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Used by Spack v1.0.0 to automatically add Spack repos from GitHub # For more info, see https://spack.readthedocs.io/en/latest/repositories.html#git-based-repositories diff --git a/spack_repo/nwchemex/common/README.md b/spack_repo/nwchemex/common/README.md index d9ce4fa..b4dfc50 100644 --- a/spack_repo/nwchemex/common/README.md +++ b/spack_repo/nwchemex/common/README.md @@ -1,3 +1,19 @@ + + # NWChemEx Common Package Components As of Spack package repository `api: v2.0`, package repositories integrate smoothly with Python's import system and can be imported for use in other packages. This repository is a collection of helpers and abstractions for NWChemEx packages to help with maintenance and development. diff --git a/spack_repo/nwchemex/common/mixins/__init__.py b/spack_repo/nwchemex/common/mixins/__init__.py index 5d82e1a..68546e4 100644 --- a/spack_repo/nwchemex/common/mixins/__init__.py +++ b/spack_repo/nwchemex/common/mixins/__init__.py @@ -1,3 +1,17 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from .cmaize import CMaizePackage from .nwchemex import ( NWChemExBaseCXX, diff --git a/spack_repo/nwchemex/common/mixins/cmaize.py b/spack_repo/nwchemex/common/mixins/cmaize.py index 087127c..cf32855 100644 --- a/spack_repo/nwchemex/common/mixins/cmaize.py +++ b/spack_repo/nwchemex/common/mixins/cmaize.py @@ -1,9 +1,22 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from spack.package import join_path from spack_repo.builtin.build_systems.cmake import CMakePackage class CMaizePackage(CMakePackage): - @staticmethod def cmaize_sanity_check_dirs(project_name: str) -> list[str]: # Could also use cls.__name__.lower() if it should always match diff --git a/spack_repo/nwchemex/common/mixins/nwchemex.py b/spack_repo/nwchemex/common/mixins/nwchemex.py index b343de4..65e9e16 100644 --- a/spack_repo/nwchemex/common/mixins/nwchemex.py +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -1,3 +1,17 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import os from spack import package as pkg @@ -8,7 +22,6 @@ class NWChemExBaseGit(PackageBase): - # Latest commit from GitHub # "This download method is untrusted, and is not recommended. Branches are # moving targets, so the commit you get when you install the package likely @@ -21,7 +34,6 @@ class NWChemExBaseGit(PackageBase): class NWChemExBaseCXX(NWChemExBaseGit, CMaizePackage): - pkg.variant("docs", default=False, description="Build documentation") pkg.variant( "shared", @@ -73,7 +85,10 @@ def cmake_args(self): args.append( self.define( "FETCHCONTENT_SOURCE_DIR_NWX_CMAKE", - "/home/zachcran/workspaces/nwchemex/projects/spack_packaging/nwx/nwxcmake", + ( + "/home/zachcran/workspaces/nwchemex/projects/" + "spack_packaging/nwx/nwxcmake" + ), ) ) @@ -81,7 +96,6 @@ def cmake_args(self): class NWChemExBasePybindings(NWChemExBaseCXX): - pkg.variant( "python", default=True, diff --git a/spack_repo/nwchemex/common/repo.yaml b/spack_repo/nwchemex/common/repo.yaml index 18876d1..ce57642 100644 --- a/spack_repo/nwchemex/common/repo.yaml +++ b/spack_repo/nwchemex/common/repo.yaml @@ -1,3 +1,17 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # For more information on Spack package repositories, see # https://spack.readthedocs.io/en/latest/repositories.html diff --git a/spack_repo/nwchemex/core/packages/README.md b/spack_repo/nwchemex/core/packages/README.md index 1bfd61b..0756ffb 100644 --- a/spack_repo/nwchemex/core/packages/README.md +++ b/spack_repo/nwchemex/core/packages/README.md @@ -1,3 +1,19 @@ + + # nwchemex.core Spack package repository for core (first-party) packages in the NWChemEx software stack. diff --git a/spack_repo/nwchemex/core/packages/chemcache/package.py b/spack_repo/nwchemex/core/packages/chemcache/package.py index 45f1c18..a968e27 100644 --- a/spack_repo/nwchemex/core/packages/chemcache/package.py +++ b/spack_repo/nwchemex/core/packages/chemcache/package.py @@ -1,10 +1,26 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings class Chemcache(NWChemExBasePybindings): - """Basis sets, physical constants, geometries, basically any data you can just look up.""" + """Basis sets, physical constants, geometries, basically any data you can + just look up. + """ project = "ChemCache" diff --git a/spack_repo/nwchemex/core/packages/chemist/package.py b/spack_repo/nwchemex/core/packages/chemist/package.py index 66872de..5cd613c 100644 --- a/spack_repo/nwchemex/core/packages/chemist/package.py +++ b/spack_repo/nwchemex/core/packages/chemist/package.py @@ -1,3 +1,17 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings diff --git a/spack_repo/nwchemex/core/packages/friendzone/_package.py b/spack_repo/nwchemex/core/packages/friendzone/_package.py index 833e187..a6c5eaf 100644 --- a/spack_repo/nwchemex/core/packages/friendzone/_package.py +++ b/spack_repo/nwchemex/core/packages/friendzone/_package.py @@ -1,10 +1,26 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings class Friendzone(NWChemExBasePybindings): - """Provides SimDE-compatible APIs so that NWChemEx can play nicely with its friends.""" + """Provides SimDE-compatible APIs so that NWChemEx can play nicely with its + friends. + """ project = "FriendZone" diff --git a/spack_repo/nwchemex/core/packages/friendzone/package.py b/spack_repo/nwchemex/core/packages/friendzone/package.py index 155a61c..2961a40 100644 --- a/spack_repo/nwchemex/core/packages/friendzone/package.py +++ b/spack_repo/nwchemex/core/packages/friendzone/package.py @@ -1,10 +1,26 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBasePython class Friendzone(NWChemExBasePython): - """Provides SimDE-compatible APIs so that NWChemEx can play nicely with its friends.""" + """Provides SimDE-compatible APIs so that NWChemEx can play nicely with its + friends. + """ project = "FriendZone" diff --git a/spack_repo/nwchemex/core/packages/integrals/package.py b/spack_repo/nwchemex/core/packages/integrals/package.py index ee68363..4bcd69f 100644 --- a/spack_repo/nwchemex/core/packages/integrals/package.py +++ b/spack_repo/nwchemex/core/packages/integrals/package.py @@ -1,3 +1,17 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings diff --git a/spack_repo/nwchemex/core/packages/nux/package.py b/spack_repo/nwchemex/core/packages/nux/package.py index 5a9cf9e..4a73d92 100644 --- a/spack_repo/nwchemex/core/packages/nux/package.py +++ b/spack_repo/nwchemex/core/packages/nux/package.py @@ -1,3 +1,17 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings diff --git a/spack_repo/nwchemex/core/packages/nwchemex/_package.py b/spack_repo/nwchemex/core/packages/nwchemex/_package.py index 5503787..6d0184e 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex/_package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex/_package.py @@ -1,3 +1,17 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings diff --git a/spack_repo/nwchemex/core/packages/nwchemex/package.py b/spack_repo/nwchemex/core/packages/nwchemex/package.py index 6dd28a4..aa51a6c 100644 --- a/spack_repo/nwchemex/core/packages/nwchemex/package.py +++ b/spack_repo/nwchemex/core/packages/nwchemex/package.py @@ -1,3 +1,17 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBasePython diff --git a/spack_repo/nwchemex/core/packages/parallelzone/package.py b/spack_repo/nwchemex/core/packages/parallelzone/package.py index 29f4fdd..6e6b482 100644 --- a/spack_repo/nwchemex/core/packages/parallelzone/package.py +++ b/spack_repo/nwchemex/core/packages/parallelzone/package.py @@ -1,3 +1,17 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings diff --git a/spack_repo/nwchemex/core/packages/pluginplay/package.py b/spack_repo/nwchemex/core/packages/pluginplay/package.py index a01dfed..2b104c7 100644 --- a/spack_repo/nwchemex/core/packages/pluginplay/package.py +++ b/spack_repo/nwchemex/core/packages/pluginplay/package.py @@ -1,3 +1,17 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings diff --git a/spack_repo/nwchemex/core/packages/py_qcelemental/package.py b/spack_repo/nwchemex/core/packages/py_qcelemental/package.py index 963d564..b96c03f 100644 --- a/spack_repo/nwchemex/core/packages/py_qcelemental/package.py +++ b/spack_repo/nwchemex/core/packages/py_qcelemental/package.py @@ -1,3 +1,17 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Copyright Spack Project Developers. See COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -19,9 +33,8 @@ # See the Spack documentation for more information on packaging. # ---------------------------------------------------------------------------- -from spack_repo.builtin.build_systems.python import PythonPackage - from spack import package as pkg +from spack_repo.builtin.build_systems.python import PythonPackage class PyQcelemental(PythonPackage): diff --git a/spack_repo/nwchemex/core/packages/py_qcengine/package.py b/spack_repo/nwchemex/core/packages/py_qcengine/package.py index e6b92b6..7203ea2 100644 --- a/spack_repo/nwchemex/core/packages/py_qcengine/package.py +++ b/spack_repo/nwchemex/core/packages/py_qcengine/package.py @@ -1,3 +1,17 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Copyright Spack Project Developers. See COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) @@ -19,9 +33,8 @@ # See the Spack documentation for more information on packaging. # ---------------------------------------------------------------------------- -from spack_repo.builtin.build_systems.python import PythonPackage - from spack import package as pkg +from spack_repo.builtin.build_systems.python import PythonPackage class PyQcengine(PythonPackage): diff --git a/spack_repo/nwchemex/core/packages/scf/package.py b/spack_repo/nwchemex/core/packages/scf/package.py index f640e13..1cfed91 100644 --- a/spack_repo/nwchemex/core/packages/scf/package.py +++ b/spack_repo/nwchemex/core/packages/scf/package.py @@ -1,3 +1,17 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings diff --git a/spack_repo/nwchemex/core/packages/simde/package.py b/spack_repo/nwchemex/core/packages/simde/package.py index 812b847..56c582c 100644 --- a/spack_repo/nwchemex/core/packages/simde/package.py +++ b/spack_repo/nwchemex/core/packages/simde/package.py @@ -1,3 +1,17 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings diff --git a/spack_repo/nwchemex/core/packages/tensorwrapper/package.py b/spack_repo/nwchemex/core/packages/tensorwrapper/package.py index 738c316..9a2db1a 100644 --- a/spack_repo/nwchemex/core/packages/tensorwrapper/package.py +++ b/spack_repo/nwchemex/core/packages/tensorwrapper/package.py @@ -1,3 +1,17 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings diff --git a/spack_repo/nwchemex/core/packages/utilities/package.py b/spack_repo/nwchemex/core/packages/utilities/package.py index 33749d4..1ee26a7 100644 --- a/spack_repo/nwchemex/core/packages/utilities/package.py +++ b/spack_repo/nwchemex/core/packages/utilities/package.py @@ -1,3 +1,17 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from spack import package as pkg from spack_repo.nwchemex.common.mixins import NWChemExBaseCXX diff --git a/spack_repo/nwchemex/core/repo.yaml b/spack_repo/nwchemex/core/repo.yaml index df117a9..354a086 100644 --- a/spack_repo/nwchemex/core/repo.yaml +++ b/spack_repo/nwchemex/core/repo.yaml @@ -1,3 +1,17 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # For more information on Spack package repositories, see # https://spack.readthedocs.io/en/latest/repositories.html diff --git a/spack_repo/nwchemex/overrides/packages/README.md b/spack_repo/nwchemex/overrides/packages/README.md index 2021054..fa72f00 100644 --- a/spack_repo/nwchemex/overrides/packages/README.md +++ b/spack_repo/nwchemex/overrides/packages/README.md @@ -1,3 +1,19 @@ + + # nwchemex.overrides Spack package repository to override existing packages for use in NWChemEx software stack. This package repository needs to appear above the repository containing the overridden package for it to work! diff --git a/spack_repo/nwchemex/overrides/repo.yaml b/spack_repo/nwchemex/overrides/repo.yaml index fcca2c3..8e7f678 100644 --- a/spack_repo/nwchemex/overrides/repo.yaml +++ b/spack_repo/nwchemex/overrides/repo.yaml @@ -1,3 +1,17 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # For more information on Spack package repositories, see # https://spack.readthedocs.io/en/latest/repositories.html diff --git a/test/check_errors.sh b/test/check_errors.sh index 3940f45..87311ec 100755 --- a/test/check_errors.sh +++ b/test/check_errors.sh @@ -1,4 +1,18 @@ #!/usr/bin/env bash +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Performs import of all NWChemEx Spack package components to check for errors. # From 17154729163f614c58d1efee4b18116f6fb4dee6 Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Mon, 26 Jan 2026 17:31:19 -0700 Subject: [PATCH 31/40] Add version tagging and pull request format check workflows --- .github/workflows/merge.yaml | 33 +++++++++++++++++++++++++++ .github/workflows/pull_request.yaml | 35 +++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 .github/workflows/merge.yaml create mode 100644 .github/workflows/pull_request.yaml diff --git a/.github/workflows/merge.yaml b/.github/workflows/merge.yaml new file mode 100644 index 0000000..ddf36d2 --- /dev/null +++ b/.github/workflows/merge.yaml @@ -0,0 +1,33 @@ +# Copyright 2023 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name: Merge Workflow + +on: + push: + branches: + - master + +jobs: + tag-commit: + uses: NWChemEx/.github/.github/workflows/tag.yaml@master + secrets: inherit + + # deploy_nwx_docs: + # uses: NWChemEx/.github/.github/workflows/deploy_nwx_docs.yaml@master + # with: + # doc_target: "friendzone_cxx_api" + # generate_module_docs: true + # secrets: inherit diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml new file mode 100644 index 0000000..b0ed610 --- /dev/null +++ b/.github/workflows/pull_request.yaml @@ -0,0 +1,35 @@ +# Copyright 2023 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +name: Pull Request Workflow + +on: + pull_request: + branches: + - master + +jobs: + check_formatting: + uses: NWChemEx/.github/.github/workflows/check_formatting.yaml@master + + # test_nwx_docs: + # uses: NWChemEx/.github/.github/workflows/test_nwx_docs.yaml@master + # with: + # doc_target: "friendzone_cxx_api" + + # test_library: + # uses: NWChemEx/.github/.github/workflows/test_nwx_library.yaml@master + # with: + # compilers: '["gcc-14", "clang-18"]' From e1e27c971069ecad2ff797b647fa738e8d2e7686 Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Mon, 26 Jan 2026 18:03:32 -0700 Subject: [PATCH 32/40] Add description for QCElemental --- spack_repo/nwchemex/core/packages/py_qcelemental/package.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spack_repo/nwchemex/core/packages/py_qcelemental/package.py b/spack_repo/nwchemex/core/packages/py_qcelemental/package.py index b96c03f..4c827bb 100644 --- a/spack_repo/nwchemex/core/packages/py_qcelemental/package.py +++ b/spack_repo/nwchemex/core/packages/py_qcelemental/package.py @@ -38,7 +38,9 @@ class PyQcelemental(PythonPackage): - """FIXME: Put a proper description of your package here.""" + """Periodic table, physical constants, and molecule parsing for quantum + chemistry. + """ homepage = "https://github.com/MolSSI/QCElemental" url = "https://github.com/MolSSI/QCElemental/archive/refs/tags/v0.29.0.tar.gz" From c857f161db649140b8bb47fd2dd63146934e032f Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Mon, 26 Jan 2026 18:04:00 -0700 Subject: [PATCH 33/40] Remove template headers for QCEngine and QCElemental packages --- .../core/packages/py_qcelemental/package.py | 21 ---------------- .../core/packages/py_qcengine/package.py | 24 ++----------------- 2 files changed, 2 insertions(+), 43 deletions(-) diff --git a/spack_repo/nwchemex/core/packages/py_qcelemental/package.py b/spack_repo/nwchemex/core/packages/py_qcelemental/package.py index 4c827bb..55b9dec 100644 --- a/spack_repo/nwchemex/core/packages/py_qcelemental/package.py +++ b/spack_repo/nwchemex/core/packages/py_qcelemental/package.py @@ -12,27 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Copyright Spack Project Developers. See COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -# ---------------------------------------------------------------------------- -# If you submit this package back to Spack as a pull request, -# please first remove this boilerplate and all FIXME comments. -# -# This is a template package file for Spack. We've put "FIXME" -# next to all the things you'll want to change. Once you've handled -# them, you can save this file and test your package like this: -# -# spack install py-qcelemental -# -# You can edit this file again by typing: -# -# spack edit py-qcelemental -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- - from spack import package as pkg from spack_repo.builtin.build_systems.python import PythonPackage diff --git a/spack_repo/nwchemex/core/packages/py_qcengine/package.py b/spack_repo/nwchemex/core/packages/py_qcengine/package.py index 7203ea2..7ddb41c 100644 --- a/spack_repo/nwchemex/core/packages/py_qcengine/package.py +++ b/spack_repo/nwchemex/core/packages/py_qcengine/package.py @@ -12,34 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Copyright Spack Project Developers. See COPYRIGHT file for details. -# -# SPDX-License-Identifier: (Apache-2.0 OR MIT) - -# ---------------------------------------------------------------------------- -# If you submit this package back to Spack as a pull request, -# please first remove this boilerplate and all FIXME comments. -# -# This is a template package file for Spack. We've put "FIXME" -# next to all the things you'll want to change. Once you've handled -# them, you can save this file and test your package like this: -# -# spack install py-qcengine -# -# You can edit this file again by typing: -# -# spack edit py-qcengine -# -# See the Spack documentation for more information on packaging. -# ---------------------------------------------------------------------------- - from spack import package as pkg from spack_repo.builtin.build_systems.python import PythonPackage class PyQcengine(PythonPackage): """QCEngine provides a wrapper to ingest and produce QCSchema for a variety - of quantum chemistry programs.""" + of quantum chemistry programs. + """ homepage = "https://github.com/MolSSI/QCEngine" url = "https://github.com/MolSSI/QCEngine/archive/refs/tags/v0.29.0.tar.gz" From b88cd9b0dfa20c513f3537955f4b0eb3d6652d55 Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Mon, 26 Jan 2026 18:09:59 -0700 Subject: [PATCH 34/40] Remove debug statements --- spack_repo/nwchemex/common/mixins/nwchemex.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/spack_repo/nwchemex/common/mixins/nwchemex.py b/spack_repo/nwchemex/common/mixins/nwchemex.py index 65e9e16..b3ba070 100644 --- a/spack_repo/nwchemex/common/mixins/nwchemex.py +++ b/spack_repo/nwchemex/common/mixins/nwchemex.py @@ -74,24 +74,6 @@ def cmake_args(self): # Added in 3.28; OLD is deprecated now args.append(self.define("CMAKE_POLICY_DEFAULT_CMP0152", "NEW")) - # DEBUG REMOVE ME - args.append( - self.define( - "CMAKE_VERBOSE_MAKEFILE", - True, - ) - ) - # DEBUG REMOVE ME - args.append( - self.define( - "FETCHCONTENT_SOURCE_DIR_NWX_CMAKE", - ( - "/home/zachcran/workspaces/nwchemex/projects/" - "spack_packaging/nwx/nwxcmake" - ), - ) - ) - return args From cea6afe601fa3d3356c8eb3f91c5c8b6b8aa43f8 Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Mon, 26 Jan 2026 18:12:08 -0700 Subject: [PATCH 35/40] Remove old TODO --- spack_repo/nwchemex/core/packages/parallelzone/package.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/spack_repo/nwchemex/core/packages/parallelzone/package.py b/spack_repo/nwchemex/core/packages/parallelzone/package.py index 6e6b482..cdc7c2c 100644 --- a/spack_repo/nwchemex/core/packages/parallelzone/package.py +++ b/spack_repo/nwchemex/core/packages/parallelzone/package.py @@ -16,8 +16,6 @@ from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings -# TODO: Use from spack import package as pkg like other packages - class Parallelzone(NWChemExBasePybindings): """You're travelling through another dimension, a dimension not only of From 2c3fc29a4620ac588bd5ea562d027e8ef5accd43 Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Mon, 26 Jan 2026 18:58:36 -0700 Subject: [PATCH 36/40] Fix incorrect 'define_from_pkg.variant()' call --- spack_repo/nwchemex/core/packages/parallelzone/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spack_repo/nwchemex/core/packages/parallelzone/package.py b/spack_repo/nwchemex/core/packages/parallelzone/package.py index cdc7c2c..f945619 100644 --- a/spack_repo/nwchemex/core/packages/parallelzone/package.py +++ b/spack_repo/nwchemex/core/packages/parallelzone/package.py @@ -94,7 +94,7 @@ def cmake_args(self): args.extend( [ - self.define_from_pkg.variant("BUILD_PAPI_BINDINGS ", "papi"), + self.define_from_variant("BUILD_PAPI_BINDINGS ", "papi"), ] ) From 7d7aa373f7bf6d599069501cd5f575734a168f09 Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Wed, 28 Jan 2026 12:30:46 -0700 Subject: [PATCH 37/40] Remove old _package.py files --- .../core/packages/friendzone/_package.py | 103 --------------- .../core/packages/nwchemex/_package.py | 121 ------------------ 2 files changed, 224 deletions(-) delete mode 100644 spack_repo/nwchemex/core/packages/friendzone/_package.py delete mode 100644 spack_repo/nwchemex/core/packages/nwchemex/_package.py diff --git a/spack_repo/nwchemex/core/packages/friendzone/_package.py b/spack_repo/nwchemex/core/packages/friendzone/_package.py deleted file mode 100644 index a6c5eaf..0000000 --- a/spack_repo/nwchemex/core/packages/friendzone/_package.py +++ /dev/null @@ -1,103 +0,0 @@ -# Copyright 2026 NWChemEx-Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from spack import package as pkg - -from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings - - -class Friendzone(NWChemExBasePybindings): - """Provides SimDE-compatible APIs so that NWChemEx can play nicely with its - friends. - """ - - project = "FriendZone" - - homepage = f"https://github.com/NWChemEx/{project}" - url = f"https://github.com/NWChemEx/{project}/archive/refs/tags/v1.0.9.tar.gz" - git = f"https://github.com/NWChemEx/{project}.git" # For the latest commit - - # Versions are hosted under GitHub tags right now - list_url = f"https://github.com/NWChemEx/{project}/tags" - # To get older versions, uncomment 'list_depth' below and set it to a - # value >0 to get list_depth + 1 pages of versions. - # WARNING: This increases the number of links that the search spider will - # follow, meaning even 'list_depth = 1' may increase the search time - # significantly! - # list_depth = 1 - - pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran") - pkg.license("Apache-2.0", checked_by="zachcran") - - # Versions from git tags - pkg.version( - "1.0.9", - sha256="fbf3b4a8f392e88e675696976d4d4927af1f158a2602f761796d415c1fbaeab1", - ) - - # TODO: Should this still be here for SimDE propagation? - # pkg.variant( - # "sigma", - # default=False, - # description="Enable Sigma for uncertainty tracking", - # sticky=True, - # ) - - pkg.depends_on("py-pip", when="+python", type=("build", "link")) - pkg.depends_on( - "py-pydantic", when="+python", type=("build", "link", "run") - ) - pkg.depends_on( - "py-networkx~default", when="+python", type=("build", "link", "run") - ) - pkg.depends_on( - "py-qcelemental", when="+python", type=("build", "link", "run") - ) - pkg.depends_on( - "py-qcengine", when="+python", type=("build", "link", "run") - ) - # pkg.depends_on("py-ase", when="+python", type=("build", "link", "run")) - pkg.depends_on("nwchem", when="+python", type=("build", "link", "run")) - - # First-party - pkg.depends_on( - "simde+python", - type=("build", "link", "run"), - when="+python", - ) - pkg.depends_on( - "simde~python", - type=("build", "link", "run"), - when="~python", - ) - - # Start with CMaize sanity check locations - # sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( - # project.lower() - # ) - # sanity_check_is_file = NWChemExBasePybindings.cmaize_sanity_check_files( - # project.lower() - # ) - # Append more sanity checks as needed - - def cmake_args(self): - args = super().cmake_args() - - args.extend( - [ - self.define("ENABLE_ASE", "OFF"), - ] - ) - - return args diff --git a/spack_repo/nwchemex/core/packages/nwchemex/_package.py b/spack_repo/nwchemex/core/packages/nwchemex/_package.py deleted file mode 100644 index 6d0184e..0000000 --- a/spack_repo/nwchemex/core/packages/nwchemex/_package.py +++ /dev/null @@ -1,121 +0,0 @@ -# Copyright 2026 NWChemEx-Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from spack import package as pkg - -from spack_repo.nwchemex.common.mixins import NWChemExBasePybindings - - -class Nwchemex(NWChemExBasePybindings): - """A top-level, user-focused, conglomerate repo for the NWChemEx project.""" - - project = "NWChemEx" - - homepage = f"https://github.com/NWChemEx/{project}" - url = f"https://github.com/NWChemEx/{project}/archive/refs/tags/v0.0.27.tar.gz" - git = f"https://github.com/NWChemEx/{project}.git" # For the latest commit - - # Versions are hosted under GitHub tags right now - list_url = f"https://github.com/NWChemEx/{project}/tags" - # To get older versions, uncomment 'list_depth' below and set it to a - # value >0 to get list_depth + 1 pages of versions. - # WARNING: This increases the number of links that the search spider will - # follow, meaning even 'list_depth = 1' may increase the search time - # significantly! - # list_depth = 1 - - pkg.maintainers("ryanmrichard", "jwaldrop107", "zachcran") - pkg.license("Apache-2.0", checked_by="zachcran") - - # Versions from git tags - pkg.version( - "0.0.27", - sha256="1bd22792ca0fbe74f95b2065f2f2d674f2c62d186a340150e8ed1e0f27c2d334", - ) - - # TODO: Should this still be here for SimDE propagation? - # pkg.variant( - # "sigma", - # default=False, - # description="Enable Sigma for uncertainty tracking", - # sticky=True, - # ) - # TODO: Handle this turned on - pkg.variant( - "tamm", - default=False, - description="Build modules that rely on TAMM/Exachem", - ) - pkg.variant( - "full-chemcache", - default=False, - description="If ChemCache isn't found, build the full version", - sticky=False, - ) - - # First-party - pkg.depends_on( - "friendzone+python", - type=("build", "link", "run"), - when="+python", - ) - pkg.depends_on( - "scf+python", - type=("build", "link", "run"), - when="+python", - ) - pkg.depends_on( - "scf~python", - type=("build", "link", "run"), - when="~python", - ) - pkg.depends_on( - "nux+python", - type=("build", "link", "run"), - when="+python", - ) - pkg.depends_on( - "nux~python", - type=("build", "link", "run"), - when="~python", - ) - pkg.depends_on( - "chemcache+python", - type=("build", "link", "run"), - when="+python", - ) - pkg.depends_on( - "chemcache~python", - type=("build", "link", "run"), - when="~python", - ) - pkg.depends_on( - "integrals+python", - type=("build", "link", "run"), - when="+python", - ) - pkg.depends_on( - "integrals~python", - type=("build", "link", "run"), - when="~python", - ) - - # Start with CMaize sanity check locations - # sanity_check_is_dir = NWChemExBasePybindings.cmaize_sanity_check_dirs( - # project.lower() - # ) - # sanity_check_is_file = NWChemExBasePybindings.cmaize_sanity_check_files( - # project.lower() - # ) - # Append more sanity checks as needed From 7963d35e843ad1fc9679bf88fe49f6e82c0e4053 Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Tue, 3 Feb 2026 12:46:24 -0700 Subject: [PATCH 38/40] Pin numpy dependency to v1.x for SCF --- spack_repo/nwchemex/core/packages/scf/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spack_repo/nwchemex/core/packages/scf/package.py b/spack_repo/nwchemex/core/packages/scf/package.py index 1cfed91..1e3d249 100644 --- a/spack_repo/nwchemex/core/packages/scf/package.py +++ b/spack_repo/nwchemex/core/packages/scf/package.py @@ -51,7 +51,7 @@ class Scf(NWChemExBasePybindings): # pkg.depends_on("gauxc") pkg.depends_on("eigen") pkg.depends_on("mpi") - pkg.depends_on("py-numpy") + pkg.depends_on("py-numpy@1") # Uncomment when GauXC/Libxc interactions are sorted out # pkg.depends_on("libxc") From 600c8ec9916e86781d47588c3839eca797cb4e84 Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Tue, 3 Feb 2026 14:37:13 -0700 Subject: [PATCH 39/40] Add nwchemex stack environment file for further development and testing --- nwchemex-stack.yaml | 153 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 153 insertions(+) create mode 100644 nwchemex-stack.yaml diff --git a/nwchemex-stack.yaml b/nwchemex-stack.yaml new file mode 100644 index 0000000..c7eb927 --- /dev/null +++ b/nwchemex-stack.yaml @@ -0,0 +1,153 @@ +# Copyright 2026 NWChemEx-Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NWChemEx stack Spack Environment file. +# +# It describes the combinatorial build of the NWChemEx stack. +spack: + + # General definitions for various flags and options used in the + # combinatorial builds + definitions: + - shared: [+shared] + - pybindings: [+python, ~python] + - sigmas: [+sigma, ~sigma] + # Eigen version that actually works for all builds + - eigens: [eigen@git.2e76277bd049f7bec36b0f908c69734a42c5234f=master] + - eigenflags: [+eigen ^eigen@git.2e76277bd049f7bec36b0f908c69734a42c5234f=master, ~eigen] + - common_deps: [catch2@3.8.0] + - libint_tuning: [tune=cp2k-lmax-4] + + # Compiler toolchains for baseline build testing. + # + # See https://spack.readthedocs.io/en/latest/advanced_topics.html#defining-and-using-toolchains + toolchains: + # Force using only gcc@ for C, CXX, and Fortran + gcc14_all: + - spec: '%c=gcc@14' + when: '%c' + - spec: '%cxx=gcc@14' + when: '%cxx' + - spec: '%fortran=gcc@14' + when: '%fortran' + + # Force using only llvm@ for C, CXX, and Fortran + llvm21_all: + - spec: '%c=llvm@21' + when: '%c' + - spec: '%cxx=llvm@21' + when: '%cxx' + - spec: '%fortran=llvm@21' + when: '%fortran' + + # Definition of NWChemEx stack package combinations + specs: + # libint pinning to try to ensure that packages all use the same version + - matrix: + - ['libint@2.6:'] + - [$libint_tuning] + - ['%gcc14_all'] + - matrix: + - [sigma] + - ['@main'] + - ['%gcc14_all'] + - [$eigenflags] + - matrix: + - [utilities] + - ['@master'] + - [$shared] + - ['%gcc14_all'] + - [$^common_deps] + - matrix: + - [parallelzone, pluginplay] + - ['@master'] + - [$shared] + - [$pybindings] + - ['%gcc14_all'] + - [$^common_deps] + - matrix: + - [tensorwrapper] + - ['@master'] + - [$shared] + - [$pybindings] + - [$sigmas] + - ['%gcc14_all'] + - [$^eigens] + - [$^common_deps] + - matrix: + - [chemist, simde, integrals] + - ['@master'] + - [$shared] + - [$pybindings] + - [$sigmas] + - ['%gcc14_all'] + - [$^eigens] + - [$^common_deps] + - matrix: + - [scf] + - ['@master'] + - [$shared] + - [$pybindings] + - ['%gcc14_all'] + - [$^eigens] + - [$^common_deps] + - matrix: + - [chemcache] + - ['@master'] + - [$shared] + - [$pybindings] + - ['%gcc14_all'] + - [$^common_deps] + - matrix: + - [nux] + - ['@master'] + - [$shared] + - [$pybindings] + - ['%gcc14_all'] + - [$^common_deps] + - matrix: + - [friendzone] + - ['@master'] + - [friends=none, 'friends=nwchem,ase'] + - ['%gcc14_all'] + - matrix: + - [nwchemex] + - ['@master'] + - ['%gcc14_all'] + # TODO: Uncomment and provide toolchain path if needed + # env_vars: + # set: + # # Recommended way to set toolchain file for nwchemex.* packages + # CMAKE_TOOLCHAIN_FILE: //toolchain.cmake + view: false + concretizer: + unify: when_possible + # TODO: Uncomment and provide alternative tmp path if needed + # config: + # # Give the tmp directory more room if your /tmp partition is not large + # # enough for 10+ GB compiler builds + # build_stage: ///tmpdir + packages: + gcc: + externals: [] + llvm: + externals: [] + # Likely set by `spack repo add` commands (see README.md) + # repos: + # nwchemex: + # git: https://github.com/NWChemEx/SpackRepos.git + # destination: //nwchemex + # qcuncertainty: + # git: https://github.com/QCUncertainty/spack-repo.git + # destination: //qcuncertainty From d17c92558cc301651ab75f7d8907a146feb2ba55 Mon Sep 17 00:00:00 2001 From: zachcran <15938371+zachcran@users.noreply.github.com> Date: Tue, 3 Feb 2026 14:38:19 -0700 Subject: [PATCH 40/40] Add basic development/testing steps to the README --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index 7948f35..1ef5531 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,28 @@ spack config edit repos For more information, see the Spack's [Search Order and Overriding Packages](https://spack.readthedocs.io/en/latest/repositories.html#search-order-and-overriding-packages). +## Development/Testing + +- Set up the environment + 1. `spack env create nwchemex-stack` + 2. `spack env activate nwchemex-stack` + 3. `spack config edit` + 4. Paste the contents of `nwchemex-stack.yaml` + 5. Check for TODOs in the file +- Concretize the environment packages: `spack concretize` +- Build the packages + - For most packages: `spack install --test=root --fail-fast --verbose --only-concrete ` + - For FriendZone and NWChemEx, exclude `--test=root`: `spack install --fail-fast --verbose --only-concrete ` + +### Tips + +- Run `spack clean` as necessary after failed builds/installs. + - Make sure to clear the Python cache as well for odd import errors: `spack clean -p`. +- If changing the environment package matrices or `package.py` files, you likely need to uninstall any dependant packages from the NWChemEx stack, reconcretize all packages, and build up the stack again. + - `spack uninstall --all ` + - `spack deconcretize` + - `spack concretize --force` + ## Helpful Spack Commands For a broader list of helpful Spack repository management commands, see Spack's [The `spack repo` Command](https://spack.readthedocs.io/en/latest/repositories.html#the-spack-repo-command).