From 5526f39bfd4d2da05a82a5323761012aaf0dbcb0 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Sun, 29 Mar 2026 19:59:46 +0200 Subject: [PATCH 1/2] Add fenicsx-pulse --- .github/workflows/spack-matrix.yml | 24 ++++++++++++ .../packages/py_fenicsx_beat/package.py | 24 ++++++------ .../packages/py_fenicsx_pulse/package.py | 39 +++++++++++++++++++ 3 files changed, 75 insertions(+), 12 deletions(-) create mode 100644 spack_repo/scientificcomputing/packages/py_fenicsx_pulse/package.py diff --git a/.github/workflows/spack-matrix.yml b/.github/workflows/spack-matrix.yml index 52f201b..d2706c9 100644 --- a/.github/workflows/spack-matrix.yml +++ b/.github/workflows/spack-matrix.yml @@ -346,3 +346,27 @@ jobs: run: | spack env activate ./env python -c "import cardiac_geometries" + + py-fenicsx-pulse: + needs: style-check + runs-on: ubuntu-latest + container: ubuntu:24.04 + strategy: + fail-fast: false + matrix: + version: ["main", "0.6.0"] + spec: ["^py-fenics-dolfinx%c,cxx=gcc@13.3.0"] + + steps: + - uses: actions/checkout@v6 + with: + path: spack_repos + - uses: ./spack_repos/.github/actions/test-package + with: + spec: py-fenicsx-pulse@${{ matrix.version }} ${{ matrix.spec }} + + - name: Import test + shell: spack-bash {0} + run: | + spack env activate ./env + python -c "import pulse" diff --git a/spack_repo/scientificcomputing/packages/py_fenicsx_beat/package.py b/spack_repo/scientificcomputing/packages/py_fenicsx_beat/package.py index 134ab7f..8991f99 100644 --- a/spack_repo/scientificcomputing/packages/py_fenicsx_beat/package.py +++ b/spack_repo/scientificcomputing/packages/py_fenicsx_beat/package.py @@ -25,15 +25,15 @@ class PyFenicsxBeat(PythonPackage): depends_on("py-setuptools@42:", type="build") - depends_on("py-fenics-dolfinx@0.10:+petsc4py", when="@0.2:", type="run") - depends_on("py-fenics-dolfinx@main+petsc4py", when="@main", type="run") - depends_on("py-fenics-basix", type="run") - depends_on("py-fenics-ufl", type="run") - depends_on("py-mpi4py", type="run") - depends_on("py-scifem", type="run") - depends_on("petsc+mumps", type="run") - depends_on("py-numpy", type="run") - depends_on("py-packaging", type="run") - depends_on("py-rich", type="run") - depends_on("py-pint", type="run") - depends_on("py-scipy", type="run") + depends_on("py-fenics-dolfinx@0.10:+petsc4py", when="@0.2:", type=("build", "run")) + depends_on("py-fenics-dolfinx@main+petsc4py", when="@main", type=("build", "run")) + depends_on("py-fenics-basix", type=("build", "run")) + depends_on("py-fenics-ufl", type=("build", "run")) + depends_on("py-mpi4py", type=("build", "run")) + depends_on("py-scifem", type=("build", "run")) + depends_on("petsc+mumps", type=("build", "run")) + depends_on("py-numpy", type=("build", "run")) + depends_on("py-packaging", type=("build", "run")) + depends_on("py-rich", type=("build", "run")) + depends_on("py-pint", type=("build", "run")) + depends_on("py-scipy", type=("build", "run")) diff --git a/spack_repo/scientificcomputing/packages/py_fenicsx_pulse/package.py b/spack_repo/scientificcomputing/packages/py_fenicsx_pulse/package.py new file mode 100644 index 0000000..1b8834d --- /dev/null +++ b/spack_repo/scientificcomputing/packages/py_fenicsx_pulse/package.py @@ -0,0 +1,39 @@ +# Copyright Spack Project Developers. See COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +from spack_repo.builtin.build_systems.python import PythonPackage + +from spack.package import * + + +class PyFenicsxPulse(PythonPackage): + """Library to run cardiac mechanics simulations in FEniCSx""" + + homepage = "https://finsberg.github.io/fenicsx-pulse/" + url = "https://github.com/finsberg/fenicsx-pulse/archive/refs/tags/v0.6.0.tar.gz" + git = "https://github.com/finsberg/fenicsx-pulse.git" + + maintainers("finsberg") + + license("MIT", checked_by="finsberg") + + version("main", branch="main") + version("0.6.0", sha256="fddfb2fa554e6537b8205a1a7806549fbbd5b55cb913338387f54f27bef87818") + + depends_on("python@3.10:", type=("build", "run")) + + depends_on("py-setuptools@42:", type="build") + + depends_on("py-fenics-dolfinx +petsc4py", when="@main", type=("build", "run")) + depends_on("py-fenics-basix", type=("build", "run")) + depends_on("py-fenics-ufl", type=("build", "run")) + depends_on("py-mpi4py", type=("build", "run")) + depends_on("py-scifem", type=("build", "run")) + depends_on("petsc+mumps", type=("build", "run")) + depends_on("py-numpy", type=("build", "run")) + depends_on("py-packaging", type=("build", "run")) + depends_on("py-rich", type=("build", "run")) + depends_on("py-pint", type=("build", "run")) + depends_on("py-scipy", type=("build", "run")) + depends_on("py-rich-argparse", type=("build", "run")) From 14f7fafef947fca95052c986ed526f38a6ba87b5 Mon Sep 17 00:00:00 2001 From: Henrik Finsberg Date: Sun, 29 Mar 2026 20:23:32 +0200 Subject: [PATCH 2/2] Skip conditions when=@main --- .../scientificcomputing/packages/py_fenicsx_pulse/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spack_repo/scientificcomputing/packages/py_fenicsx_pulse/package.py b/spack_repo/scientificcomputing/packages/py_fenicsx_pulse/package.py index 1b8834d..3a35ef6 100644 --- a/spack_repo/scientificcomputing/packages/py_fenicsx_pulse/package.py +++ b/spack_repo/scientificcomputing/packages/py_fenicsx_pulse/package.py @@ -25,7 +25,7 @@ class PyFenicsxPulse(PythonPackage): depends_on("py-setuptools@42:", type="build") - depends_on("py-fenics-dolfinx +petsc4py", when="@main", type=("build", "run")) + depends_on("py-fenics-dolfinx +petsc4py", type=("build", "run")) depends_on("py-fenics-basix", type=("build", "run")) depends_on("py-fenics-ufl", type=("build", "run")) depends_on("py-mpi4py", type=("build", "run"))