-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathtox.ini
More file actions
103 lines (89 loc) · 2.47 KB
/
Copy pathtox.ini
File metadata and controls
103 lines (89 loc) · 2.47 KB
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]
envlist =
py3{12}{,-casa}{,-oldestdeps,-cov}
lint
docs
requires =
tox-uv
isolated_build = true
[gh]
python =
3.12 = py312, lint, docs
# Run the main test suite
[testenv]
set_env =
# Set various CASA paths
CASASITECONFIG = {toxinidir}{/}.tmp{/}{envname}{/}.casa{/}config.py
CASADIR = {toxinidir}{/}.tmp{/}.casa
ENVDIR = {toxinidir}{/}.tmp{/}{envname}
CASACONFIGDIR = {toxinidir}{/}tests{/}casa_config_files
# Set platform
PLATFORM = unknown
linux: PLATFORM = linux
darwin: PLATFORM = mac
win32: PLATFORM = windows
allowlist_externals =
cp
dot
echo
mkdir
rm
tar
uvx
description =
run tests
casa: with CASA packages enabled
oldestdeps: with the oldest supported dependencies
cov: with coverage
deps =
oldestdeps: minimum_dependencies
extras =
casa: casa
test
casa: test-casa
commands =
echo Running on {env:PLATFORM}
# If using CASA, create a temp directory to install data
casa: rm -rf {env:ENVDIR}
casa: mkdir -p {env:ENVDIR}
# Move CASA startup files
casa: mkdir -p {env:ENVDIR}{/}.casa
casa: cp {env:CASACONFIGDIR}{/}startup.py {env:ENVDIR}{/}.casa{/}
casa: cp {env:CASACONFIGDIR}{/}config.py {env:ENVDIR}{/}.casa{/}
# Download CASA data
casa: mkdir -p {env:CASADIR}{/}data
casa: python -m casaconfig --update-all
casa: python -m casaconfig --current-data
# Download and extract the latest analysisUtils
casa: uvx zenodo_get 10.5281/zenodo.7502159 -o {env:ENVDIR}
casa: tar -xf {env:ENVDIR}{/}analysis_scripts.tar -C {env:ENVDIR}{/}
{list_dependencies_command}
# Run tests
!casa: pytest -m "not casa" \
casa: pytest \
cov: --cov --cov-branch --cov-report=xml:{env:PLATFORM}-{envname}-coverage.xml \
cov: --junitxml={env:PLATFORM}-{envname}-junit.xml -o junit_family=legacy \
{posargs}
# Run lint
[testenv:lint]
description = run linters
extras =
test-ruff
# --exit-zero here to not fail, since there's currently a
# lot of tidying to do
commands = ruff check {posargs} --exit-zero
# Build documentation
[testenv:docs]
changedir =
docs
description =
invoke sphinx-build to build docs, check links, report coverage
extras =
docs
commands =
echo Building docs
sphinx-build -W -b html . _build/html {posargs}
echo Checking links
sphinx-build -W -b linkcheck . _build/linkcheck {posargs}
echo Checking coverage
sphinx-build -W -b coverage . _build/coverage {posargs}