Skip to content

Commit 7c86eae

Browse files
authored
fix(ci): allow empty wheel indexes (abetlen#2271)
1 parent 78ac75e commit 7c86eae

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

scripts/releases-to-pep-503.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,12 @@ cat << EOF > "$output_dir/llama-cpp-python/index.html"
5454
<h1>Links for llama-cpp-python</h1>
5555
EOF
5656

57-
# Filter releases by pattern
58-
releases=$(grep -E "$pattern" "$current_dir/all_releases.txt")
57+
# Filter releases by pattern. Some backend indexes are valid even when there
58+
# are no matching releases yet.
59+
releases=$(grep -E "$pattern" "$current_dir/all_releases.txt" || true)
60+
if [ -z "$releases" ]; then
61+
log_info "No releases found matching pattern: $pattern"
62+
fi
5963

6064
# Prepare curl headers
6165
headers=('--header' 'Accept: application/vnd.github.v3+json')
@@ -81,16 +85,16 @@ for release in $releases; do
8185
continue
8286
fi
8387

84-
# Get release version from release ie v0.1.0-cu121 -> v0.1.0
85-
release_version=$(echo "$release" | grep -oE "^[v]?[0-9]+\.[0-9]+\.[0-9]+")
86-
echo " <h2>$release_version</h2>" >> "$output_dir/llama-cpp-python/index.html"
87-
8888
wheel_urls=$(echo "$response" | jq -r '.assets[] | select(.name | endswith(".whl")) | .browser_download_url')
8989
if [ -z "$wheel_urls" ]; then
9090
log_error "No wheel files found for release $release"
9191
continue
9292
fi
9393

94+
# Get release version from release ie v0.1.0-cu121 -> v0.1.0
95+
release_version=$(echo "$release" | grep -oE "^[v]?[0-9]+\.[0-9]+\.[0-9]+")
96+
echo " <h2>$release_version</h2>" >> "$output_dir/llama-cpp-python/index.html"
97+
9498
echo "$wheel_urls" | while read -r asset; do
9599
echo " <a href=\"$asset\">$asset</a>" >> "$output_dir/llama-cpp-python/index.html"
96100
echo " <br>" >> "$output_dir/llama-cpp-python/index.html"

0 commit comments

Comments
 (0)