-
-
Notifications
You must be signed in to change notification settings - Fork 153
/
test.sh
executable file
·101 lines (80 loc) · 3.35 KB
/
test.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
98
99
100
101
#!/bin/bash -ex
eval "$(conda shell.bash hook)"
# Create and activate mamba environment for this test
BINDING=$(echo "$1" | tr '[:lower:]' '[:upper:]')
QT_VERSION_VAR=${BINDING}_QT_VERSION
# pytest-qt >=4 doesn't support Qt <=5.9
if [ "${!QT_VERSION_VAR:0:3}" = "5.9" ]; then
PYTESTQT_VERSION="=3.3.0"
PYTEST_VERSION=">=6,!=7.0.0,!=7.0.1,<7.2.0"
fi
if [ "$USE_CONDA" = "Yes" ]; then
if [ "${1}" = "pyqt5" ]; then
QT_SPECS="qt=${PYQT5_QT_VERSION} pyqt=${PYQT5_VERSION}"
elif [ "${1}" = "pyside2" ]; then
QT_SPECS="qt=${PYSIDE2_QT_VERSION} pyside2=${PYSIDE2_VERSION}"
elif [ "${1}" = "pyside6" ]; then
QT_SPECS="qt6-main=${PYSIDE6_QT_VERSION} pyside6=${PYSIDE6_VERSION}"
else
exit 1
fi
fi
mamba create -y -n test-env-${BINDING} python=${PYTHON_VERSION} pytest${PYTEST_VERSION:->=6,!=7.0.0,!=7.0.1} pytest-cov>=3.0.0 pytest-qt${PYTESTQT_VERSION:-} ${QT_SPECS:-}
conda activate test-env-${BINDING}
if [ "$USE_CONDA" = "No" ]; then
if [ "${1}" = "pyqt5" ]; then
if [ "$PYQT_EXTRAS" = "Yes" ]; then
pip install pyqt5==${PYQT5_VERSION}.* \
PyQtWebEngine==${PYQT5_VERSION}.* \
QScintilla==${QSCINTILLA_VERSION}.* \
PyQt3D==${PYQT5_VERSION}.* \
PyQtChart==${PYQT5_VERSION}.* \
PyQtDataVisualization==${PYQT5_VERSION}.* \
PyQtNetworkAuth==${PYQT5_VERSION}.* \
PyQtPurchasing==${PYQT5_VERSION}.*
else
pip install pyqt5==${PYQT5_VERSION}.* \
PyQtWebEngine==${PYQT5_VERSION}.* \
QScintilla==${QSCINTILLA_VERSION}.*
fi
elif [ "${1}" = "pyqt6" ]; then
if [ "$PYQT_EXTRAS" = "Yes" ]; then
pip install pyqt6==${PYQT6_VERSION}.* \
PyQt6-WebEngine==${PYQT6_VERSION}.* \
PyQt6-Qt6==${PYQT6_QT_VERSION}.* \
PyQt6-QScintilla \
PyQt6-3D==${PYQT6_VERSION}.* \
PyQt6-Charts==${PYQT6_VERSION}.* \
PyQt6-DataVisualization==${PYQT6_VERSION}.* \
PyQt6-NetworkAuth==${PYQT6_VERSION}.*
else
pip install pyqt6==${PYQT6_VERSION}.* \
PyQt6-WebEngine==${PYQT6_VERSION}.* \
PyQt6-Qt6==${PYQT6_QT_VERSION}.*
fi
elif [ "${1}" = "pyside2" ]; then
pip install pyside2==${PYSIDE2_VERSION}.*
elif [ "${1}" = "pyside6" ]; then
if [ "${PYSIDE6_VERSION:0:3}" = "6.2" ]; then
pip install pyside6==${PYSIDE6_VERSION}.*
else
pip install pyside6==${PYSIDE6_VERSION}.* pyside6-addons==${PYSIDE6_VERSION}.* pyside6-essentials==${PYSIDE6_VERSION}.*
fi
else
exit 1
fi
fi
# Build wheel of package
git clean -xdf -e *.coverage
python -m pip install --upgrade pip
python -m pip install --upgrade build
python -bb -X dev -W error -m build
# Install package from built wheel
echo dist/*.whl | xargs -I % python -bb -X dev -W error -W "ignore::DeprecationWarning:pip._internal.locations._distutils" -W "ignore::DeprecationWarning:distutils.command.install" -W "ignore::DeprecationWarning:pip._internal.metadata.importlib._envs" -m pip install --upgrade %
# Print environment information
mamba list
# Run tests
python -I -bb -X dev -W error -m pytest --cov qtpy --cov-config .coveragerc --cov-append
# Check package and environment
pipx run twine check --strict dist/*
pip check -v || ${SKIP_PIP_CHECK:-false}