summaryrefslogtreecommitdiff
path: root/.travis/run.sh
blob: da2285514bea85644875717d1af217245747eba8 (plain)
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
#!/bin/bash

set -e
set -x

if [[ -n "$PYENV_VERSION" ]]; then
    eval "$(pyenv init -)"
fi

if [[ -n "$PYPY_URL" ]]; then
    cmd=./pypy
else
    cmd=python
fi

"$cmd" setup.py build_ext -i
"$cmd" -m compileall -f .
"$cmd" setup.py test

if [[ -n "$PYENV_VERSION" && $TRAVIS_OS_NAME == 'osx' ]]; then
    python setup.py bdist_wheel
fi
if [[ $BUILD_SDIST == 'true' ]]; then
    python setup.py sdist
    mkdir -p tmp-build
    cd tmp-build
    tar zxvf ../dist/xattr-*.tar.gz
    cd xattr-*
    "$cmd" setup.py build_ext -i
    "$cmd" setup.py test
    cd ../..
    rm -rf tmp-build
fi