Newer
Older
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
echo "-----------------------------------------------"
echo "Current directory: $(pwd)"
echo "Python executable: ${PY_EXE}"
echo "PYOPENCL_TEST: ${PYOPENCL_TEST}"
echo "PYTEST_ADDOPTS: ${PYTEST_ADDOPTS}"
echo "PROJECT_INSTALL_FLAGS: ${PROJECT_INSTALL_FLAGS}"
echo "git revision: $(git rev-parse --short HEAD)"
echo "git status:"
git status -s
echo "-----------------------------------------------"
# {{{ clean up
rm -Rf .env
rm -Rf build
find . -name '*.pyc' -delete
rm -Rf env
git clean -fdx \
-e siteconf.py \
-e boost-numeric-bindings \
-e '.pylintrc.yml' \
-e 'prepare-and-run-*.sh' \
-e 'run-*.py' \
$GIT_CLEAN_EXCLUDE
# }}}
if [[ "$NO_SUBMODULES" = "" ]]; then
git submodule update --init --recursive
fi
# {{{ virtualenv
VIRTUALENV="${PY_EXE} -m venv"
if [ -d ".env" ]; then
echo "**> virtualenv exists"
else
echo "**> creating virtualenv"
${VIRTUALENV} .env
fi
. .env/bin/activate
# }}}
$PY_EXE -m ensurepip
PIP="${PY_EXE} $(which pip)"
# https://github.com/pypa/pip/issues/5345#issuecomment-386443351
export XDG_CACHE_HOME=$HOME/.cache/$CI_RUNNER_ID
$PIP install --upgrade pip
$PIP install setuptools
# Pinned to 3.0.4 because of https://github.com/pytest-dev/pytest/issues/2434
# Install before a newer version gets pulled in as a dependency
$PIP install pytest==3.0.4 pytest-warnings==0.2.0
if test "$REQUIREMENTS_TXT" == ""; then
REQUIREMENTS_TXT="requirements.txt"
fi
if test -f $REQUIREMENTS_TXT; then
$PIP install -r $REQUIREMENTS_TXT
fi
${PY_EXE} -m pytest -rw --durations=10 --tb=native --junitxml=pytest.xml -rxsw test.py
# vim: foldmethod=marker