File tree Expand file tree Collapse file tree 1 file changed +21
-3
lines changed
Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Original file line number Diff line number Diff line change 2929 run : |
3030 set -euo pipefail
3131 IFS=$'\n\t'
32- if pipx upgrade-all --global | tee -a /dev/stderr | grep -q -e "^upgraded " ; then
33- exit 1
34- fi
32+ rc=0
33+ # Read each line from requirements.txt
34+ while IFS= read -r line; do
35+ # Skip empty lines and comments
36+ if [[ -z "$line" || "$line" =~ ^# ]]; then
37+ continue
38+ fi
39+ # Extract package name and current version
40+ if [[ "$line" =~ ^([a-zA-Z0-9_-]+)==([0-9.]+) ]]; then
41+ package="${BASH_REMATCH[1]}"
42+ current_version="${BASH_REMATCH[2]}"
43+ # Get latest version from PyPI using pip index versions
44+ # The version in parentheses on the first line is the latest
45+ latest_version=$(\pip index versions "$package" 2>/dev/null | \head -1 | \sed -E 's/.*\(([0-9.]+)\).*/\1/' || echo "unknown")
46+ if [ "${current_version}" != "${latest_version}" ]; then
47+ echo "${package}: ${current_version} -> ${latest_version}"
48+ rc=$((rc+1))
49+ fi
50+ fi
51+ done < requirements.txt
52+ exit ${rc}
You can’t perform that action at this time.
0 commit comments