-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild-wheels.sh.in
47 lines (40 loc) · 1.24 KB
/
build-wheels.sh.in
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
34
35
36
37
38
39
40
41
42
43
44
45
46
#/bin/bash
# -*- coding: utf-8 -*-
#
# copyright (2021) MINES ParisTech
# copyright (2021) Benoit Gschwind <[email protected]>
#
# This script is used to build wheel package for python.
#
# it is intended to be used in docker as follow:
# docker pull "quay.io/pypa/manylinux2014_x86_64"
# docker container run -t -v "$(pwd):/io" "quay.io/pypa/manylinux2014_x86_64" /io/build-wheel.sh
#
# run this section only if user is root
if [ $UID == 0 ]; then
useradd -m user
runuser -u user -- "$0" "$@"
cp /home/user/wheelhouse/* /io/wheelhouse/
exit 0
fi
# This section is run if we aren't root
function repair_wheel {
wheel="$1"
if ! auditwheel show "$wheel"; then
echo "Skipping non-platform wheel $wheel"
else
auditwheel repair "$wheel" --plat "$AUDITWHEEL_PLAT" -w /io/wheelhouse/
fi
}
export PATH=$PATH:/home/user/.local/bin
tar -xzf /io/sg2-@[email protected] -C /home/user/
cd /home/user/sg2-@PACKAGE_VERSION@
# Compile wheels
for PYBIN in cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311 cp312-cp312; do
"/opt/python/${PYBIN}/bin/pip" wheel . --no-deps -w /home/user/wheelhouse/
done
if [ -n "$AUDITWHEEL_PLAT" ]; then
for whl in /home/user/wheelhouse/*.whl; do
repair_wheel "$whl"
done
fi