Skip to content

Commit d14dcc7

Browse files
committed
querying pypi metadata directly
1 parent 175e962 commit d14dcc7

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

.github/workflows/pr-preview.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@ jobs:
3030
- name: Check if version exists on Test PyPI
3131
id: version_check
3232
run: |
33-
# Try both exact version check and pip install dry-run
34-
if pip download --no-deps --dry-run --index-url https://test.pypi.org/simple/ "socketsecurity==${VERSION}" 2>/dev/null; then
35-
echo "Version ${VERSION} already exists on Test PyPI (found via pip download)"
33+
if curl -s https://test.pypi.org/pypi/socketsecurity/$VERSION/json | grep -q '"version": "'$VERSION'"'; then
34+
echo "Version ${VERSION} already exists on Test PyPI"
3635
echo "exists=true" >> $GITHUB_OUTPUT
3736
else
3837
echo "Version ${VERSION} not found on Test PyPI"
@@ -100,14 +99,14 @@ jobs:
10099
if: steps.version_check.outputs.exists != 'true'
101100
id: verify_package
102101
run: |
103-
# Wait for package to be available (try up to 5 times with 30s delay)
102+
# Wait for package to be available (try up to 5 times with 10s delay)
104103
for i in {1..5}; do
105-
if pip download --no-deps --dry-run --index-url https://test.pypi.org/simple/ "socketsecurity==${VERSION}" 2>/dev/null; then
104+
if curl -s https://test.pypi.org/pypi/socketsecurity/$VERSION/json | grep -q '"version": "'$VERSION'"'; then
106105
echo "Package ${VERSION} is now available on Test PyPI"
107106
exit 0
108107
fi
109-
echo "Attempt $i: Package not yet available, waiting 30s..."
110-
sleep 30
108+
echo "Attempt $i: Package not yet available, waiting 10s..."
109+
sleep 10
111110
done
112111
echo "Package ${VERSION} not available after 5 attempts"
113112
exit 1

0 commit comments

Comments
 (0)