Skip to content

Commit 45c19e1

Browse files
author
Denis Jelovina
committed
Update version to 0.8.40 and enhance TestPyPI installation with retry logic
1 parent b6383ae commit 45c19e1

File tree

3 files changed

+34
-8
lines changed

3 files changed

+34
-8
lines changed

.github/workflows/publish-to-testpypi.yml

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -350,14 +350,33 @@ jobs:
350350
source "${VENV_DIR}/bin/activate"
351351
python -m pip install --upgrade pip setuptools wheel numpy
352352
353-
# Short sleep to allow TestPyPI to propagate uploaded wheels
354-
echo "Sleeping 60s to allow TestPyPI propagation before install..."
355-
sleep 60
356-
357-
# Determine version from pyalp/pyproject.toml
353+
# Retry pip install from TestPyPI with exponential backoff (bounded attempts)
358354
PYALP_VERSION=$(grep -E '^version\s*=\s*"' pyalp/pyproject.toml | head -n1 | sed -E 's/^version\s*=\s*"([^"]+)".*/\1/')
359-
echo "Installing alp-graphblas==${PYALP_VERSION} from TestPyPI"
360-
python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple alp-graphblas==${PYALP_VERSION} -v
355+
echo "Installing alp-graphblas==${PYALP_VERSION} from TestPyPI (with retries)"
356+
357+
MAX_ATTEMPTS=6
358+
SLEEP_BASE=10
359+
SUCCESS=0
360+
361+
for attempt in $(seq 1 ${MAX_ATTEMPTS}); do
362+
echo "--- attempt ${attempt} of ${MAX_ATTEMPTS} ---"
363+
# verbose pip output helps debugging in CI logs
364+
python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple alp-graphblas==${PYALP_VERSION} -v && SUCCESS=1 && break
365+
echo "pip install failed on attempt ${attempt}"
366+
if [ "${attempt}" -lt "${MAX_ATTEMPTS}" ]; then
367+
SLEEP_SECONDS=$((SLEEP_BASE * attempt))
368+
echo "Sleeping ${SLEEP_SECONDS}s before retry..."
369+
sleep "${SLEEP_SECONDS}"
370+
fi
371+
done
372+
373+
if [ "${SUCCESS}" -ne 1 ]; then
374+
echo "ERROR: failed to install alp-graphblas from TestPyPI after ${MAX_ATTEMPTS} attempts" >&2
375+
exit 1
376+
fi
377+
378+
# Print a compact JSON summary of installed backends for easy scanning in CI logs
379+
python -c "import json,importlib,sys; print(json.dumps({'backends': importlib.import_module('pyalp').list_backends()}))"
361380
362381
- name: Run in-process backend import smoke test
363382
shell: bash

pyalp/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "alp-graphblas"
7-
version = "0.8.39"
7+
version = "0.8.40"
88
description = "Python bindings for ALP GraphBLAS (minimal package layout)"
99
authors = [ { name = "ALP" } ]
1010
readme = "README.md"

pyalp/tests/test_bckds_inprocess.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def make_simple_matrix():
3636

3737
def main():
3838
m,n,i,j,v = make_simple_matrix()
39+
exercised = 0
3940

4041
# If the installed package exposes a `pyalp` package, prefer to query
4142
# it for the list of available backends and skip any that aren't present
@@ -87,12 +88,18 @@ def main():
8788
# Construct an instance
8889
try:
8990
mat = Matrix(m, n, i, j, v)
91+
exercised += 1
9092
print(f"Constructed Matrix from {backend}:", type(mat))
9193
except Exception as e:
9294
print(f"FAILED TO CONSTRUCT Matrix from {backend}: {e}")
9395
raise
9496

9597
print('\nALL BACKENDS IMPORTED AND INSTANCES CREATED SUCCESSFULLY')
98+
if exercised == 0:
99+
print('ERROR: no backends were exercised (none installed).', file=sys.stderr)
100+
raise SystemExit(2)
101+
else:
102+
print(f'SUCCESS: exercised {exercised} backend(s).')
96103

97104
if __name__ == '__main__':
98105
main()

0 commit comments

Comments
 (0)