Add requirements-reference.txt#871
Conversation
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.
MakisH
left a comment
There was a problem hiding this comment.
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.
…ependency-versions-clean
Move the generator to tools/releasing/, emit sibling reference files instead of a root manifest, and clean up requirements from review feedback.
There was a problem hiding this comment.
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.
…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.
MakisH
left a comment
There was a problem hiding this comment.
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.
|
Thanks, Glad the interface worked out , Happy to look at archiving |
Summary
This PR implements #610 using the approach discussed after #749 and it is the rework of that:
requirements.txt fileskeep 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).requirements-reference.txtrecords the exact PyPI versions that satisfy those ranges at generation time(Gemfile.lock style).tools/report_tutorial_requirements.pygenerates and checks that file from PyPI.check-requirements-reference.ymlruns--checkwhen requirements or the script change.Tutorial
run.sh scriptsare unchanged and still install from localrequirements.txt. The reference file is for reproducibility and releases, not for day-to-day installs.This is not tied to
reference_versions.yamland does not changetools/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