This repository was archived by the owner on Nov 2, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathtravis.sh
executable file
·97 lines (82 loc) · 3.28 KB
/
travis.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/bash
set -ex
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
curl -Lo macpython.pkg https://www.python.org/ftp/python/${MACPYTHON}/python-${MACPYTHON}-macosx10.6.pkg
sudo installer -pkg macpython.pkg -target /
ls /Library/Frameworks/Python.framework/Versions/*/bin/
PYTHON_EXE=/Library/Frameworks/Python.framework/Versions/*/bin/python3
# The pip in older MacPython releases doesn't support a new enough TLS
curl https://bootstrap.pypa.io/get-pip.py | sudo $PYTHON_EXE
sudo $PYTHON_EXE -m pip install virtualenv
$PYTHON_EXE -m virtualenv testenv
source testenv/bin/activate
fi
if [ "$USE_PYPY_NIGHTLY" = "1" ]; then
curl -fLo pypy.tar.bz2 http://buildbot.pypy.org/nightly/py3.5/pypy-c-jit-latest-linux64.tar.bz2
if [ ! -s pypy.tar.bz2 ]; then
# We know:
# - curl succeeded (200 response code; -f means "exit with error if
# server returns 4xx or 5xx")
# - nonetheless, pypy.tar.bz2 does not exist, or contains no data
# This isn't going to work, and the failure is not informative of
# anything involving this package.
ls -l
echo "PyPy3 nightly build failed to download – something is wrong on their end."
echo "Skipping testing against the nightly build for right now."
exit 0
fi
tar xaf pypy.tar.bz2
# something like "pypy-c-jit-89963-748aa3022295-linux64"
PYPY_DIR=$(echo pypy-c-jit-*)
PYTHON_EXE=$PYPY_DIR/bin/pypy3
($PYTHON_EXE -m ensurepip \
&& $PYTHON_EXE -m pip install virtualenv \
&& $PYTHON_EXE -m virtualenv testenv) \
|| (echo "pypy nightly is broken; skipping tests"; exit 0)
source testenv/bin/activate
fi
if [ "$USE_PYPY_RELEASE_VERSION" != "" ]; then
curl -fLo pypy.tar.bz2 https://bitbucket.org/squeaky/portable-pypy/downloads/pypy3.5-${USE_PYPY_RELEASE_VERSION}-linux_x86_64-portable.tar.bz2
tar xaf pypy.tar.bz2
# something like "pypy3.5-5.7.1-beta-linux_x86_64-portable"
PYPY_DIR=$(echo pypy3.5-*)
PYTHON_EXE=$PYPY_DIR/bin/pypy3
$PYTHON_EXE -m ensurepip
$PYTHON_EXE -m pip install virtualenv
$PYTHON_EXE -m virtualenv testenv
source testenv/bin/activate
fi
pip install -U pip setuptools wheel
if [ "$CHECK_FORMATTING" = "1" ]; then
pip install black==20.8b1
if ! black --check --diff setup.py exceptiongroup docs; then
cat <<EOF
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Formatting problems were found (listed above). To fix them, run
pip install black
black setup.py exceptiongroup docs
in your local checkout.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
EOF
exit 1
fi
exit 0
fi
python setup.py sdist --formats=zip
pip install dist/*.zip
if [ "$CHECK_DOCS" = "1" ]; then
pip install -Ur ci/rtd-requirements.txt
cd docs
# -n (nit-picky): warn on missing references
# -W: turn warnings into errors
sphinx-build -nW -b html source build
else
# Actual tests
pip install -Ur test-requirements.txt
mkdir empty
cd empty
pytest -W error -ra -v --pyargs exceptiongroup --cov=exceptiongroup --cov-config=../.coveragerc --verbose
bash <(curl -s https://codecov.io/bash)
fi