summaryrefslogtreecommitdiff
path: root/.circleci/build-wheel.sh
blob: ebe745a7ec51a741b70acb9c77ad50a15a39591c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash -ex

cd /test

echo "Building for ${PLATFORM}"

PYBIN="/opt/python/${PYTHON}/bin"

mkdir -p /test/wheelhouse.final

"${PYBIN}"/python -m venv .venv

.venv/bin/pip install -U pip wheel cffi

.venv/bin/python setup.py sdist
cd dist
tar zxf bcrypt*.tar.gz
rm -rf bcrypt*.tar.gz
cd bcrypt*

REGEX="cp3([0-9])*"
if [[ "${PYBIN}" =~ $REGEX ]]; then
    PY_LIMITED_API="--py-limited-api=cp3${BASH_REMATCH[1]}"
fi

../../.venv/bin/python setup.py bdist_wheel "$PY_LIMITED_API"

auditwheel repair --plat "${PLATFORM}" -w wheelhouse/ dist/bcrypt*.whl

../../.venv/bin/pip install bcrypt --no-index -f wheelhouse/
../../.venv/bin/python -c "import bcrypt; password = b'super secret password';hashed = bcrypt.hashpw(password, bcrypt.gensalt());bcrypt.checkpw(password, hashed)"

mv wheelhouse/* /test/wheelhouse.final