Skip to content

Commit 4d5b17f

Browse files
committed
chore: check for latest version of urllib3
This is useful to keep urllib3 in Python version older than 3.10 like the default Python version used in Bullseye Signed-off-by: Jonathan Gonzalez V <[email protected]>
1 parent 17b02e0 commit 4d5b17f

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

lib/repo_funcs.sh

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@ fetch_postgres_image_version() {
2929
head -n1
3030
}
3131

32+
# Get the latest urllib3 version
33+
latest_urllib3_version=
34+
_raw_get_latest_urllib3_version() {
35+
curl -s https://pypi.org/pypi/urllib3/json | jq -r '.releases | keys[]' | sort -Vr | head -n1
36+
}
37+
get_latest_urllib3_version() {
38+
if [ -z "$latest_urllib3_version" ]; then
39+
latest_urllib3_version=$(_raw_get_latest_urllib3_version)
40+
fi
41+
echo "$latest_urllib3_version"
42+
}
43+
3244
# Get the latest Barman version
3345
latest_barman_version=
3446
_raw_get_latest_barman_version() {
@@ -166,8 +178,10 @@ generate_postgres() {
166178

167179
update_requirements() {
168180
barmanVersion=$(get_latest_barman_version)
181+
urllib3=$(get_latest_urllib3_version)
182+
169183
# If there's a new version we need to recreate the requirements files
170-
echo "barman[cloud,azure,snappy,google,zstandard,lz4] == $barmanVersion" > requirements.in
184+
echo -e "barman[cloud,azure,snappy,google,zstandard,lz4] == $barmanVersion\nurllib3 == $urllib3" > requirements.in
171185

172186
# This will take the requirements.in file and generate a file
173187
# requirements.txt with the hashes for the required packages

0 commit comments

Comments
 (0)