Repository navigation
fix(deps): raise pip before the hashed lock install - #4502
Conversation
pip before 23.3 does not match a pin with extras, such as googleapis-common-protos[grpc]==X, against a plain request for the same package. It then takes the plain package from the index and fails the --require-hashes check. Ubuntu 22.04 gives pip 22.0.2, so the dev image failed. A pin to pip 25.2 first lets pip-compile output install as generated. It also removes the need for the hand-added pin in requirements-common_lock.txt. Signed-off-by: Vitor Bandeira <vvbandeira@precisioninno.com>
There was a problem hiding this comment.
Code Review
This pull request updates the dependency installer script to pin and upgrade pip to version 25.2 before installing packages from the lockfile. The review feedback highlights two critical issues: first, pinning pip to 25.2 drops support for Python 3.8, which is required for compatibility with older supported platforms like Ubuntu 20.04 and Enterprise Linux 7, so pinning to 24.3.1 is recommended instead. Second, using pip3 install directly for upgrades can cause path and shell caching issues, so it is recommended to use python3 -m pip instead.
The lock install checks hashes, but the pip that ran before it came from the index with no check. The version is now in etc/requirements-pip_lock.txt. That file installs with --require-hashes. Call pip as python3 -m pip. pip3 on PATH can point to a different interpreter than the one this function selects for rh-python38. Add the new lock to the dev image build and to the image tag hash. Signed-off-by: Vitor Bandeira <vvbandeira@precisioninno.com>
🔍 QoR checkMetrics reflect the PR merge build — i.e. what will land on the target branch. Advisory — results are log-only and do not affect build status. The authoritative QoR gate remains the local rules-file check. Commit 62 design(s) checked — 0 with regression(s), 0 without a comparable baseline.
|
pip before 23.3 does not match a pin with extras, such as
googleapis-common-protos[grpc]==X, against a plain request for the same package. It then takes the plain package from the index and fails the--require-hashescheck. Ubuntu 22.04 gives pip 22.0.2, so the dev image failed.Pinning pip to 25.2 before the lock install lets
pip-compileoutput install as generated, and removes the need for the hand-added pin inrequirements-common_lock.txt.Tested on
ubuntu:22.04against a lock with the hand-added pin removed: root and non-root--userpaths both install cleanly, andpubsub,pandas,numpy,yamlfiximport.This is a follow-up on #4498