Skip to content
This repository was archived by the owner on Nov 14, 2022. It is now read-only.

Commit e454469

Browse files
authored
Switch to tox (AR-1667) (#57)
* Initial commit for using Tox * Add pytest and pin setuptools
1 parent da02904 commit e454469

File tree

3 files changed

+93
-7
lines changed

3 files changed

+93
-7
lines changed

.github/workflows/run-tests.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,11 @@ jobs:
3535
with:
3636
repository: "autoreduction/autoreduce-workspace"
3737

38+
- name: Install Tox
39+
run: python -m pip install tox tox-gh-actions
40+
3841
- name: Run unit tests
39-
run: >-
40-
pytest --cov=autoreduce_utils --cov-report=xml
42+
run: tox -e pytest
4143

4244
- uses: codecov/codecov-action@v3
4345
with:
@@ -117,7 +119,8 @@ jobs:
117119
with:
118120
repository: "autoreduction/autoreduce-workspace"
119121

120-
- uses: autoreduction/autoreduce-actions/code_inspection@main
121-
with:
122-
package_name: autoreduce_utils
123-
pylint: false
122+
- name: Install Tox
123+
run: python -m pip install tox tox-gh-actions
124+
125+
- name: Run code inspection with tox
126+
run: tox -e code_inspection

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ dependencies = [
1818
]
1919

2020
[project.optional-dependencies]
21-
dev = []
21+
dev = ["pytest==7.1.2"]
2222

2323
[project.urls]
2424
"Repository" = "https://github.com/autoreduction/utils"

tox.ini

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
[tox]
2+
envlist =
3+
pytest
4+
pylint
5+
yapf
6+
vulture
7+
isolated_build = True
8+
9+
[gh-actions]
10+
python =
11+
3.8: py38
12+
13+
[testenv]
14+
description =
15+
Common environment.
16+
deps =
17+
setuptools < 58.0.0
18+
passenv = *
19+
setenv =
20+
PY_COLORS=1
21+
extras =
22+
dev
23+
24+
[testenv:pytest]
25+
description =
26+
Run unit tests.
27+
skip_install = False
28+
deps =
29+
{[testenv]deps}
30+
pytest
31+
pytest-cov
32+
pytest-django
33+
commands =
34+
pytest {envsitepackagesdir}/autoreduce_utils --cov={envsitepackagesdir}/autoreduce_utils --cov-report=xml
35+
36+
[testenv:pylint]
37+
description =
38+
Run pylint style checks.
39+
skip_install = False
40+
setenv =
41+
PYTHONPATH={envsitepackagesdir}/autoreduce_utils
42+
deps =
43+
pylint==2.14.5
44+
pylint-django==2.5.3
45+
commands =
46+
pylint --version
47+
pylint {envsitepackagesdir}/autoreduce_utils --output-format=colorized
48+
49+
[testenv:yapf]
50+
description =
51+
Run yapf style checks.
52+
skip_install = True
53+
deps =
54+
yapf==0.32.0
55+
toml
56+
commands =
57+
yapf --version
58+
yapf --parallel --diff --recursive autoreduce_utils
59+
60+
[testenv:vulture]
61+
description =
62+
Run vulture checks.
63+
skip_install = True
64+
deps =
65+
vulture==2.5
66+
commands =
67+
vulture --version
68+
vulture --min-confidence 90 autoreduce_utils
69+
70+
[testenv:code_inspection]
71+
description =
72+
Run code inspection checks.
73+
skip_install = False
74+
setenv =
75+
PYTHONPATH={envsitepackagesdir}/autoreduce_utils
76+
deps =
77+
{[testenv:pylint]deps}
78+
{[testenv:yapf]deps}
79+
{[testenv:vulture]deps}
80+
commands =
81+
{[testenv:pylint]commands}
82+
{[testenv:yapf]commands}
83+
{[testenv:vulture]commands}

0 commit comments

Comments
 (0)