Skip to content

Commit

Permalink
Add script testing that sdist result works
Browse files Browse the repository at this point in the history
It was quite fiddly to get something which works both locally and,
looking ahead, on the Travis infrastructure.  See

    travis-ci/travis-ci#8589
  • Loading branch information
bennorth committed May 23, 2020
1 parent d148481 commit afd3d08
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions tests/test-sdist.sh
@@ -0,0 +1,33 @@
#!/usr/bin/env bash

set -x

PYTHON_VER=$(python3 -c 'if True:
import sys
v = sys.version_info
print(".".join(map(str,[v.major,v.minor,v.micro])))')

OPT_PYTHON=/opt/python/$PYTHON_VER/bin/python3
if [ -x $OPT_PYTHON ]; then
PYTHON=$OPT_PYTHON
else
PYTHON=$(which python3)
fi

D=$(mktemp -d)
function rm_tmpdir {
rm -rf "$D"
}
trap rm_tmpdir EXIT

SRCDIR=$(pwd)

python3 setup.py sdist -d $D \
&& $PYTHON -m venv $D \
&& cd / \
&& ( source $D/bin/activate \
&& python3 -m ensurepip \
&& pip3 install -r "$SRCDIR"/requirements.txt \
&& pip3 install $D/gitdendrify-*.tar.gz ) \
&& echo Success

0 comments on commit afd3d08

Please sign in to comment.