Skip to content

Commit 0a8ecd1

Browse files
c24ttoumorokoshi
andauthored
Build wheels from source dists (open-telemetry#437)
Co-authored-by: Yusuke Tsutsumi <tsutsumi.yusuke@gmail.com>
1 parent f41f83d commit 0a8ecd1

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

scripts/build.sh

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,29 @@ set -ev
99
python3 -m pip install --upgrade pip setuptools wheel
1010

1111
BASEDIR=$(dirname $(readlink -f $(dirname $0)))
12+
DISTDIR=dist
1213

1314
(
1415
cd $BASEDIR
15-
mkdir -p dist
16-
rm -rf dist/*
16+
mkdir -p $DISTDIR
17+
rm -r $DISTDIR/*
1718

1819
for d in opentelemetry-api/ opentelemetry-sdk/ ext/*/ ; do
1920
(
21+
echo "building $d"
2022
cd "$d"
21-
python3 setup.py --verbose bdist_wheel --dist-dir "$BASEDIR/dist/"
23+
# Some ext directories (such as docker tests) are not intended to be
24+
# packaged. Verify the intent by looking for a setup.py.
25+
if [ -f setup.py ]; then
26+
python3 setup.py sdist --dist-dir "$BASEDIR/dist/" clean --all
27+
fi
2228
)
2329
done
30+
# Build a wheel for each source distribution
31+
(
32+
cd $DISTDIR
33+
for x in *.tar.gz ; do
34+
pip wheel --no-deps $x
35+
done
36+
)
2437
)

0 commit comments

Comments
 (0)