Skip to content

Commit eb05198

Browse files
committed
pyproject: move all tox environment dependencies
This requires pip 21.2 for recursive optional dependencies: https://hynek.me/articles/python-recursive-optional-dependencies/ While at it, also create a "dev" extra to install everything required for a development environment, like so: python3 -m venv ircstream-venv . ircstream-venv/bin/activate pip install -U pip # needed for PEP 660 support pip install -e .[dev]
1 parent d7bdf98 commit eb05198

File tree

2 files changed

+28
-19
lines changed

2 files changed

+28
-19
lines changed

pyproject.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,31 @@ dependencies = [
3838
"prometheus_client>=0.9.0",
3939
"structlog>=20.1.0",
4040
]
41+
optional-dependencies.tests = [
42+
"coverage[toml]",
43+
"pytest",
44+
"pytest-cov",
45+
"pytest-asyncio",
46+
"irc",
47+
"pyyaml",
48+
]
49+
optional-dependencies.type = [
50+
"ircstream[tests]",
51+
"mypy",
52+
"types-PyYAML",
53+
]
54+
optional-dependencies.lint = [
55+
"ircstream[tests]",
56+
"validate-pyproject[all]",
57+
"ruff",
58+
"black",
59+
"pylint",
60+
]
61+
optional-dependencies.dev = [
62+
"ircstream[tests]",
63+
"ircstream[type]",
64+
"ircstream[lint]",
65+
]
4166

4267
[project.urls]
4368
homepage = "https://github.com/paravoid/ircstream"

tox.ini

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,19 @@ source = ircstream.py tests/
1111
[testenv]
1212
usedevelop = True
1313
setenv = COVERAGE_FILE={toxworkdir}/.coverage.{envname}
14-
deps =
15-
coverage[toml]
16-
pytest
17-
pytest-cov
18-
pytest-asyncio
19-
irc
20-
pyyaml
14+
extras = tests
2115
commands = pytest --quiet --cov=ircstream
2216
parallel_show_output = True
2317

2418
[testenv:py39-bullseye]
2519
deps =
2620
prometheus_client==0.9.0
2721
structlog==20.1.0
28-
{[testenv]deps}
2922

3023
[testenv:py311-bookworm]
3124
deps =
3225
prometheus_client==0.16.0
3326
structlog==22.3.0
34-
{[testenv]deps}
3527

3628
[testenv:coverage]
3729
skip_install = True
@@ -48,25 +40,17 @@ parallel_show_output = True
4840

4941
[testenv:type]
5042
basepython = python3
51-
deps =
52-
{[testenv]deps}
53-
mypy
54-
types-PyYAML
43+
extras = type
5544
commands =
5645
mypy {[main]source}
5746
parallel_show_output = True
5847

5948
[testenv:lint]
6049
basepython = python3
50+
extras = lint
6151
commands =
6252
validate-pyproject pyproject.toml
6353
ruff {[main]source}
6454
pylint {[main]source}
6555
black --check {[main]source}
66-
deps =
67-
{[testenv]deps}
68-
validate-pyproject[all]
69-
ruff
70-
black
71-
pylint
7256
parallel_show_output = True

0 commit comments

Comments
 (0)