@@ -64,18 +64,46 @@ jobs:
6464 with :
6565 python-version : ${{ matrix.python-version }}
6666
67- - name : Install package from TestPyPI (with retry)
67+ - name : Install package from TestPyPI
6868 run : |
69- pip install --upgrade pip
70-
71- RETRIES=5
72- SLEEP=10
73- for i in $(seq 1 $RETRIES); do
74- echo "Attempt $i: trying to install paint-csp-test==${VERSION}"
75- pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple --pre "paint-csp-test[dev]==${VERSION}" && break
76- echo "Package not available yet, waiting..."
77- sleep $SLEEP
78- done
69+ echo "OS: ${{ runner.os }}"
70+ if [[ "${{ runner.os }}" == "Windows" ]]; then
71+ pwsh -Command @"
72+ $maxAttempts = 5
73+ $sleepSeconds = 10
74+ $i = 0
75+ do {
76+ $i++
77+ Write-Host "Attempt $i: trying to install paint-csp-test==$env:VERSION"
78+ pip install --index-url https://test.pypi.org/simple/ `
79+ --extra-index-url https://pypi.org/simple `
80+ --pre `
81+ "paint-csp-test[dev]==$env:VERSION"
82+ if ($LASTEXITCODE -eq 0) {
83+ Write-Host "Install succeeded"
84+ break
85+ }
86+ Write-Host "Not available yet, retrying in $sleepSeconds seconds..."
87+ Start-Sleep -Seconds $sleepSeconds
88+ } while ($i -lt $maxAttempts)
89+ if ($LASTEXITCODE -ne 0) {
90+ throw "Failed to install after $maxAttempts attempts"
91+ }
92+ "@
93+ else
94+ max_attempts=5
95+ sleep_seconds=10
96+ for i in $(seq 1 $max_attempts); do
97+ echo "Attempt $i: installing paint-csp-test==$VERSION"
98+ pip install --index-url https://test.pypi.org/simple/ \
99+ --extra-index-url https://pypi.org/simple \
100+ --pre \
101+ "paint-csp-test[dev]==$VERSION" && break
102+ echo "Not ready yet, waiting..."
103+ sleep $sleep_seconds
104+ done
105+ fi
106+ shell : bash
79107 - name : Run tests with coverage
80108 run : |
81109 python --version
0 commit comments