Skip to content

Commit

Permalink
Cirrus: Use Python script to download & install wheels
Browse files Browse the repository at this point in the history
Co-authored-by: Nicolas Braud-Santoni <nicolas@braud-santoni.eu>
  • Loading branch information
AstraLuma and nbraud committed Feb 19, 2020
1 parent 2c3b16c commit e2a1f56
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
20 changes: 20 additions & 0 deletions .ci/install-wheels.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import glob
import io
import os
import subprocess
from urllib.request import urlopen
import zipfile

CIRRUS_BUILD_ID = os.environ['CIRRUS_BUILD_ID']
ARTIFACTS_URL = f"https://api.cirrus-ci.com/v1/artifact/build/{CIRRUS_BUILD_ID}/build/dist.zip"

with urlopen(ARTIFACTS_URL) as resp:
zipdata = resp.read()

with zipfile.ZipFile(io.BytesIO(zipdata)) as zf:
zf.extractall()

subprocess.run(
['pip', 'install', *glob.glob('dist/*.whl')],
check=True
)
8 changes: 4 additions & 4 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ docs_task:
install_script:
- apt update || true ; apt install -qq -y make
- pip install --upgrade-strategy eager -U -r requirements-docs.txt
- pip install dist/ppb-*.whl
- python .ci/install-wheels.py

script:
- make -C docs/ linkcheck
Expand Down Expand Up @@ -63,7 +63,7 @@ task:
apt install -qq -y pkgconf libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl1.2-dev libsmpeg-dev libportmidi-dev libswscale-dev libavformat-dev libavcodec-dev libfreetype6-dev gcc
fi
- pip install --upgrade-strategy eager -U -r requirements-tests.txt
- pip install $(find dist -name ppb-*.whl)
- python .ci/install-wheels.py

script:
- command -v pypy3 >/dev/null && export PY=pypy3
Expand Down Expand Up @@ -92,7 +92,7 @@ macOS_task:
- pyenv global ${PYTHON}
- pyenv rehash
- pip install --upgrade-strategy eager -U -r requirements-tests.txt
- pip install $(find dist -name ppb-*.whl)
- python .ci/install-wheels.py

script:
- python3 --version
Expand All @@ -115,7 +115,7 @@ task:

install_script:
- C:\Python\python.exe -m pip install --upgrade-strategy eager -U -r requirements-tests.txt
- C:\Python\python.exe -m pip install dist/ppb-*.whl
- C:\Python\python.exe .ci/install-wheels.py

script:
- C:\Python\python.exe --version
Expand Down

0 comments on commit e2a1f56

Please sign in to comment.