Skip to content

systemtests: fix Python bindings version ignored due to tutorial venv (fixes #584)#745

Open
AdityaGupta716 wants to merge 7 commits intoprecice:developfrom
AdityaGupta716:systemtests/fix-python-bindings-venv
Open

systemtests: fix Python bindings version ignored due to tutorial venv (fixes #584)#745
AdityaGupta716 wants to merge 7 commits intoprecice:developfrom
AdityaGupta716:systemtests/fix-python-bindings-venv

Conversation

@AdityaGupta716
Copy link

@AdityaGupta716 AdityaGupta716 commented Mar 8, 2026

Problem
Tutorial run.sh scripts create their own .venv and install from requirements.txt (e.g. pyprecice~=3.0), silently overwriting the specific PYTHON_BINDINGS_REF version installed by the Docker image. This means the version argument passed to system tests was completely ignored.
Root cause
The Docker image installs the correct version into /home/precice/venv but never permanently activates it. At container runtime the venv isn't on PATH, so the run script sees no active venv and creates its own. PRECICE_TUTORIALS_NO_VENV (added in #680) was never set in the component templates, so the escape hatch was never triggered.
Fix

Add ENV VIRTUAL_ENV and ENV PATH after venv creation in python_bindings, fenics_adapter, and nutils_adapter Dockerfile stages — permanently activating the correct venv at container runtime
Set PRECICE_TUTORIALS_NO_VENV=1 in python-bindings, fenics-adapter, nutils-adapter, and su2-adapter component templates
Add a sanity check that fails fast with a clear error if precice is not importable when the escape hatch is set
Fix --system-site-packages typo in flow-over-heated-plate/fluid-su2/run.sh

Fixes #584

@precice-bot
Copy link
Collaborator

This pull request has been mentioned on preCICE Forum on Discourse. There might be relevant details there:

https://precice.discourse.group/t/gsoc-2026-aditya-gupta/2773/4

@AdityaGupta716
Copy link
Author

@MakisH the component templates were never setting PRECICE_TUTORIALS_NO_VENV=1 (the escape hatch added in #680), and the Docker stages weren't permanently activating /home/precice/venv at runtime. This PR closes both gaps for python_bindings, fenics_adapter, nutils_adapter, and su2_adapter also adds a fast-fail sanity check if precice isn't importable when the escape hatch is set, and fixes a system-site-packages typo in flow-over-heated-plate/fluid-su2/run.sh. Please review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Propagating Python bindings version in system tests (conflict with requirements.txt)

2 participants