Skip to content

systemtests: fix Python bindings version + robustness (fixes #584)#748

Open
PranjalManhgaye wants to merge 1 commit intoprecice:developfrom
PranjalManhgaye:fix-584-python-bindings-robust
Open

systemtests: fix Python bindings version + robustness (fixes #584)#748
PranjalManhgaye wants to merge 1 commit intoprecice:developfrom
PranjalManhgaye:fix-584-python-bindings-robust

Conversation

@PranjalManhgaye
Copy link
Contributor

Description

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, and nutils-adapter component templates — so run scripts skip creating their own venv and use the Docker image's version
  • Add sanity check: before running, verify precice is importable when PRECICE_TUTORIALS_NO_VENV is set; fail fast with a clear error instead of a confusing failure later
  • Changelog: note that ubuntu_2204 uses pip install --user (no venv) and is fixed by the template change alone

Fixes #584

)

- Activate /home/precice/venv at runtime via ENV VIRTUAL_ENV and PATH
  in python_bindings, fenics_adapter, nutils_adapter Docker stages
- Set PRECICE_TUTORIALS_NO_VENV=1 in component templates so run scripts
  skip creating .venv and use the Docker image's version
- Add sanity check: fail fast with clear error if precice not importable
  when PRECICE_TUTORIALS_NO_VENV is set
- Changelog: note that ubuntu_2204 is fixed by template change alone
  (uses pip install --user, no venv)

Made-with: Cursor
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)

1 participant