|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# This needs to be run from the root of the project. |
| 4 | +# To update: docker pull quay.io/pypa/manylinux2010_x86_64 |
| 5 | +set -e |
| 6 | +export PYTHONUNBUFFERED=1 |
| 7 | +export PYTHONDONTWRITEBYTECODE=1 |
| 8 | +# Use a fixed hash seed for reproducibility |
| 9 | +export PYTHONHASHSEED=8675309 |
| 10 | +export CI=1 |
| 11 | +export TRAVIS=true |
| 12 | +export PIP_NO_WARN_SCRIPT_LOCATION=1 |
| 13 | + |
| 14 | + |
| 15 | +if [ -d /greenlet ]; then |
| 16 | + # Running inside docker |
| 17 | + export GREENLET_MANYLINUX=1 |
| 18 | + # Build for speed (we're going to test this anyway) and without assertions. |
| 19 | + # Note: -Ofast includes -ffast-math which affects process-wide floating-point flags (e.g. can affect numpy). |
| 20 | + # It may also violate standards compliance in a few ways. Rather than opt-out with -fno-fast-math, |
| 21 | + # we use O3, which has neither of those problems. |
| 22 | + export CFLAGS="-O3 -DNDEBUG -Wall" |
| 23 | + |
| 24 | + apt-get update |
| 25 | + apt-get install -y python3.12 python3.12-dev python3.12-venv gcc git g++ |
| 26 | + update-alternatives --install /usr/bin/python python /usr/bin/python3.12 1 |
| 27 | + |
| 28 | + # Build in an isolated directory |
| 29 | + mkdir /tmp/build |
| 30 | + cd /tmp/build |
| 31 | + git config --global --add safe.directory /greenlet/.git |
| 32 | + git clone /greenlet greenlet |
| 33 | + cd greenlet |
| 34 | + |
| 35 | + python -m venv /tmp/venv |
| 36 | + . /tmp/venv/bin/activate |
| 37 | + echo "Python" |
| 38 | + python --version |
| 39 | + |
| 40 | + python -mpip install -U pip |
| 41 | + python -mpip install -U setuptools wheel |
| 42 | + python -mpip wheel -v --wheel-dir ./dist . |
| 43 | + python -mpip install -U .[test] |
| 44 | + python -m unittest discover -v greenlet.tests |
| 45 | + |
| 46 | + exit 0 |
| 47 | +fi |
| 48 | + |
| 49 | +# Mount the current directory as /greenlet |
| 50 | +docker run --rm -v "$(pwd):/greenlet" ${DOCKER_IMAGE:-riscv64/ubuntu:latest} /greenlet/$(basename $0) |
0 commit comments