Skip to content

Add requirements-reference.txt#871

Merged
MakisH merged 11 commits into
precice:developfrom
PranjalManhgaye:fix-610-python-dependency-versions-clean
Jul 15, 2026
Merged

Add requirements-reference.txt#871
MakisH merged 11 commits into
precice:developfrom
PranjalManhgaye:fix-610-python-dependency-versions-clean

Conversation

@PranjalManhgaye

Copy link
Copy Markdown
Collaborator

Summary

This PR implements #610 using the approach discussed after #749 and it is the rework of that:

  • Tutorial requirements.txt files keep loose version ranges (for example numpy >1, <2, pyprecice~=3.0). This PR fills gaps where develop still had unpinned packages (~~39 files; ~ ~13 already had ranges).
  • A new root file requirements-reference.txt records the exact PyPI versions that satisfy those ranges at generation time (Gemfile.lock style).
  • tools/report_tutorial_requirements.py generates and checks that file from PyPI.
  • CI workflow check-requirements-reference.yml runs --check when requirements or the script change.
    Tutorial run.sh scripts are unchanged and still install from local requirements.txt. The reference file is for reproducibility and releases, not for day-to-day installs.

This is not tied to reference_versions.yaml and does not change tools/tests/requirements.txt (CI git refs are already handled by #857/#858).

Test Plan

  • python3 tools/report_tutorial_requirements.py

  • python3 tools/report_tutorial_requirements.py --check

  • pre-commit run actionlint --files .github/workflows/check-requirements-reference.yml

  • pip install --dry-run -r elastic-tube-1d/fluid-python/requirements.txt

Closes #610

Add loose version constraints to remaining tutorial requirements.txt
files, generate requirements-reference.txt from PyPI, and check it in CI.
Remove extra trailing blank line in the Python dependencies section.
@PranjalManhgaye PranjalManhgaye requested a review from MakisH July 9, 2026 05:36
@PranjalManhgaye PranjalManhgaye moved this from Planned next to Needs review in GSoC 2026: System tests improvements Jul 9, 2026
@PranjalManhgaye PranjalManhgaye changed the title Add tutorial Python dependency reference manifest for #610 Add tutorial Python dependency reference manifest (rework of #749, closes #610) Jul 9, 2026
@PranjalManhgaye PranjalManhgaye changed the title Add tutorial Python dependency reference manifest (rework of #749, closes #610) Add tutorial Python dependency reference manifest (rework of #749) Jul 9, 2026

@MakisH MakisH left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution; this will be useful, and it comes at the right time.

My main suggestion, which will change a bit the code, is to split the requirements-reference.txt into one file per requirements.txt.

Other than that, most comments are regarding the version ranges. We do not need to document these in detail, but the comments here might be helpful in the future.

Comment thread requirements-reference.txt Outdated
Comment thread README.md Outdated
Comment thread channel-transport-particles/fluid-nutils/requirements.txt
Comment thread channel-transport-particles/fluid-nutils/requirements.txt Outdated
Comment thread elastic-tube-1d/fluid-python/requirements.txt Outdated
Comment thread two-scale-heat-conduction/micro-nutils/requirements.txt Outdated
Comment thread water-hammer/fluid1d-left-nutils/requirements.txt
Comment thread tools/report_tutorial_requirements.py Outdated
Comment thread tools/report_tutorial_requirements.py Outdated
Comment thread tools/releasing/update-requirements-reference.py
@MakisH MakisH changed the title Add tutorial Python dependency reference manifest (rework of #749) Add requirements-reference.txt Jul 9, 2026
Move the generator to tools/releasing/, emit sibling reference files
instead of a root manifest, and clean up requirements from review feedback.
@PranjalManhgaye PranjalManhgaye requested a review from MakisH July 10, 2026 17:06

@MakisH MakisH left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version ranges look fine. The system tests pass: https://github.com/precice/tutorials/actions/runs/29193941172?pr=871

I had a closer look at the script, here are some more comments.

Comment thread tools/releasing/update-requirements-reference.py
Comment thread tools/releasing/report_tutorial_requirements.py Outdated
Comment thread tools/releasing/report_tutorial_requirements.py Outdated
Comment thread .github/workflows/check-requirements-reference.yml Outdated
Comment thread tools/report_tutorial_requirements.py Outdated
Comment thread tools/releasing/report_tutorial_requirements.py Outdated
Comment thread tools/releasing/update-requirements-reference.py
…checks

Rename the generator, add path/--all write behavior, warn on outdated
refs on develop, fail on master, cover all requirements.txt files, and
colocate the flow-over-heated-plate plot script with its requirements.
@PranjalManhgaye PranjalManhgaye requested a review from MakisH July 13, 2026 17:46

@MakisH MakisH left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all the updates! I like the new interface, I think it is quite clear and flexible.

The script does what it should, but I have not reviewed it in much more detail than that.

Note that, while this solves #610 for the direct dependencies, but does not provide a full pip freeze output. Our tutorials, however, do generate pip-installed-packages.log, which are ignored by default, but could be archived together with any case files and logs. I think this is enough of a solution for now.

@MakisH MakisH merged commit 3d38fcb into precice:develop Jul 15, 2026
2 checks passed
@PranjalManhgaye

Copy link
Copy Markdown
Collaborator Author

Thanks, Glad the interface worked out , Happy to look at archiving pip-installed-packages.log later if that becomes useful.

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

Projects

Development

Successfully merging this pull request may close these issues.

Fix versions of Python dependencies for each distribution

2 participants