Skip to content

Commit bc0d699

Browse files
committed
chore(etc): pin DependencyInstaller pip deps to SHA256 hashes
Add etc/requirements-common.in and a pip-compile-generated lock file with SHA256 hashes for all packages previously installed unpinned (pandas, numpy, firebase_admin, click, pyyaml, yamlfix). Update _installPipCommon() to install from the lock file.
1 parent 956bb2f commit bc0d699

3 files changed

Lines changed: 1069 additions & 4 deletions

File tree

etc/DependencyInstaller.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,24 @@ _installPipCommon() {
3636
source /opt/rh/rh-python38/enable
3737
set -u
3838
fi
39-
local pkgs="pandas numpy firebase_admin click pyyaml yamlfix"
39+
local lockfile
40+
lockfile="$(dirname "$(realpath "$0")")/requirements-common_lock.txt"
4041
if [[ "$OSTYPE" == "darwin"* ]]; then
4142
if [[ "$EUID" -eq 0 ]]; then
4243
echo "Error: Do NOT run with sudo."
4344
exit 1
4445
fi
4546
if [[ -n "${VIRTUAL_ENV:-}" ]]; then
46-
pip3 install --no-cache-dir -U $pkgs
47+
pip3 install --no-cache-dir -r "$lockfile"
4748
else
4849
echo "Error: Activate a virtual environment on macOS."
4950
exit 1
5051
fi
5152
else
5253
if [[ $(id -u) == 0 ]]; then
53-
pip3 install --no-cache-dir -U $pkgs
54+
pip3 install --no-cache-dir -r "$lockfile"
5455
else
55-
pip3 install --no-cache-dir --user -U $pkgs
56+
pip3 install --no-cache-dir --user -r "$lockfile"
5657
fi
5758
fi
5859
}

etc/requirements-common.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pandas
2+
numpy
3+
firebase_admin
4+
click
5+
pyyaml
6+
yamlfix

0 commit comments

Comments
 (0)