From f267a85327edc61b911881f7396728634580821d Mon Sep 17 00:00:00 2001 From: schnellerhase <56360279+schnellerhase@users.noreply.github.com> Date: Sun, 19 Oct 2025 13:51:41 +0200 Subject: [PATCH 01/15] Remove build-requirements --- .github/workflows/ccpp.yml | 7 +++---- .github/workflows/clang-tidy.yml | 2 +- .github/workflows/macos.yml | 2 +- .github/workflows/windows.yml | 3 +-- README.md | 2 +- docker/Dockerfile.end-user | 2 +- python/README.md | 2 +- python/build-requirements.txt | 4 ---- python/doc/source/installation.rst | 2 +- python/pyproject.toml | 1 - 10 files changed, 10 insertions(+), 17 deletions(-) delete mode 100644 python/build-requirements.txt diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 71de2b0bf66..9f64121bccf 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -93,8 +93,7 @@ jobs: python-version: "3.12" - name: Install Python build dependencies - run: | - pip -v install --upgrade -r python/build-requirements.txt + run: python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install - name: Install FEniCS Python components run: | @@ -187,7 +186,7 @@ jobs: run: cat .github/workflows/fenicsx-refs.env >> $GITHUB_ENV - name: Install Python build dependencies - run: pip install -r python/build-requirements.txt + run: python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install - name: Install FEniCS Python components run: | @@ -294,7 +293,7 @@ jobs: - name: Install FEniCS Python components run: | - pip install -r python/build-requirements.txt + run: python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install pip install --no-build-isolation git+https://github.com/${{ env.ufl_repository }}.git@${{ env.ufl_ref }} pip install --no-build-isolation git+https://github.com/${{ env.basix_repository }}.git@${{ env.basix_ref }} pip install --no-build-isolation git+https://github.com/${{ env.ffcx_repository }}.git@${{ env.ffcx_ref }} diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index 175b7e1fd26..cd5cff70ac6 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -33,7 +33,7 @@ jobs: run: | apt-get update apt-get install -y clang-tidy catch2 - pip install -r python/build-requirements.txt + python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install - name: Load environment variables run: cat .github/workflows/fenicsx-refs.env >> $GITHUB_ENV diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index fd96c6c67a2..849136f117e 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -107,7 +107,7 @@ jobs: - name: Build and install DOLFINx Python interface run: | - pip install -r python/build-requirements.txt + python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install pip install --check-build-dependencies --no-build-isolation 'python/[test]' - name: Basic test diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index f439017f100..d4a6911d713 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -144,8 +144,7 @@ jobs: - name: Install DOLFINx Python build dependencies working-directory: dolfinx-src/python - run: | - pip -v install --no-binary mpi4py -r build-requirements.txt + run: python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install - name: Install DOLFINx (Python) working-directory: dolfinx-src/python diff --git a/README.md b/README.md index f2955b59173..63bdf1fed6a 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ To install the Python interface, first install the C++ core, and then in the `python/` directory run: ```shell -pip install -r build-requirements.txt +python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install pip install --check-build-dependencies --no-build-isolation . ``` diff --git a/docker/Dockerfile.end-user b/docker/Dockerfile.end-user index 8942553c144..b915d3c1daf 100644 --- a/docker/Dockerfile.end-user +++ b/docker/Dockerfile.end-user @@ -71,7 +71,7 @@ ONBUILD ARG DOLFINX_CMAKE_BUILD_TYPE="Release" # Using pip install `.[test]` with --no-dependencies and --no-build-isolation # does not install necessary packages, hence install build and optional # dependencies manually here. -ONBUILD RUN pip install --no-cache-dir -r dolfinx/python/build-requirements.txt && \ +ONBUILD RUN python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install && \ pip install --no-cache-dir pyamg pytest scipy matplotlib numba # test + optional set # The dolfinx-onbuild container expects to have folders basix/ ufl/ diff --git a/python/README.md b/python/README.md index 446911e9e68..a77e3530de7 100644 --- a/python/README.md +++ b/python/README.md @@ -6,7 +6,7 @@ Below is guidance for building the DOLFINx Python interface. 2. Ensure the Python interface build requirements are installed: - pip install -r build-requirements.txt + python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install 3. Build DOLFINx Python interface: diff --git a/python/build-requirements.txt b/python/build-requirements.txt deleted file mode 100644 index 5c54a707e1f..00000000000 --- a/python/build-requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -nanobind>=2.5.0 -scikit-build-core[pyproject]>=0.10 -mpi4py -setuptools diff --git a/python/doc/source/installation.rst b/python/doc/source/installation.rst index d6663fae380..c661c08cf52 100644 --- a/python/doc/source/installation.rst +++ b/python/doc/source/installation.rst @@ -105,7 +105,7 @@ Python After installation of the C++ interface, from the ``python/`` directory the Python interface can be installed using:: - pip install -r build-requirements.txt + python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install pip install --check-build-dependencies --no-build-isolation . diff --git a/python/pyproject.toml b/python/pyproject.toml index cbc80c2abed..39228e84e12 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -3,7 +3,6 @@ # system built petsc4py and mpi4py. # NOTE: petsc4py is an optional build dependency, therefore we don't # list it here. -# pip install -r build-requirements.txt [build-system] requires = ["scikit-build-core[pyproject]>=0.10", "nanobind>=2.5.0", "mpi4py"] build-backend = "scikit_build_core.build" From fb77acf37cb23c9a5d4ab038f8f7d0685f1d683c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20T=2E=20K=C3=BChner?= <56360279+schnellerhase@users.noreply.github.com> Date: Sun, 19 Oct 2025 13:53:12 +0200 Subject: [PATCH 02/15] Apply suggestion from @schnellerhase --- .github/workflows/ccpp.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 9f64121bccf..fafc1fda7e6 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -293,7 +293,7 @@ jobs: - name: Install FEniCS Python components run: | - run: python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install + python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install pip install --no-build-isolation git+https://github.com/${{ env.ufl_repository }}.git@${{ env.ufl_ref }} pip install --no-build-isolation git+https://github.com/${{ env.basix_repository }}.git@${{ env.basix_ref }} pip install --no-build-isolation git+https://github.com/${{ env.ffcx_repository }}.git@${{ env.ffcx_ref }} From e660d3493410c9c5039599f9428952414cf9290f Mon Sep 17 00:00:00 2001 From: schnellerhase <56360279+schnellerhase@users.noreply.github.com> Date: Sun, 19 Oct 2025 14:09:05 +0200 Subject: [PATCH 03/15] Fine tune --- .github/workflows/ccpp.yml | 7 ++++++- .github/workflows/clang-tidy.yml | 5 ++++- .github/workflows/windows.yml | 4 +++- docker/Dockerfile.end-user | 3 ++- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index fafc1fda7e6..795ac657c3b 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -93,6 +93,7 @@ jobs: python-version: "3.12" - name: Install Python build dependencies + working-directory: python run: python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install - name: Install FEniCS Python components @@ -186,6 +187,7 @@ jobs: run: cat .github/workflows/fenicsx-refs.env >> $GITHUB_ENV - name: Install Python build dependencies + working-directory: python run: python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install - name: Install FEniCS Python components @@ -291,9 +293,12 @@ jobs: - name: Load environment variables run: cat .github/workflows/fenicsx-refs.env >> $GITHUB_ENV + - name: Install Python build dependencies + working-directory: python + run: python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install + - name: Install FEniCS Python components run: | - python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install pip install --no-build-isolation git+https://github.com/${{ env.ufl_repository }}.git@${{ env.ufl_ref }} pip install --no-build-isolation git+https://github.com/${{ env.basix_repository }}.git@${{ env.basix_ref }} pip install --no-build-isolation git+https://github.com/${{ env.ffcx_repository }}.git@${{ env.ffcx_ref }} diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index cd5cff70ac6..4e1df9b6301 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -33,7 +33,10 @@ jobs: run: | apt-get update apt-get install -y clang-tidy catch2 - python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install + + - name: Install Python build dependencies + working-directory: python + run: python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install - name: Load environment variables run: cat .github/workflows/fenicsx-refs.env >> $GITHUB_ENV diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d4a6911d713..ca6ee51fe76 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -144,7 +144,9 @@ jobs: - name: Install DOLFINx Python build dependencies working-directory: dolfinx-src/python - run: python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install + run: | + python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install + pip install --no-binary mpi4py - name: Install DOLFINx (Python) working-directory: dolfinx-src/python diff --git a/docker/Dockerfile.end-user b/docker/Dockerfile.end-user index b915d3c1daf..3de08dda699 100644 --- a/docker/Dockerfile.end-user +++ b/docker/Dockerfile.end-user @@ -71,7 +71,8 @@ ONBUILD ARG DOLFINX_CMAKE_BUILD_TYPE="Release" # Using pip install `.[test]` with --no-dependencies and --no-build-isolation # does not install necessary packages, hence install build and optional # dependencies manually here. -ONBUILD RUN python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install && \ +ONBUILD RUN cd dolfinx/python && + python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install --no-cache-dir && \ pip install --no-cache-dir pyamg pytest scipy matplotlib numba # test + optional set # The dolfinx-onbuild container expects to have folders basix/ ufl/ From e48f6ace1f915010399fc2bad985d2afef8c6881 Mon Sep 17 00:00:00 2001 From: schnellerhase <56360279+schnellerhase@users.noreply.github.com> Date: Sun, 19 Oct 2025 14:16:42 +0200 Subject: [PATCH 04/15] Install scikit before --- .github/workflows/ccpp.yml | 12 +++++++++--- .github/workflows/clang-tidy.yml | 4 +++- docker/Dockerfile.end-user | 1 + 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 795ac657c3b..12c33eabfde 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -94,7 +94,9 @@ jobs: - name: Install Python build dependencies working-directory: python - run: python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install + run: | + pip install scikit-build-core + python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install - name: Install FEniCS Python components run: | @@ -188,7 +190,9 @@ jobs: - name: Install Python build dependencies working-directory: python - run: python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install + run: | + pip install scikit-build-core + python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install - name: Install FEniCS Python components run: | @@ -295,7 +299,9 @@ jobs: - name: Install Python build dependencies working-directory: python - run: python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install + run: | + pip install scikit-build-core + python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install - name: Install FEniCS Python components run: | diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index 4e1df9b6301..24eae060b1a 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -36,7 +36,9 @@ jobs: - name: Install Python build dependencies working-directory: python - run: python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install + run: | + pip install scikit-build-core + python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install - name: Load environment variables run: cat .github/workflows/fenicsx-refs.env >> $GITHUB_ENV diff --git a/docker/Dockerfile.end-user b/docker/Dockerfile.end-user index 3de08dda699..edfb3d7c8ba 100644 --- a/docker/Dockerfile.end-user +++ b/docker/Dockerfile.end-user @@ -72,6 +72,7 @@ ONBUILD ARG DOLFINX_CMAKE_BUILD_TYPE="Release" # does not install necessary packages, hence install build and optional # dependencies manually here. ONBUILD RUN cd dolfinx/python && + pip install --no-cache-dir scikit-build-core && python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install --no-cache-dir && \ pip install --no-cache-dir pyamg pytest scipy matplotlib numba # test + optional set From 9de6d0579aa44fb4f6ac451a9877ddfd22a85142 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20T=2E=20K=C3=BChner?= <56360279+schnellerhase@users.noreply.github.com> Date: Sun, 19 Oct 2025 14:22:03 +0200 Subject: [PATCH 05/15] Apply suggestions from code review --- .github/workflows/ccpp.yml | 6 +++--- .github/workflows/clang-tidy.yml | 2 +- .github/workflows/macos.yml | 2 +- .github/workflows/windows.yml | 2 +- README.md | 2 +- docker/Dockerfile.end-user | 2 +- python/README.md | 2 +- python/doc/source/installation.rst | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 12c33eabfde..4f868e827e2 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -96,7 +96,7 @@ jobs: working-directory: python run: | pip install scikit-build-core - python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install + python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install - name: Install FEniCS Python components run: | @@ -192,7 +192,7 @@ jobs: working-directory: python run: | pip install scikit-build-core - python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install + python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install - name: Install FEniCS Python components run: | @@ -301,7 +301,7 @@ jobs: working-directory: python run: | pip install scikit-build-core - python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install + python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install - name: Install FEniCS Python components run: | diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index 24eae060b1a..6f2f363a978 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -38,7 +38,7 @@ jobs: working-directory: python run: | pip install scikit-build-core - python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install + python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install - name: Load environment variables run: cat .github/workflows/fenicsx-refs.env >> $GITHUB_ENV diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 849136f117e..08886ca84ca 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -107,7 +107,7 @@ jobs: - name: Build and install DOLFINx Python interface run: | - python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install + python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install pip install --check-build-dependencies --no-build-isolation 'python/[test]' - name: Basic test diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index ca6ee51fe76..02d44f6387a 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -145,7 +145,7 @@ jobs: - name: Install DOLFINx Python build dependencies working-directory: dolfinx-src/python run: | - python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install + python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install pip install --no-binary mpi4py - name: Install DOLFINx (Python) diff --git a/README.md b/README.md index 63bdf1fed6a..4fa399ce4ba 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ To install the Python interface, first install the C++ core, and then in the `python/` directory run: ```shell -python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install +python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install pip install --check-build-dependencies --no-build-isolation . ``` diff --git a/docker/Dockerfile.end-user b/docker/Dockerfile.end-user index edfb3d7c8ba..ebbbe32a855 100644 --- a/docker/Dockerfile.end-user +++ b/docker/Dockerfile.end-user @@ -73,7 +73,7 @@ ONBUILD ARG DOLFINX_CMAKE_BUILD_TYPE="Release" # dependencies manually here. ONBUILD RUN cd dolfinx/python && pip install --no-cache-dir scikit-build-core && - python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install --no-cache-dir && \ + python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install --no-cache-dir && \ pip install --no-cache-dir pyamg pytest scipy matplotlib numba # test + optional set # The dolfinx-onbuild container expects to have folders basix/ ufl/ diff --git a/python/README.md b/python/README.md index a77e3530de7..ddba8333a3a 100644 --- a/python/README.md +++ b/python/README.md @@ -6,7 +6,7 @@ Below is guidance for building the DOLFINx Python interface. 2. Ensure the Python interface build requirements are installed: - python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install + python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install 3. Build DOLFINx Python interface: diff --git a/python/doc/source/installation.rst b/python/doc/source/installation.rst index c661c08cf52..27d063fdfc7 100644 --- a/python/doc/source/installation.rst +++ b/python/doc/source/installation.rst @@ -105,7 +105,7 @@ Python After installation of the C++ interface, from the ``python/`` directory the Python interface can be installed using:: - python -m scikit_build_core.build requires | python -c "import sys, json; print(', '.join(json.load(sys.stdin)))" | xargs pip install + python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install pip install --check-build-dependencies --no-build-isolation . From 7dbc438ecfb75effa0bd8dc0f60160e31c228461 Mon Sep 17 00:00:00 2001 From: schnellerhase <56360279+schnellerhase@users.noreply.github.com> Date: Sun, 19 Oct 2025 14:31:09 +0200 Subject: [PATCH 06/15] Align build dependencies --- python/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/pyproject.toml b/python/pyproject.toml index 39228e84e12..87c271506d3 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -4,7 +4,7 @@ # NOTE: petsc4py is an optional build dependency, therefore we don't # list it here. [build-system] -requires = ["scikit-build-core[pyproject]>=0.10", "nanobind>=2.5.0", "mpi4py"] +requires = ["scikit-build-core[pyproject]>=0.10", "nanobind>=2.5.0", "mpi4py", "setuptools"] build-backend = "scikit_build_core.build" [project] From 7429c54c961fa41c64b48f8152f27ad3d8d966e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20T=2E=20K=C3=BChner?= <56360279+schnellerhase@users.noreply.github.com> Date: Sun, 19 Oct 2025 14:55:56 +0200 Subject: [PATCH 07/15] Apply suggestions from code review --- .github/workflows/macos.yml | 1 + .github/workflows/windows.yml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 08886ca84ca..be983709ad7 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -107,6 +107,7 @@ jobs: - name: Build and install DOLFINx Python interface run: | + pip install scikit-build-core python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install pip install --check-build-dependencies --no-build-isolation 'python/[test]' diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 02d44f6387a..a3d487e3b69 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -144,7 +144,8 @@ jobs: - name: Install DOLFINx Python build dependencies working-directory: dolfinx-src/python - run: | + run: | + pip install scikit-build-core python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install pip install --no-binary mpi4py From 02feca24bb59634a1e69774b3bceceae96a7c587 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20T=2E=20K=C3=BChner?= <56360279+schnellerhase@users.noreply.github.com> Date: Sun, 19 Oct 2025 15:20:20 +0200 Subject: [PATCH 08/15] Apply suggestions from code review --- .github/workflows/macos.yml | 1 + .github/workflows/windows.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index be983709ad7..a6f2c3c56f2 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -106,6 +106,7 @@ jobs: mpiexec -np 3 ctest -V --output-on-failure -R unittests - name: Build and install DOLFINx Python interface + working-directory: python run: | pip install scikit-build-core python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index a3d487e3b69..d0c0f2cf0e3 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -145,7 +145,7 @@ jobs: - name: Install DOLFINx Python build dependencies working-directory: dolfinx-src/python run: | - pip install scikit-build-core + pip install scikit-build-core python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install pip install --no-binary mpi4py From 505e340339e6e468891edcf31f584eace2e6a39f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20T=2E=20K=C3=BChner?= <56360279+schnellerhase@users.noreply.github.com> Date: Sun, 19 Oct 2025 15:51:30 +0200 Subject: [PATCH 09/15] Update .github/workflows/macos.yml --- .github/workflows/macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index a6f2c3c56f2..20df2e5c283 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -110,7 +110,7 @@ jobs: run: | pip install scikit-build-core python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install - pip install --check-build-dependencies --no-build-isolation 'python/[test]' + pip install --check-build-dependencies --no-build-isolation './[test]' - name: Basic test run: | From a06f6331e188ca8723f985ab35c0fc649de4e0ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20T=2E=20K=C3=BChner?= <56360279+schnellerhase@users.noreply.github.com> Date: Sun, 19 Oct 2025 17:36:45 +0200 Subject: [PATCH 10/15] Apply suggestions from code review --- README.md | 1 + python/README.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 4fa399ce4ba..93cb18af8bf 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ To install the Python interface, first install the C++ core, and then in the `python/` directory run: ```shell +pip install scikit-build-core python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install pip install --check-build-dependencies --no-build-isolation . ``` diff --git a/python/README.md b/python/README.md index ddba8333a3a..282724a142f 100644 --- a/python/README.md +++ b/python/README.md @@ -6,6 +6,7 @@ Below is guidance for building the DOLFINx Python interface. 2. Ensure the Python interface build requirements are installed: + pip install scikit-build-core python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install 3. Build DOLFINx Python interface: From 608e318ac0f1b74a47915cba26a9892fae8a347b Mon Sep 17 00:00:00 2001 From: schnellerhase <56360279+schnellerhase@users.noreply.github.com> Date: Sun, 19 Oct 2025 18:14:55 +0200 Subject: [PATCH 11/15] Fix windows? --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d0c0f2cf0e3..2ffa2829ea6 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -146,7 +146,7 @@ jobs: working-directory: dolfinx-src/python run: | pip install scikit-build-core - python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install + python -m pip install (python -m scikit_build_core.build requires | Out-String | ConvertFrom-Json) pip install --no-binary mpi4py - name: Install DOLFINx (Python) From 212c8b43b53fa99b1663e5943fdf212ebfc92e3d Mon Sep 17 00:00:00 2001 From: schnellerhase <56360279+schnellerhase@users.noreply.github.com> Date: Sun, 19 Oct 2025 18:30:11 +0200 Subject: [PATCH 12/15] Step by step --- .github/workflows/windows.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 2ffa2829ea6..4421c51c3ad 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -146,7 +146,15 @@ jobs: working-directory: dolfinx-src/python run: | pip install scikit-build-core + + - name: Install DOLFINx Python build dependencies + working-directory: dolfinx-src/python + run: | python -m pip install (python -m scikit_build_core.build requires | Out-String | ConvertFrom-Json) + + - name: Install DOLFINx Python build dependencies + working-directory: dolfinx-src/python + run: | pip install --no-binary mpi4py - name: Install DOLFINx (Python) From ed4f125e436a20b3599e9bbf2719dbe7e1a19b45 Mon Sep 17 00:00:00 2001 From: schnellerhase <56360279+schnellerhase@users.noreply.github.com> Date: Sun, 19 Oct 2025 18:43:43 +0200 Subject: [PATCH 13/15] Found? --- .github/workflows/windows.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 4421c51c3ad..d1e1c545236 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -146,16 +146,7 @@ jobs: working-directory: dolfinx-src/python run: | pip install scikit-build-core - - - name: Install DOLFINx Python build dependencies - working-directory: dolfinx-src/python - run: | - python -m pip install (python -m scikit_build_core.build requires | Out-String | ConvertFrom-Json) - - - name: Install DOLFINx Python build dependencies - working-directory: dolfinx-src/python - run: | - pip install --no-binary mpi4py + python -m pip install --no-binary mpi4py (python -m scikit_build_core.build requires | Out-String | ConvertFrom-Json) - name: Install DOLFINx (Python) working-directory: dolfinx-src/python From 003ea1a2f3381d254d5ebcb87d6d54784e0aa340 Mon Sep 17 00:00:00 2001 From: schnellerhase <56360279+schnellerhase@users.noreply.github.com> Date: Thu, 23 Oct 2025 12:35:12 +0200 Subject: [PATCH 14/15] Remove build dependency setuptools, ufl install without build isolation --- .github/workflows/ccpp.yml | 6 +++--- python/pyproject.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 96835364400..d66cad38519 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -100,7 +100,7 @@ jobs: - name: Install FEniCS Python components run: | - pip install --no-build-isolation git+https://github.com/${{ env.ufl_repository }}.git@${{ env.ufl_ref }} + pip install git+https://github.com/${{ env.ufl_repository }}.git@${{ env.ufl_ref }} pip install --no-build-isolation git+https://github.com/${{ env.basix_repository }}.git@${{ env.basix_ref }} pip install --no-build-isolation git+https://github.com/${{ env.ffcx_repository }}.git@${{ env.ffcx_ref }} @@ -196,7 +196,7 @@ jobs: - name: Install FEniCS Python components run: | - pip install --no-build-isolation git+https://github.com/${{ env.ufl_repository }}.git@${{ env.ufl_ref }} + pip install git+https://github.com/${{ env.ufl_repository }}.git@${{ env.ufl_ref }} pip install --no-build-isolation git+https://github.com/${{ env.basix_repository }}.git@${{ env.basix_ref }} pip install --no-build-isolation git+https://github.com/${{ env.ffcx_repository }}.git@${{ env.ffcx_ref }} @@ -305,7 +305,7 @@ jobs: - name: Install FEniCS Python components run: | - pip install --no-build-isolation git+https://github.com/${{ env.ufl_repository }}.git@${{ env.ufl_ref }} + pip install git+https://github.com/${{ env.ufl_repository }}.git@${{ env.ufl_ref }} pip install --no-build-isolation git+https://github.com/${{ env.basix_repository }}.git@${{ env.basix_ref }} pip install --no-build-isolation git+https://github.com/${{ env.ffcx_repository }}.git@${{ env.ffcx_ref }} diff --git a/python/pyproject.toml b/python/pyproject.toml index 112921dd148..0d5587dcae7 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -4,7 +4,7 @@ # NOTE: petsc4py is an optional build dependency, therefore we don't # list it here. [build-system] -requires = ["scikit-build-core[pyproject]>=0.10", "nanobind>=2.5.0", "mpi4py", "setuptools"] +requires = ["scikit-build-core[pyproject]>=0.10", "nanobind>=2.5.0", "mpi4py"] build-backend = "scikit_build_core.build" [project] From 8ef50e79e62881cbd106fcd678f3fffe827dad85 Mon Sep 17 00:00:00 2001 From: schnellerhase <56360279+schnellerhase@users.noreply.github.com> Date: Thu, 23 Oct 2025 12:45:45 +0200 Subject: [PATCH 15/15] Add install to CI --- .github/workflows/ccpp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index d66cad38519..fefe785875b 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -95,7 +95,7 @@ jobs: - name: Install Python build dependencies working-directory: python run: | - pip install scikit-build-core + pip install scikit-build-core setuptools python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install - name: Install FEniCS Python components @@ -300,7 +300,7 @@ jobs: - name: Install Python build dependencies working-directory: python run: | - pip install scikit-build-core + pip install scikit-build-core setuptools python -m scikit_build_core.build requires | python -c "import sys, json; print(' '.join(json.load(sys.stdin)))" | xargs pip install - name: Install FEniCS Python components