-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
ci.sh
executable file
·73 lines (58 loc) · 2.07 KB
/
ci.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
set -ex -o pipefail
BLACK_VERSION=22.3
MYPY_VERSION=1.7
pip install -U pip setuptools wheel
if [ "$CHECK_FORMATTING" = "1" ]; then
pip install black==${BLACK_VERSION}
if ! black --check setup.py async_generator-stubs outcome-stubs trio-stubs trio_typing; then
cat <<EOF
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Formatting problems were found (listed above). To fix them, run
pip install black==${BLACK_VERSION}
black setup.py async_generator-stubs outcome-stubs trio-stubs trio_typing
in your local checkout.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
EOF
exit 1
fi
exit 0
fi
if [ "$CHECK_TYPING" = "1" ]; then
pip install mypy==${MYPY_VERSION}
pip install -Ur test-requirements.txt
mkdir empty; cd empty
ln -s ../async_generator-stubs async_generator
ln -s ../outcome-stubs outcome
ln -s ../trio-stubs trio
ln -s ../trio_typing trio_typing
mypy --strict -p async_generator -p outcome -p trio -m trio_typing -m trio_typing.plugin
exit $?
fi
python setup.py sdist --formats=zip
pip install dist/*.zip
if [ "$CHECK_STUBS" = "1" ]; then
pip install mypy==${MYPY_VERSION}
mkdir empty; cd empty
ln -s ../async_generator-stubs async_generator
ln -s ../outcome-stubs outcome
ln -s ../trio-stubs trio
ln -s ../trio_typing trio_typing
python -m mypy.stubtest --allowlist=../allowlist.txt --ignore-unused-allowlist trio
exit $?
fi
# Actual tests
pip install -Ur test-requirements.txt
mkdir empty
cd empty
# The data-driven tests import mypy.build, which imports
# distutils. On Travis this apparently imports imp and triggers
# a deprecation warning.
if [ "$RUNTIME_ONLY" = "1" ]; then
pytest -W error -W ignore:::distutils -ra -v --pyargs trio_typing -k test_runtime
else
pip install mypy==${MYPY_VERSION}
pytest -W error -W ignore:::distutils -ra -v -p trio_typing._tests.datadriven --pyargs trio_typing
fi