Skip to content

Commit e49f638

Browse files
committed
Update test dependencies
1 parent bd9714e commit e49f638

2 files changed

Lines changed: 63 additions & 38 deletions

File tree

pyproject.toml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,56 @@ dependencies = [
1313
"ops~=2.17",
1414
]
1515

16+
[dependency-groups]
17+
18+
charmlibs = [
19+
"charmlibs-apt>=1.0.0",
20+
"charmlibs-pathops>=1.0.0",
21+
]
22+
23+
format = [
24+
"black",
25+
"isort",
26+
]
27+
28+
lint = [
29+
"mypy",
30+
"isort",
31+
"black",
32+
"flake8-docstrings",
33+
"flake8-docstrings-complete",
34+
"flake8-builtins",
35+
"flake8-test-docs",
36+
"pep8-naming",
37+
"codespell",
38+
"pylint",
39+
"pyproject-flake8",
40+
"pydocstyle",
41+
"types-PyYAML",
42+
]
43+
44+
unit = [
45+
"pytest",
46+
"coverage[toml]",
47+
"ops[testing]",
48+
]
49+
50+
coverage-report = [
51+
"pytest",
52+
"coverage[toml]",
53+
"ops[testing]",
54+
]
55+
56+
static = [
57+
"pyright",
58+
"ops[testing]",
59+
]
60+
61+
integration = [
62+
"pytest",
63+
"jubilant~=1.0",
64+
]
65+
1666
# Testing tools configuration
1767
[tool.coverage.run]
1868
branch = true

tox.ini

Lines changed: 13 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -25,32 +25,16 @@ pass_env =
2525

2626
[testenv:format]
2727
description = Apply coding style standards to code
28-
deps =
29-
black
30-
isort
28+
dependency_groups = format
3129
commands =
3230
isort {[vars]all_path}
3331
black {[vars]all_path}
3432

3533
[testenv:lint]
3634
description = Check code against coding style standards
37-
deps =
38-
mypy
39-
isort
40-
black
41-
flake8-docstrings
42-
flake8-docstrings-complete
43-
flake8-builtins
44-
flake8-test-docs
45-
pep8-naming
46-
codespell
47-
pylint
48-
pyproject-flake8
49-
pydocstyle
50-
types-PyYAML
51-
ops
52-
charmlibs-pathops
53-
charmlibs-apt
35+
dependency_groups =
36+
lint
37+
charmlibs
5438
commands =
5539
black --check --diff {[vars]all_path}
5640
codespell {[vars]all_path}
@@ -62,11 +46,9 @@ commands =
6246

6347
[testenv:unit]
6448
description = Run unit tests
65-
deps =
66-
pytest
67-
coverage[toml]
68-
ops[testing]
69-
-r {tox_root}/requirements.txt
49+
dependency_groups =
50+
unit
51+
charmlibs
7052
commands =
7153
coverage run --source={[vars]src_path} \
7254
-m pytest \
@@ -79,29 +61,22 @@ commands =
7961

8062
[testenv:coverage-report]
8163
description = Create test coverage report
82-
deps =
83-
pytest
84-
coverage[toml]
85-
ops[testing]
86-
-r {tox_root}/requirements.txt
64+
dependency_groups = coverage-report
8765
commands =
8866
coverage report
8967

9068
[testenv:static]
9169
description = Run static type checks
92-
deps =
93-
pyright
94-
ops[testing]
95-
-r {tox_root}/requirements.txt
70+
dependency_groups =
71+
static
72+
charmlibs
9673
commands =
9774
pyright {posargs}
9875

9976
[testenv:integration]
10077
description = Run integration tests
101-
deps =
102-
pytest
103-
jubilant~=1.0
104-
-r {tox_root}/requirements.txt
78+
dependency_groups =
79+
integration
10580
commands =
10681
pytest -v \
10782
-s \

0 commit comments

Comments
 (0)