Skip to content

Commit 855c6c4

Browse files
committed
Put manylinux script in a separate file
1 parent 4d15944 commit 855c6c4

File tree

2 files changed

+53
-49
lines changed

2 files changed

+53
-49
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/sh
2+
set -eu
3+
4+
: "${PY_ABI:?PY_ABI is required}"
5+
: "${MANYLINUX_IMAGE:?MANYLINUX_IMAGE is required}"
6+
7+
# Make local build helpers importable for isolated PEP 517 backend subprocesses.
8+
export PYTHONPATH="$PWD${PYTHONPATH:+:${PYTHONPATH}}"
9+
# Ensure dependency archives are read from the restored workspace cache even in isolated builds.
10+
export PYXMLSEC_LIBS_DIR="$PWD/libs"
11+
12+
# Step: Install system build dependencies (manylinux only)
13+
echo "== [container] Step: Install system build dependencies (manylinux only) =="
14+
case "$MANYLINUX_IMAGE" in
15+
manylinux*)
16+
yum install -y perl-core
17+
;;
18+
esac
19+
20+
# Step: Install python build dependencies
21+
echo "== [container] Step: Install python build dependencies =="
22+
/opt/python/${PY_ABI}/bin/pip install --upgrade pip setuptools wheel build 'setuptools_scm>=8'
23+
24+
# Step: Set environment variables
25+
echo "== [container] Step: Set environment variables =="
26+
PKGVER=$(/opt/python/${PY_ABI}/bin/python setup.py --version)
27+
echo "PKGVER=$PKGVER"
28+
29+
# Step: Build linux_x86_64 wheel
30+
echo "== [container] Step: Build linux_x86_64 wheel =="
31+
/opt/python/${PY_ABI}/bin/python -m build
32+
33+
# Step: Label manylinux wheel
34+
echo "== [container] Step: Label manylinux wheel =="
35+
ls -la dist/
36+
auditwheel show dist/xmlsec-${PKGVER}-${PY_ABI}-linux_x86_64.whl
37+
auditwheel repair dist/xmlsec-${PKGVER}-${PY_ABI}-linux_x86_64.whl
38+
ls -la wheelhouse/
39+
auditwheel show wheelhouse/xmlsec-${PKGVER}-${PY_ABI}-*${MANYLINUX_IMAGE}*.whl
40+
41+
# Step: Install test dependencies
42+
echo "== [container] Step: Install test dependencies =="
43+
/opt/python/${PY_ABI}/bin/pip install --upgrade -r requirements-test.txt
44+
/opt/python/${PY_ABI}/bin/pip install xmlsec --only-binary=xmlsec --no-index --find-links=wheelhouse/
45+
46+
# Step: Run tests
47+
echo "== [container] Step: Run tests =="
48+
/opt/python/${PY_ABI}/bin/pytest -v --color=yes
49+
50+
# Step: Fix mounted workspace file ownership on host
51+
echo "== [container] Step: Fix mounted workspace file ownership on host =="
52+
chown -R "${HOST_UID}:${HOST_GID}" dist wheelhouse build libs || true

.github/workflows/manylinux.yml

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -60,52 +60,4 @@ jobs:
6060
-e HOST_UID="$(id -u)" \
6161
-e HOST_GID="$(id -g)" \
6262
"quay.io/pypa/${MANYLINUX_IMAGE}" \
63-
sh -lc '
64-
set -eu
65-
# Make local build helpers importable for isolated PEP 517 backend subprocesses.
66-
export PYTHONPATH="$PWD${PYTHONPATH:+:${PYTHONPATH}}"
67-
# Ensure dependency archives are read from the restored workspace cache even in isolated builds.
68-
export PYXMLSEC_LIBS_DIR="$PWD/libs"
69-
70-
# Step: Install system build dependencies (manylinux only)
71-
echo "== [container] Step: Install system build dependencies (manylinux only) =="
72-
case "$MANYLINUX_IMAGE" in
73-
manylinux*)
74-
yum install -y perl-core
75-
;;
76-
esac
77-
78-
# Step: Install python build dependencies
79-
echo "== [container] Step: Install python build dependencies =="
80-
/opt/python/${PY_ABI}/bin/pip install --upgrade pip setuptools wheel build setuptools_scm\>=8
81-
82-
# Step: Set environment variables
83-
echo "== [container] Step: Set environment variables =="
84-
PKGVER=$(/opt/python/${PY_ABI}/bin/python setup.py --version)
85-
echo "PKGVER=$PKGVER"
86-
87-
# Step: Build linux_x86_64 wheel
88-
echo "== [container] Step: Build linux_x86_64 wheel =="
89-
/opt/python/${PY_ABI}/bin/python -m build
90-
91-
# Step: Label manylinux wheel
92-
echo "== [container] Step: Label manylinux wheel =="
93-
ls -la dist/
94-
auditwheel show dist/xmlsec-${PKGVER}-${PY_ABI}-linux_x86_64.whl
95-
auditwheel repair dist/xmlsec-${PKGVER}-${PY_ABI}-linux_x86_64.whl
96-
ls -la wheelhouse/
97-
auditwheel show wheelhouse/xmlsec-${PKGVER}-${PY_ABI}-*${MANYLINUX_IMAGE}*.whl
98-
99-
# Step: Install test dependencies
100-
echo "== [container] Step: Install test dependencies =="
101-
/opt/python/${PY_ABI}/bin/pip install --upgrade -r requirements-test.txt
102-
/opt/python/${PY_ABI}/bin/pip install xmlsec --only-binary=xmlsec --no-index --find-links=wheelhouse/
103-
104-
# Step: Run tests
105-
echo "== [container] Step: Run tests =="
106-
/opt/python/${PY_ABI}/bin/pytest -v --color=yes
107-
108-
# Step: Fix mounted workspace file ownership on host
109-
echo "== [container] Step: Fix mounted workspace file ownership on host =="
110-
chown -R "${HOST_UID}:${HOST_GID}" dist wheelhouse build libs || true
111-
'
63+
sh .github/scripts/manylinux_build_and_test.sh

0 commit comments

Comments
 (0)