forked from fastavro/fastavro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-tests.sh
executable file
·48 lines (37 loc) · 1.05 KB
/
run-tests.sh
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
#!/bin/bash
# Run tests suite
# Exit on error
set -e
echo "[$(date +%Y%m%dT%H%M%S)] ${USER}@$(hostname) :: $(2>&1 python --version)"
echo
find . -name '*.pyc' -exec rm {} \;
if [[ "$SKIP_BLACK" = "1" ]]; then
true
else
echo "running black"
black --target-version py36 --diff fastavro/ tests/ setup.py
black --target-version py36 --check fastavro/ tests/ setup.py
fi
echo "running flake8"
flake8 --max-line-length=90 --extend-ignore=E203,E501 fastavro tests
flake8 --config=.flake8.cython fastavro
RUN_MYPY=$(python <<EOF
import sys
if sys.implementation.name != "pypy":
sys.stdout.write("yes")
else:
sys.stdout.write("no")
EOF
)
if [[ "$RUN_MYPY" = "yes" ]]; then
echo "running mypy"
mypy ./fastavro
mypy --strict --follow-imports=silent --allow-any-generics fastavro/utils.py
else
echo "skipping mypy"
fi
check-manifest
# Build Cython modules
FASTAVRO_USE_CYTHON=1 python setup.py build_ext --inplace
pip install -e .
PYTHONPATH=${PWD} python -m pytest --cov=fastavro -v --cov-report=term-missing --cov-report=html:build/htmlcov $@