-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtox.ini
79 lines (69 loc) · 1.7 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
# Copyright 2023-2024 Canonical Ltd. and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
[tox]
skipsdist=True
skip_missing_interpreters = True
envlist = install, lint, snap, unit
[vars]
snap_path = {toxinidir}/snap/
tst_path = {toxinidir}/tests/
all_path = {[vars]tst_path}
[testenv]
setenv =
PYTHONPATH = {toxinidir}:{[vars]tst_path}
PYTHONBREAKPOINT=ipdb.set_trace
PY_COLORS=1
passenv =
PYTHONPATH
allowlist_externals =
/snap/bin/snapcraft
/usr/bin/snap
/usr/bin/bash
/usr/bin/rm
/usr/bin/sudo
[testenv:fmt]
description = Apply coding style standards to code
deps =
black
ruff
commands =
black {[vars]all_path}
ruff --fix {[vars]all_path}
[testenv:lint]
description = Check code against coding style standards
deps =
black
codespell
ruff
yamllint
commands =
black --check --diff {[vars]all_path}
codespell {toxinidir}
ruff {[vars]all_path}
yamllint {[vars]snap_path}
[testenv:snap]
description = Build Spack snap package using LXD as build provider.
commands =
snapcraft -v
[testenv:install]
description = Install locally built, unsigned snap on system.
commands =
bash -c "sudo snap install {toxinidir}/spack_*_amd64.snap --dangerous --classic"
[testenv:unit]
description = Run unit tests
deps =
pytest
commands =
pytest -v --tb native -s {posargs} {[vars]tst_path}unit
[testenv:clean]
description = Purge spack snap.
commands =
sudo snap remove --purge spack
bash -c "rm -f {toxinidir}/spack_*_amd64.snap"
snapcraft clean
[testenv:check]
description = Check snap exists.
commands =
bash -c "echo {toxinidir}/spack_*_amd64.snap"