From 9c3ad2e832ac1c1e5c03a189788eead00f97744b Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Mon, 13 Oct 2025 11:10:41 +0200 Subject: [PATCH 01/10] Run the upload package creation workflow on the latest preCICE release image --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8f323212..18d031be 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,7 @@ on: jobs: build: name: Build package - runs-on: ubuntu-latest + runs-on: precice/precice:3.3.0 steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 From 79438be049ce38662e2910fbe3ba528a6d9d39aa Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Mon, 13 Oct 2025 11:14:17 +0200 Subject: [PATCH 02/10] Add changelog entry for uploading the release workflow --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 81944bfe..f565499c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. +## latest + +* Run the upload package creation workflow on the latest preCICE release image https://github.com/precice/python-bindings/commit/9c3ad2e832ac1c1e5c03a189788eead00f97744b + ## 3.3.0 * Renaming and using a newer workflow for publishing according to the trusted publishing in PyPI https://github.com/precice/python-bindings/pull/241 From 63c594678490718474b33f225b05cc5f19f8b569 Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Mon, 13 Oct 2025 12:18:23 +0200 Subject: [PATCH 03/10] Fix release workflow by using the correct preCICE image --- .github/workflows/release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 18d031be..784453dc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,10 @@ on: jobs: build: name: Build package - runs-on: precice/precice:3.3.0 + runs-on: ubuntu-latest + container: + image: precice/precice:3.3.0 + options: --user root steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 From 2bc1b0ffd920df6b29884e09d9955dc9a1a20502 Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Mon, 13 Oct 2025 12:19:08 +0200 Subject: [PATCH 04/10] Add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f565499c..d6576a8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file. ## latest +* Fix release workflow by using the correct image in the container https://github.com/precice/python-bindings/commit/63c594678490718474b33f225b05cc5f19f8b569 * Run the upload package creation workflow on the latest preCICE release image https://github.com/precice/python-bindings/commit/9c3ad2e832ac1c1e5c03a189788eead00f97744b ## 3.3.0 From 0a9ccd449e875f0165bebc968b3a23d6d9094b0d Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Mon, 13 Oct 2025 13:07:49 +0200 Subject: [PATCH 05/10] Remove root user option from the preCICE image use --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 784453dc..50258e1a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,6 @@ jobs: runs-on: ubuntu-latest container: image: precice/precice:3.3.0 - options: --user root steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 From 5ce2a41b5fc73d7b6a98b532944f19ec20527b18 Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Mon, 13 Oct 2025 13:08:44 +0200 Subject: [PATCH 06/10] Changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6576a8f..32781b97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file. ## latest +* Remove root user option from the usage of the preCICE image in the release workflow https://github.com/precice/python-bindings/commit/0a9ccd449e875f0165bebc968b3a23d6d9094b0d * Fix release workflow by using the correct image in the container https://github.com/precice/python-bindings/commit/63c594678490718474b33f225b05cc5f19f8b569 * Run the upload package creation workflow on the latest preCICE release image https://github.com/precice/python-bindings/commit/9c3ad2e832ac1c1e5c03a189788eead00f97744b From d6a3203846c61883359682844e615df16ab907a6 Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Mon, 13 Oct 2025 13:27:06 +0200 Subject: [PATCH 07/10] Use precice:nightly image in release workflow --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 50258e1a..c31f764b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,8 @@ jobs: name: Build package runs-on: ubuntu-latest container: - image: precice/precice:3.3.0 + image: precice/precice:nightly + options: --user root steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 From 822e81075635a57d73863e2511a643300d12da8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Simonis?= Date: Wed, 15 Oct 2025 13:49:03 +0200 Subject: [PATCH 08/10] Add fallback for pkg-config in setup.py (#246) --- setup.py | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/setup.py b/setup.py index 0013d62f..f3a3c2b2 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,3 @@ -import pathlib from setuptools import setup from Cython.Distutils.extension import Extension from Cython.Build import cythonize @@ -9,32 +8,35 @@ MOCKED_ENV = "PYPRECICE_MOCKED" -def get_extensions(): +def find_precice(): if not pkgconfig.exists("libprecice"): - raise Exception( - "\n".join( - [ - "pkg-config was unable to find libprecice.", - "Please make sure that preCICE was installed correctly and pkg-config is able to find it.", - "You may need to set PKG_CONFIG_PATH to include the location of the libprecice.pc file.", - 'Use "pkg-config --modversion libprecice" for debugging.', - ] - ) + print( + "pkg-config was unable to find libprecice.\n" + "Please make sure that preCICE was installed correctly and pkg-config is able to find it.\n" + "You may need to set PKG_CONFIG_PATH to include the location of the libprecice.pc file.\n" + 'Use "pkg-config --modversion libprecice" for debugging.' ) + return [], ["-lprecice"] + + version = pkgconfig.modversion("libprecice") + print(f"Found preCICE version {version}") + return pkgconfig.cflags("libprecice").split(), pkgconfig.libs("libprecice").split() - print("Found preCICE version " + pkgconfig.modversion("libprecice")) + +def get_extensions(): + cflags, ldflags = find_precice() compile_args = ["-std=c++17"] link_args = [] include_dirs = [numpy.get_include()] bindings_sources = ["cyprecice/cyprecice.pyx"] - compile_args += pkgconfig.cflags("libprecice").split() + compile_args += cflags if os.environ.get(MOCKED_ENV) is not None: print(f"Building mocked pyprecice as {MOCKED_ENV} is set") bindings_sources.append("test/Participant.cpp") else: - link_args += pkgconfig.libs("libprecice").split() + link_args += ldflags return [ Extension( From 480818d27a389a7d5d41d6608cb38b41914856a4 Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Thu, 16 Oct 2025 09:57:29 +0200 Subject: [PATCH 09/10] Stop using precice/nightly container in the release workflow --- .github/workflows/release.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c31f764b..8f323212 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,9 +9,6 @@ jobs: build: name: Build package runs-on: ubuntu-latest - container: - image: precice/precice:nightly - options: --user root steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 From 62bb6703f75134e48bac06f4f63fda7d4b86195e Mon Sep 17 00:00:00 2001 From: Ishaan Desai Date: Thu, 16 Oct 2025 10:09:39 +0200 Subject: [PATCH 10/10] Bump version --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 32781b97..e8b76275 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file. -## latest +## 3.3.1 * Remove root user option from the usage of the preCICE image in the release workflow https://github.com/precice/python-bindings/commit/0a9ccd449e875f0165bebc968b3a23d6d9094b0d * Fix release workflow by using the correct image in the container https://github.com/precice/python-bindings/commit/63c594678490718474b33f225b05cc5f19f8b569