Skip to content

Conversation

@MakisH
Copy link
Member

@MakisH MakisH commented Nov 12, 2025

closes #679

Checklist:

  • I added a summary of any user-facing changes (compared to the last release) in the changelog-entries/<PRnumber>.md.

@fsimonis
Copy link
Member

fsimonis commented Nov 17, 2025

The amount of extra shellscript for this is pretty daunting.

I commented on the issue that an environment variable would be way easier to integrate.
If you want to use shellscript for this, then it would be very nice to refactor this into a single file and include it somehow.

@MakisH
Copy link
Member Author

MakisH commented Nov 17, 2025

Very good point, an environment variable would make everything easier and would not require input from the user. I will adapt.

@MakisH
Copy link
Member Author

MakisH commented Nov 18, 2025

Switched to:

if [ -z "${PRECICE_TUTORIALS_NO_VENV:-}" ]
then
    python3 -m venv .venv
    . .venv/bin/activate
    pip install -r requirements.txt && pip freeze > pip-installed-packages.log
fi

(we already use this form just fine in the OpenFOAM adapter Allwmake)

Examples:

  • ./run.sh: Installs and runs
  • PRECICE_TUTORIALS_NO_VENV="" ./run.sh: Installs and runs
  • PRECICE_TUTORIALS_NO_VENV="true" ./run.sh: Skips install, but runs

Notes:

  • Because we set -u, we cannot use the -v option without additional handling. Calling ./run.sh would give PRECICE_TUTORIALS_NO_VENV: unbound variable. A workaround based on a default value (:-) would defeat the purpose.
  • Kept the built-in [ test instead of the bash [[ test for consistency with the rest of the scripts (not needed here anyway).

@MakisH MakisH requested a review from fsimonis November 18, 2025 10:01
@MakisH MakisH marked this pull request as draft November 18, 2025 10:05
@MakisH MakisH marked this pull request as ready for review November 18, 2025 10:20
@MakisH MakisH merged commit d7dcb35 into develop Nov 18, 2025
1 check passed
@MakisH MakisH deleted the fix-679 branch November 18, 2025 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Option to skip installing Python dependencies in run scripts

3 participants