-
Notifications
You must be signed in to change notification settings - Fork 2
/
tox.ini
55 lines (47 loc) · 1.63 KB
/
tox.ini
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
# Pypi packages anki and aqt do not pin their dependencies.
# To tests against historically accurate dependencies, we use a “time machine”
# that prevents pip from using packages that were uploaded after a specified date.
[tox]
minversion = 3.24
skipsdist = true
skip_install = true
requires =
pypi-timemachine
envlist =
py38-anki2.1.49
py39-anki2.1.51-qt{5,6}
py39-anki2.1.52-qt{5,6}
py39-anki2.1.53-qt{5,6}
py39-anki2.1.54-qt{5,6}
py39-pre-anki2.1.53rc1-qt6
[testenv:.tox]
install_command =
python -m pip install {packages}
[testenv]
install_command =
bash -xc ' \
set -eux; envname="$0"; toxworkdir="$1"; \
version=$(<<< "$envname" perl -nle "m/anki([\d\.a-z]+)/; print \$1"); \
upload_time=$(curl https://pypi.org/pypi/anki/json \
| jq --arg v "$version" -r ".releases[\$v][0].upload_time_iso_8601"); \
cutoff_time=$(date --utc -d "$upload_time +1 hour" "+%Y-%m-%dT%H:%M:%S"); \
\{ server=$(perl -nle "m/(http\S+)/; print \$1; exit 0;"); \
python -m pip install --index-url "$server" "anki==$version" "$AQT==$version"; \
\} < <("$toxworkdir"/.tox/bin/python -um pypi_timemachine "$cutoff_time"); kill $!; \
python -m pip install "$\{@:2\}"; \
' {envname} {toxworkdir} {packages}
commands =
env HOME={envtmpdir}/home xvfb-run python -m pytest {posargs}
setenv =
DISABLE_QT5_COMPAT=1
!qt{5,6}: AQT=aqt
qt5: AQT=aqt[qt5]
qt6: AQT=aqt[qt6]
allowlist_externals =
bash
env
xvfb-run
deps =
pytest==7.1.1
pytest-forked==1.4.0
pytest-anki @ git+https://github.com/oakkitten/pytest-anki.git@a0d27aa5