From 345b1231393a3d0b95ef6bf457dff9b1e9f2ee21 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Tue, 17 Mar 2026 10:44:07 -0700 Subject: [PATCH 01/12] Add cardiac-geometriesx --- .github/workflows/spack-matrix.yml | 24 ++++++++ .../py_cardiac_geometries_core/package.py | 52 ++++++++++++++++++ .../py_cardiac_geometriesx/package.py | 55 +++++++++++++++++++ 3 files changed, 131 insertions(+) create mode 100644 spack_repo/scientificcomputing/packages/py_cardiac_geometries_core/package.py create mode 100644 spack_repo/scientificcomputing/packages/py_cardiac_geometriesx/package.py diff --git a/.github/workflows/spack-matrix.yml b/.github/workflows/spack-matrix.yml index 67e0fef..93f32ed 100644 --- a/.github/workflows/spack-matrix.yml +++ b/.github/workflows/spack-matrix.yml @@ -322,3 +322,27 @@ jobs: run: | spack env activate ./env python -c "import circulation" + + py-cardiac-geometriesx: + needs: style-check + runs-on: ubuntu-latest + container: ubuntu:24.04 + strategy: + fail-fast: false + matrix: + version: ["main", "0.2.1"] + spec: [""] + + steps: + - uses: actions/checkout@v6 + with: + path: spack_repos + - uses: ./spack_repos/.github/actions/test-package + with: + spec: py-cardiac-geometriesx@${{ matrix.version }} ${{ matrix.spec }} + + - name: Import test + shell: spack-bash {0} + run: | + spack env activate ./env + python -c "import cardiac_geometriesx" diff --git a/spack_repo/scientificcomputing/packages/py_cardiac_geometries_core/package.py b/spack_repo/scientificcomputing/packages/py_cardiac_geometries_core/package.py new file mode 100644 index 0000000..e228c46 --- /dev/null +++ b/spack_repo/scientificcomputing/packages/py_cardiac_geometries_core/package.py @@ -0,0 +1,52 @@ +# 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-cardiac-geometries-core +# +# You can edit this file again by typing: +# +# spack edit py-cardiac-geometries-core +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack_repo.builtin.build_systems.python import PythonPackage + +from spack.package import * + + +class PyCardiacGeometriesCore(PythonPackage): + """General ODE translator""" + + homepage = "https://computationalphysiology.github.io/cardiac-geometries-core" + git = "https://github.com/ComputationalPhysiology/cardiac-geometries-core.git" + url = "https://github.com/ComputationalPhysiology/cardiac-geometries-core/archive/refs/tags/v1.2.2.tar.gz" + + # notify when the package is updated. + maintainers("finsberg") + + # FIXME: Add the SPDX identifier of the project's license below. + # See https://spdx.org/licenses/ for a list. Upon manually verifying + # the license, set checked_by to your Github username. + license("MIT", checked_by="finsberg") + + version("main", branch="main") + version("1.2.2", sha256="bb7a003474d2f2013dcb2190ca1d30527f1e7aee3626114083f0656dc3830b9d") + + # Python version and Build backend + depends_on("python@3.8:", type=("build", "run")) + depends_on("py-setuptools@61.2:", type="build") + + # Core dependencies + depends_on("py-numpy", type=("build", "run")) + depends_on("py-gmsh", type=("build", "run")) + depends_on("py-rich-click", type=("build", "run")) diff --git a/spack_repo/scientificcomputing/packages/py_cardiac_geometriesx/package.py b/spack_repo/scientificcomputing/packages/py_cardiac_geometriesx/package.py new file mode 100644 index 0000000..a7e6d86 --- /dev/null +++ b/spack_repo/scientificcomputing/packages/py_cardiac_geometriesx/package.py @@ -0,0 +1,55 @@ +# 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-cardiac-geometries-core +# +# You can edit this file again by typing: +# +# spack edit py-cardiac-geometries-core +# +# See the Spack documentation for more information on packaging. +# ---------------------------------------------------------------------------- + +from spack_repo.builtin.build_systems.python import PythonPackage + +from spack.package import * + + +class PyCardiacGeometriesx(PythonPackage): + """General ODE translator""" + + homepage = "https://computationalphysiology.github.io/cardiac-geometriesx" + git = "https://github.com/ComputationalPhysiology/cardiac-geometriesx.git" + url = "https://github.com/ComputationalPhysiology/cardiac-geometriesx/archive/refs/tags/v0.12.0.tar.gz" + + # notify when the package is updated. + maintainers("finsberg") + + # FIXME: Add the SPDX identifier of the project's license below. + # See https://spdx.org/licenses/ for a list. Upon manually verifying + # the license, set checked_by to your Github username. + license("MIT", checked_by="finsberg") + + version("main", branch="main") + version("0.12.0", sha256="93698a5d0d8ac7751c458dde963116a9c050c6d534b45cd034aa13dd668cc904") + + # Python version and Build backend + depends_on("python@3.10:", type=("build", "run")) + depends_on("py-setuptools@61.2:", type="build") + + # Core dependencies + depends_on("py-fenics-dolfinx", type=("build", "run")) + depends_on("py-rich-click", type=("build", "run")) + depends_on("py-cardiac-geometries-core", type=("build", "run")) + depends_on("py-structlog", type=("build", "run")) + depends_on("py-io4dolfinx", type=("build", "run")) + depends_on("py-scifem", type=("build", "run")) From 39627a736685f783e2772478016015e11d6b5c16 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Tue, 17 Mar 2026 11:12:45 -0700 Subject: [PATCH 02/12] Fix version in matrix# --- .github/workflows/spack-matrix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spack-matrix.yml b/.github/workflows/spack-matrix.yml index 93f32ed..7a91b03 100644 --- a/.github/workflows/spack-matrix.yml +++ b/.github/workflows/spack-matrix.yml @@ -330,7 +330,7 @@ jobs: strategy: fail-fast: false matrix: - version: ["main", "0.2.1"] + version: ["main", "0.12.0"] spec: [""] steps: From d9ae147fa2fb86cb8b94ccdfd9c01be381d08722 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Tue, 17 Mar 2026 16:55:44 -0700 Subject: [PATCH 03/12] Fix import --- .github/workflows/spack-matrix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spack-matrix.yml b/.github/workflows/spack-matrix.yml index 7a91b03..954abd1 100644 --- a/.github/workflows/spack-matrix.yml +++ b/.github/workflows/spack-matrix.yml @@ -345,4 +345,4 @@ jobs: shell: spack-bash {0} run: | spack env activate ./env - python -c "import cardiac_geometriesx" + python -c "import cardiac_geometries" From 66ef5ff115382269575881fbbe022b264aced7a7 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Wed, 18 Mar 2026 09:11:29 -0700 Subject: [PATCH 04/12] Add spec --- .github/workflows/spack-matrix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/spack-matrix.yml b/.github/workflows/spack-matrix.yml index 954abd1..52f201b 100644 --- a/.github/workflows/spack-matrix.yml +++ b/.github/workflows/spack-matrix.yml @@ -331,7 +331,7 @@ jobs: fail-fast: false matrix: version: ["main", "0.12.0"] - spec: [""] + spec: ["^py-fenics-dolfinx%c,cxx=gcc@13.3.0"] steps: - uses: actions/checkout@v6 From 33b4adbf77c9140bd347233dc0bc235adc00ac9f Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Tue, 24 Mar 2026 14:48:17 +0100 Subject: [PATCH 05/12] io4dolfinx requires fenicsx v0.10 --- .../scientificcomputing/packages/py_io4dolfinx/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spack_repo/scientificcomputing/packages/py_io4dolfinx/package.py b/spack_repo/scientificcomputing/packages/py_io4dolfinx/package.py index 0f30710..7f5658e 100644 --- a/spack_repo/scientificcomputing/packages/py_io4dolfinx/package.py +++ b/spack_repo/scientificcomputing/packages/py_io4dolfinx/package.py @@ -37,7 +37,7 @@ class PyIo4dolfinx(PythonPackage): depends_on("cxx", type="build") - depends_on("py-fenics-dolfinx@0.9:", when="@1.1:", type="run") + depends_on("py-fenics-dolfinx@0.10:", when="@1.1:", type="run") depends_on("py-fenics-dolfinx@main", when="@main", type="run") depends_on("py-numpy", type="run") depends_on("py-packaging", type="run") From c99af22010695e02d519e8951d6bd8d6c9bec737 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Tue, 24 Mar 2026 14:48:55 +0100 Subject: [PATCH 06/12] Add adios4dolfinx for old versions of cardiac-geometries --- .../packages/py_cardiac_geometriesx/package.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spack_repo/scientificcomputing/packages/py_cardiac_geometriesx/package.py b/spack_repo/scientificcomputing/packages/py_cardiac_geometriesx/package.py index a7e6d86..b90a927 100644 --- a/spack_repo/scientificcomputing/packages/py_cardiac_geometriesx/package.py +++ b/spack_repo/scientificcomputing/packages/py_cardiac_geometriesx/package.py @@ -51,5 +51,7 @@ class PyCardiacGeometriesx(PythonPackage): depends_on("py-rich-click", type=("build", "run")) depends_on("py-cardiac-geometries-core", type=("build", "run")) depends_on("py-structlog", type=("build", "run")) - depends_on("py-io4dolfinx", type=("build", "run")) + + depends_on("py-io4dolfinx", type=("build", "run"), when="@main:") + depends_on("py-adios4dolfinx", type=("build", "run"), when="@:0.12") depends_on("py-scifem", type=("build", "run")) From d0641a0b85d13548dc1ed3560bd4831913250139 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Tue, 24 Mar 2026 19:55:05 +0100 Subject: [PATCH 07/12] Pin gmsh and require zdios2 --- .../py_cardiac_geometries_core/package.py | 2 +- .../packages/py_cardiac_geometriesx/package.py | 2 +- .../packages/py_io4dolfinx/package.py | 18 +++++++++--------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/spack_repo/scientificcomputing/packages/py_cardiac_geometries_core/package.py b/spack_repo/scientificcomputing/packages/py_cardiac_geometries_core/package.py index e228c46..20aed2c 100644 --- a/spack_repo/scientificcomputing/packages/py_cardiac_geometries_core/package.py +++ b/spack_repo/scientificcomputing/packages/py_cardiac_geometries_core/package.py @@ -48,5 +48,5 @@ class PyCardiacGeometriesCore(PythonPackage): # Core dependencies depends_on("py-numpy", type=("build", "run")) - depends_on("py-gmsh", type=("build", "run")) + depends_on("py-gmsh@4.13.1 ^gmsh@4.13.1", type=("build", "run")) depends_on("py-rich-click", type=("build", "run")) diff --git a/spack_repo/scientificcomputing/packages/py_cardiac_geometriesx/package.py b/spack_repo/scientificcomputing/packages/py_cardiac_geometriesx/package.py index b90a927..1d578ce 100644 --- a/spack_repo/scientificcomputing/packages/py_cardiac_geometriesx/package.py +++ b/spack_repo/scientificcomputing/packages/py_cardiac_geometriesx/package.py @@ -52,6 +52,6 @@ class PyCardiacGeometriesx(PythonPackage): depends_on("py-cardiac-geometries-core", type=("build", "run")) depends_on("py-structlog", type=("build", "run")) - depends_on("py-io4dolfinx", type=("build", "run"), when="@main:") + depends_on("py-io4dolfinx+adios2+xdmf", type=("build", "run"), when="@main:") depends_on("py-adios4dolfinx", type=("build", "run"), when="@:0.12") depends_on("py-scifem", type=("build", "run")) diff --git a/spack_repo/scientificcomputing/packages/py_io4dolfinx/package.py b/spack_repo/scientificcomputing/packages/py_io4dolfinx/package.py index 7f5658e..55ffed4 100644 --- a/spack_repo/scientificcomputing/packages/py_io4dolfinx/package.py +++ b/spack_repo/scientificcomputing/packages/py_io4dolfinx/package.py @@ -37,25 +37,25 @@ class PyIo4dolfinx(PythonPackage): depends_on("cxx", type="build") - depends_on("py-fenics-dolfinx@0.10:", when="@1.1:", type="run") - depends_on("py-fenics-dolfinx@main", when="@main", type="run") - depends_on("py-numpy", type="run") - depends_on("py-packaging", type="run") + depends_on("py-fenics-dolfinx@0.10:", when="@1.1:", type=("build", "run")) + depends_on("py-fenics-dolfinx@main", when="@main", type=("build", "run")) + depends_on("py-numpy", type=("build", "run")) + depends_on("py-packaging", type=("build", "run")) depends_on("py-setuptools@42:", type="build") with when("+adios2"): depends_on("adios2@2.9:+python+hdf5+mpi", type=("build", "run")) depends_on( - "hdf5@1.12:", type="build" + "hdf5@1.12:", type=("build", "run") ) # NOTE: Remove when https://github.com/spack/spack-packages/issues/3566 is resolved with when("+h5py"): - depends_on("py-h5py+mpi", type="run") + depends_on("py-h5py+mpi", type=("build", "run")) with when("+vtkhdf"): - depends_on("py-h5py+mpi", type="run") + depends_on("py-h5py+mpi", type=("build", "run")) with when("+xdmf"): - depends_on("py-h5py+mpi", type="run") + depends_on("py-h5py+mpi", type=("build", "run")) with when("+pyvista"): - depends_on("py-pyvista", type="run") + depends_on("py-pyvista", type=("build", "run")) From dc3f955c27ac0e77758f7abcf5de4ecd2d2d5d57 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Wed, 25 Mar 2026 08:48:12 +0100 Subject: [PATCH 08/12] Make gmsh dependency explicit --- .../packages/py_cardiac_geometries_core/package.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spack_repo/scientificcomputing/packages/py_cardiac_geometries_core/package.py b/spack_repo/scientificcomputing/packages/py_cardiac_geometries_core/package.py index 20aed2c..2f76a6d 100644 --- a/spack_repo/scientificcomputing/packages/py_cardiac_geometries_core/package.py +++ b/spack_repo/scientificcomputing/packages/py_cardiac_geometries_core/package.py @@ -48,5 +48,6 @@ class PyCardiacGeometriesCore(PythonPackage): # Core dependencies depends_on("py-numpy", type=("build", "run")) - depends_on("py-gmsh@4.13.1 ^gmsh@4.13.1", type=("build", "run")) + depends_on("py-gmsh@:4.13.1", type=("build", "run")) + depends_on("gmsh@:4.13.1", type=("build", "run")) depends_on("py-rich-click", type=("build", "run")) From e9abb8a3c06dcc17195d7810ba4ac4244e6bc845 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Wed, 25 Mar 2026 14:45:18 +0100 Subject: [PATCH 09/12] Disable fltk --- .../packages/py_cardiac_geometries_core/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spack_repo/scientificcomputing/packages/py_cardiac_geometries_core/package.py b/spack_repo/scientificcomputing/packages/py_cardiac_geometries_core/package.py index 2f76a6d..d848306 100644 --- a/spack_repo/scientificcomputing/packages/py_cardiac_geometries_core/package.py +++ b/spack_repo/scientificcomputing/packages/py_cardiac_geometries_core/package.py @@ -49,5 +49,5 @@ class PyCardiacGeometriesCore(PythonPackage): # Core dependencies depends_on("py-numpy", type=("build", "run")) depends_on("py-gmsh@:4.13.1", type=("build", "run")) - depends_on("gmsh@:4.13.1", type=("build", "run")) + depends_on("gmsh@:4.13.1 ~fltk", type=("build", "run")) depends_on("py-rich-click", type=("build", "run")) From 67024849d80d26aff31232fd29afc892fa58f84b Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Wed, 25 Mar 2026 19:10:21 +0100 Subject: [PATCH 10/12] mesa-glu --- .../packages/py_cardiac_geometries_core/package.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spack_repo/scientificcomputing/packages/py_cardiac_geometries_core/package.py b/spack_repo/scientificcomputing/packages/py_cardiac_geometries_core/package.py index d848306..4d0190e 100644 --- a/spack_repo/scientificcomputing/packages/py_cardiac_geometries_core/package.py +++ b/spack_repo/scientificcomputing/packages/py_cardiac_geometries_core/package.py @@ -49,5 +49,9 @@ class PyCardiacGeometriesCore(PythonPackage): # Core dependencies depends_on("py-numpy", type=("build", "run")) depends_on("py-gmsh@:4.13.1", type=("build", "run")) - depends_on("gmsh@:4.13.1 ~fltk", type=("build", "run")) + depends_on("gmsh@:4.13.1", type=("build", "run")) + # OpenGL dependency for gmsh + depends_on("mesa-glu", type=("build", "run")) + # X11 library + depends_on("libxcursor", type=("build", "run")) depends_on("py-rich-click", type=("build", "run")) From 10a0c253e82e1cba79778b194ff09df85f7c3eb2 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 26 Mar 2026 08:48:38 +0100 Subject: [PATCH 11/12] Add more X11 libraries --- .../packages/py_cardiac_geometries_core/package.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spack_repo/scientificcomputing/packages/py_cardiac_geometries_core/package.py b/spack_repo/scientificcomputing/packages/py_cardiac_geometries_core/package.py index 4d0190e..2a25710 100644 --- a/spack_repo/scientificcomputing/packages/py_cardiac_geometries_core/package.py +++ b/spack_repo/scientificcomputing/packages/py_cardiac_geometries_core/package.py @@ -47,6 +47,7 @@ class PyCardiacGeometriesCore(PythonPackage): depends_on("py-setuptools@61.2:", type="build") # Core dependencies + depends_on("py-rich-click", type=("build", "run")) depends_on("py-numpy", type=("build", "run")) depends_on("py-gmsh@:4.13.1", type=("build", "run")) depends_on("gmsh@:4.13.1", type=("build", "run")) @@ -54,4 +55,6 @@ class PyCardiacGeometriesCore(PythonPackage): depends_on("mesa-glu", type=("build", "run")) # X11 library depends_on("libxcursor", type=("build", "run")) - depends_on("py-rich-click", type=("build", "run")) + depends_on("libxft", type=("build", "run")) + depends_on("libxrender", type=("build", "run")) + depends_on("libxinerama", type=("build", "run")) From d568e70bbe2bfe9f2feb1c190ff7a9177aeafbba Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Thu, 26 Mar 2026 13:43:31 +0100 Subject: [PATCH 12/12] Add fenics with petsc4py --- .../packages/py_cardiac_geometriesx/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spack_repo/scientificcomputing/packages/py_cardiac_geometriesx/package.py b/spack_repo/scientificcomputing/packages/py_cardiac_geometriesx/package.py index 1d578ce..defa235 100644 --- a/spack_repo/scientificcomputing/packages/py_cardiac_geometriesx/package.py +++ b/spack_repo/scientificcomputing/packages/py_cardiac_geometriesx/package.py @@ -47,7 +47,7 @@ class PyCardiacGeometriesx(PythonPackage): depends_on("py-setuptools@61.2:", type="build") # Core dependencies - depends_on("py-fenics-dolfinx", type=("build", "run")) + depends_on("py-fenics-dolfinx+petsc4py", type=("build", "run")) depends_on("py-rich-click", type=("build", "run")) depends_on("py-cardiac-geometries-core", type=("build", "run")) depends_on("py-structlog", type=("build", "run"))