-
Notifications
You must be signed in to change notification settings - Fork 27
/
tox.ini
103 lines (95 loc) · 2.48 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
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
102
103
[tox]
requires =
tox-conda
tox-run-command
[testenv:py{311,312}-lock]
allowlist_externals =
cp
changedir =
{env:LOCK}
conda_channels =
conda-forge
conda_create_args =
--override-channels
conda_deps =
conda-lock
jinja2
mamba
pip
description =
Create explicit environment specification conda lock files for geovista dependencies.
platform =
linux
setenv =
LOCK = {toxinidir}{/}requirements{/}locks
WORK = {envtmpdir}{/}geovista.yml
YAML = {toxinidir}{/}requirements{/}geovista.yml
skip_install =
true
commands =
# inject python version pin to yaml
cp {env:YAML} {env:WORK}
python -c 'from sys import version_info as v; open("{env:WORK}", "a").write(f"\n - python =\{v.major\}.\{v.minor\}\n{env:VTK_BUILD:}")'
# resolve the dependencies
conda-lock --mamba --channel conda-forge --kind explicit --file {env:WORK} --platform linux-64 --filename-template "{envname}-\{platform\}.txt"
# convert lock to explicit yaml
python lock2yaml.py {envname}
[testenv:py{311,312}-env]
conda_spec =
py311: {toxinidir}{/}requirements{/}locks{/}py311-lock-linux-64.txt
py312: {toxinidir}{/}requirements{/}locks{/}py312-lock-linux-64.txt
description =
Create an environment only containing geovista dependencies.
platform =
linux
skip_install =
true
[testenv:py{311,312}-tests]
allowlist_externals =
Xvfb
mkdir
conda_spec =
py311: {toxinidir}{/}requirements{/}locks{/}py311-lock-linux-64.txt
py312: {toxinidir}{/}requirements{/}locks{/}py312-lock-linux-64.txt
description =
Perform geovista unit/integration tests.
platform =
linux
passenv =
CI
GEOVISTA_DOWNLOAD
PY_COLORS
setenv =
GEOVISTA_POOCH_MUTE = true
usedevelop =
true
commands =
{env:GEOVISTA_DOWNLOAD:}
pytest {posargs} --fail_extra_image_cache --generated_image_dir {toxinidir}{/}test_images
[testenv:py{311,312}-{linkcheck,doctest}]
allowlist_externals =
Xvfb
make
changedir =
{toxinidir}{/}docs
conda_spec =
py311: {toxinidir}{/}requirements{/}locks{/}py311-lock-linux-64.txt
py312: {toxinidir}{/}requirements{/}locks{/}py312-lock-linux-64.txt
description =
Build, test and link-check the geovista documentation.
platform =
linux
passenv =
GEOVISTA_DOWNLOAD
CI
setenv =
linkcheck: BUILDER = linkcheck
doctest: BUILDER = doctest
GEOVISTA_POOCH_MUTE = true
usedevelop =
true
commands =
{env:GEOVISTA_DOWNLOAD:}
make clean
make html-noplot
make {env:BUILDER}