Skip to content

Commit 527d8b1

Browse files
committed
fix build-wheels.sh : always use actual python specific auditwheel
* use pytest_requirements.txt in build-wheels.sh Signed-off-by: Aleksei Stepanov <[email protected]>
1 parent ae5c885 commit 527d8b1

File tree

2 files changed

+30
-23
lines changed

2 files changed

+30
-23
lines changed

pytest_requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
pytest
22
pytest-cov
3+
pytest-mock
34
# pytest-sugar
45
coverage[toml]>=5.0

tools/build-wheels.sh

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ PYTHON_VERSIONS="cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39"
66
export PYTHONDONTWRITEBYTECODE=1
77

88
package_name="$1"
9-
if [[ -z "$package_name" ]]
10-
then
11-
# shellcheck disable=SC2210
12-
&>2 echo "Please pass package name as a first argument of this script ($0)"
13-
exit 1
9+
if [[ -z "$package_name" ]]; then
10+
# shellcheck disable=SC2210
11+
echo &>2 "Please pass package name as a first argument of this script ($0)"
12+
exit 1
1413
fi
1514

1615
arch=$(uname -m)
@@ -19,28 +18,33 @@ arch=$(uname -m)
1918
rm -rf /io/.tox
2019
rm -rf /io/*.egg-info
2120
rm -rf /io/.pytest_cache
21+
rm -fv /io/dist/*-linux_*.whl
2222
find /io/ -noleaf -name "*.py[co]" -delete
2323

2424
echo
2525
echo
2626
echo "Compile wheels"
27-
for PYTHON in ${PYTHON_VERSIONS}; do
28-
/opt/python/"${PYTHON}"/bin/pip install -U pip setuptools
29-
/opt/python/"${PYTHON}"/bin/pip install -r /io/build_requirements.txt
30-
/opt/python/"${PYTHON}"/bin/pip wheel /io/ -w /io/dist/
31-
cd /io
32-
/opt/python/"${PYTHON}"/bin/python setup.py bdist_wheel clean
27+
cd /io
3328

34-
done
29+
for PYTHON in ${PYTHON_VERSIONS}; do
30+
echo "Python ${PYTHON} ${arch}:"
31+
python_bin="/opt/python/${PYTHON}/bin"
32+
"$python_bin/pip" install -U pip setuptools auditwheel
33+
"$python_bin/pip" install -r /io/build_requirements.txt
34+
"$python_bin/pip" wheel /io/ -w /io/dist/
35+
"$python_bin/python" setup.py bdist_wheel clean
3536

36-
echo
37-
echo
38-
echo "Bundle external shared libraries into the wheels"
39-
for whl in /io/dist/${package_name}*${arch}.whl; do
37+
wheels=(/io/dist/"${package_name}"*"${PYTHON}"*linux_"${arch}".whl)
38+
for whl in "${wheels[@]}"; do
4039
echo "Repairing $whl..."
41-
auditwheel repair "$whl" -w /io/dist/
40+
"$python_bin/python" -m auditwheel repair "$whl" -w /io/dist/
41+
echo "Cleanup OS specific wheels"
42+
rm -fv "$whl"
43+
done
44+
echo
4245
done
4346

47+
echo
4448
echo "Cleanup OS specific wheels"
4549
rm -fv /io/dist/*-linux_*.whl
4650

@@ -49,14 +53,16 @@ echo
4953
echo "Install packages and test"
5054
echo "dist directory:"
5155
ls /io/dist
56+
echo
5257

5358
for PYTHON in ${PYTHON_VERSIONS}; do
54-
echo
55-
echo -n "Test $PYTHON: $package_name "
56-
/opt/python/"${PYTHON}"/bin/python -c "import platform;print(platform.platform())"
57-
/opt/python/"${PYTHON}"/bin/pip install "$package_name" --no-index -f file:///io/dist
58-
/opt/python/"${PYTHON}"/bin/pip install pytest
59-
/opt/python/"${PYTHON}"/bin/py.test -vvv /io/test
59+
echo -n "Test $PYTHON ${arch}: $package_name "
60+
python_bin="/opt/python/${PYTHON}/bin"
61+
"$python_bin/python" -c "import platform;print(platform.platform())"
62+
"$python_bin/pip" install "$package_name" --no-index -f file:///io/dist
63+
"$python_bin/pip" install -r /io/pytest_requirements.txt
64+
"$python_bin/py.test" -vvv /io/test
65+
echo
6066
done
6167

6268
find /io/dist/ -noleaf -type f -not -name "*$package_name*" -delete

0 commit comments

Comments
 (0)