From ac981c305d848ad3f869f5b26ac535c12c198fc9 Mon Sep 17 00:00:00 2001 From: Eirik Keilegavlen Date: Thu, 16 Apr 2026 08:38:13 +0000 Subject: [PATCH 1/4] BLD: Remove version requirement on pytest --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 302f2f56ef..92fe206a10 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,7 +48,7 @@ development = [ "traitlets" ] testing = [ - "pytest >= 4.6", + "pytest", "pytest-cov", "pytest-runner" ] From b6f206649a7499b4566c4302a69890aefac07fab Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 16 Apr 2026 08:27:50 +0000 Subject: [PATCH 2/4] Fix GH action to build Docker image from PR branch instead of hardcoded main Agent-Logs-Url: https://github.com/pmgbergen/porepy/sessions/165206cb-c5c4-485a-8d41-838756c57266 Co-authored-by: keileg <1837598+keileg@users.noreply.github.com> --- .../build-push-stable-docker-image.yml | 1 + .../build-test-stable-docker_image.yml | 24 ++++++++----------- dockerfiles/stable/Dockerfile | 8 +++++-- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-push-stable-docker-image.yml b/.github/workflows/build-push-stable-docker-image.yml index 153602bdc0..a27954734d 100644 --- a/.github/workflows/build-push-stable-docker-image.yml +++ b/.github/workflows/build-push-stable-docker-image.yml @@ -33,4 +33,5 @@ jobs: builder: ${{ steps.buildx.outputs.name }} push: true tags: ${{ secrets.DOCKER_HUB_USERNAME }}/stable:latest + build-args: POREPY_BRANCH=main diff --git a/.github/workflows/build-test-stable-docker_image.yml b/.github/workflows/build-test-stable-docker_image.yml index 52da54957e..af5adba0a4 100644 --- a/.github/workflows/build-test-stable-docker_image.yml +++ b/.github/workflows/build-test-stable-docker_image.yml @@ -3,10 +3,9 @@ # but does not push the image to Docker Hub. It also runs only on pull requests to main, # whereas push-stable-docker-image.yml runs on pushes (PRs accepted) to main. # -# NOTE: For now, this workflow does not run as intended, since it will run on the branch -# defined by the stable Dockerfile, which is main. What is needed is to reconfigure -# the dockerfile and GH workflow to build from the PR branch instead. This should be -# revisited later. +# The stable Dockerfile accepts a POREPY_BRANCH build argument that controls which +# branch is checked out inside the container. Here we pass the PR's head branch so +# that the image is built and tested against the PR changes rather than main. name: Build a Docker image for main branch PRs on: @@ -17,25 +16,22 @@ on: - main jobs: - push_to_registry: - name: Push Docker image to Docker Hub + build_and_test: + name: Build Docker image (no push) runs-on: ubuntu-latest + permissions: + contents: read steps: - name: Check out the repo uses: actions/checkout@v3 - - - name: Log in to Docker Hub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_PASSWORD }} - - name: Build and push stable + - name: Build stable uses: docker/build-push-action@v3 with: context: ./ file: ./dockerfiles/stable/Dockerfile builder: ${{ steps.buildx.outputs.name }} push: false - tags: ${{ secrets.DOCKER_HUB_USERNAME }}/stable:latest + tags: porepy/stable:pr-test + build-args: POREPY_BRANCH=${{ github.head_ref || github.ref_name }} diff --git a/dockerfiles/stable/Dockerfile b/dockerfiles/stable/Dockerfile index 28e90856e0..0801d5c6e0 100644 --- a/dockerfiles/stable/Dockerfile +++ b/dockerfiles/stable/Dockerfile @@ -19,11 +19,15 @@ # Use the base PorePy image; most of the heavy lifting is done from there. FROM porepy/base +# Branch to check out. Defaults to main. Can be overridden at build time, e.g., +# to build from a PR branch using --build-arg POREPY_BRANCH=. +ARG POREPY_BRANCH=main + ## Download PorePy from github # Make sure we are in the home directory WORKDIR ${POREPY_HOME} -# Make sure we're on the main branch -RUN git checkout main && git pull +# Check out the specified branch (default: main) +RUN git checkout ${POREPY_BRANCH} && git pull # Run tests to check that everything works. # NOTE: When run as a GH action (presumably after a PR to the develop branch From a68c8c4fc2da0190115c76bfc4af0acd9091d75b Mon Sep 17 00:00:00 2001 From: Eirik Keilegavlen Date: Thu, 16 Apr 2026 13:56:16 +0000 Subject: [PATCH 3/4] BLD: Version bump --- pyproject.toml | 2 +- src/porepy/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 92fe206a10..b309a9d308 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" # Project information. [project] name = "porepy" -version = "1.12.0" +version = "1.13.0" description = "Simulation tool for fractured and deformable porous media" readme = "Readme.md" license = { text = "GPL" } diff --git a/src/porepy/__init__.py b/src/porepy/__init__.py index f513cae6c5..2a19502382 100644 --- a/src/porepy/__init__.py +++ b/src/porepy/__init__.py @@ -25,7 +25,7 @@ import warnings -__version__ = "1.12.0" +__version__ = "1.13.0" # Try to read the config file from the directory where python process was launched try: From 6b1c868a8a4ac65085c77ae9963d76fcc84dd2d1 Mon Sep 17 00:00:00 2001 From: Eirik Keilegavlen Date: Fri, 17 Apr 2026 09:12:57 +0000 Subject: [PATCH 4/4] BLD: Update to stable Dockerfile --- dockerfiles/stable/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerfiles/stable/Dockerfile b/dockerfiles/stable/Dockerfile index 0801d5c6e0..d5befee211 100644 --- a/dockerfiles/stable/Dockerfile +++ b/dockerfiles/stable/Dockerfile @@ -27,7 +27,7 @@ ARG POREPY_BRANCH=main # Make sure we are in the home directory WORKDIR ${POREPY_HOME} # Check out the specified branch (default: main) -RUN git checkout ${POREPY_BRANCH} && git pull +RUN git fetch && git checkout ${POREPY_BRANCH} && git pull # Run tests to check that everything works. # NOTE: When run as a GH action (presumably after a PR to the develop branch