Skip to content

Commit 4dc08f9

Browse files
committed
ci: build cp27 with older manylinux
1 parent 1c2baba commit 4dc08f9

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

scripts/build-dist-cp27

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/usr/bin/env bash
2+
set -ex
3+
4+
# Determine where "../dist" is
5+
DIST_DIR="${1:-dist}"
6+
if which gmktemp > /dev/null 2>&1
7+
then
8+
# For Darwin
9+
MKTEMP=gmktemp
10+
else
11+
MKTEMP=mktemp
12+
fi
13+
BUILD_DIR=$($MKTEMP --directory --tmpdir=$PWD build-dist-tmp-XXXXXX)
14+
mkdir -p "$BUILD_DIR"
15+
16+
build_script=$(cat <<'EOF'
17+
set -ex
18+
19+
# This is used for pattern matching and excluding Python versions
20+
shopt -s extglob
21+
22+
# Build linux wheels from the source distribution we created
23+
for PYBIN in /opt/python/*cp27*/bin;
24+
do
25+
"${PYBIN}/pip" wheel --no-deps /dd-trace-py/*.tar.gz -w /dd-trace-py
26+
done
27+
28+
# Build manylinux wheels from the linux wheels we just created
29+
for whl in /dd-trace-py/*-linux_${ARCH}.whl;
30+
do
31+
auditwheel repair "${whl}" -w /dd-trace-py
32+
33+
# Remove linux wheel since we only want the manylinux wheels
34+
rm "${whl}"
35+
done
36+
EOF
37+
)
38+
39+
# First build a source distribution for our package
40+
python setup.py sdist --dist-dir "$BUILD_DIR"
41+
42+
# Use last tagged release of manylinux that included support for CPython 2.7
43+
MANYLINUX_IMAGE_X86_64=quay.io/pypa/manylinux2010_x86_64:2021-02-06-3d322a5
44+
# Build x86_64 linux and manylinux wheels
45+
docker pull ${MANYLINUX_IMAGE_X86_64}
46+
docker run -it --rm -v "${BUILD_DIR}:/dd-trace-py" -e "ARCH=x86_64" ${MANYLINUX_IMAGE_X86_64} /bin/bash -c "${build_script}"
47+
48+
MANYLINUX_IMAGE_I686=quay.io/pypa/manylinux2010_i686:2021-02-06-3d322a5
49+
# Build i686 linux and manylinux wheels
50+
docker pull ${MANYLINUX_IMAGE_I686}
51+
docker run -it --rm -v "${BUILD_DIR}:/dd-trace-py" -e "ARCH=i686" ${MANYLINUX_IMAGE_I686} linux32 /bin/bash -c "${build_script}"
52+
53+
test -e "$DIST_DIR" || mkdir "$DIST_DIR"
54+
mv "$BUILD_DIR"/* "$DIST_DIR"
55+
rmdir "$BUILD_DIR"

scripts/mkwheelhouse

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ def build_wheels():
1717
'scripts/build-dist', build_dir,
1818
]
1919
mkwheelhouse.spawn(args)
20+
# Need to separately build cp27 wheels with an older release of manylinux2010
21+
args = [
22+
'scripts/build-dist-cp27', build_dir,
23+
]
24+
mkwheelhouse.spawn(args)
2025
return build_dir
2126

2227

0 commit comments

Comments
 (0)