Skip to content

Commit c1a995c

Browse files
authored
Switch to using dependency groups for dev-dependencies (#514)
These are now the recommended way to list dev-dependencies in a pyproject.toml file. They are now supported by both pip and uv, which share a common interface for installing them. Spec: https://packaging.python.org/en/latest/specifications/dependency-groups/
1 parent 39f59d3 commit c1a995c

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

.github/workflows/check.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
with:
3838
version: "latest"
3939
- run: |
40-
uv run --python=3.13 --extra=dev mypy --python-version=${{ matrix.python-version }}
40+
uv run --python=3.13 --group=dev mypy --python-version=${{ matrix.python-version }}
4141
4242
flake8:
4343
name: flake8
@@ -49,7 +49,7 @@ jobs:
4949
with:
5050
version: "latest"
5151
- run: |
52-
uv run --python=3.13 --extra=dev flake8 $(git ls-files | grep 'py$') --color=always
52+
uv run --python=3.13 --group=dev flake8 $(git ls-files | grep 'py$') --color=always
5353
5454
tests:
5555
name: pytest suite
@@ -66,4 +66,4 @@ jobs:
6666
with:
6767
version: "latest"
6868
- run: |
69-
uv run --python=${{ matrix.python-version }} --extra=dev pytest -vv
69+
uv run --python=${{ matrix.python-version }} --group=dev pytest -vv

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ New error codes:
99
Other changes:
1010
* Y011/Y015 will now allow all defaults that include an attribute access,
1111
for example `math.inf` or enum members.
12+
* Development-only dependencies are now declared using
13+
[dependency groups](https://packaging.python.org/en/latest/specifications/dependency-groups/)
14+
rather than
15+
[optional dependencies](https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#dependencies-and-requirements).
1216
* Declare support for Python 3.14
1317

1418
## 24.9.0

pyproject.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,7 @@ dependencies = [
5151
"pyflakes >= 2.1.1",
5252
]
5353

54-
[project.urls]
55-
"Homepage" = "https://github.com/PyCQA/flake8-pyi"
56-
"Source" = "https://github.com/PyCQA/flake8-pyi"
57-
"Bug Tracker" = "https://github.com/PyCQA/flake8-pyi/issues"
58-
"Changelog" = "https://github.com/PyCQA/flake8-pyi/blob/main/CHANGELOG.md"
59-
60-
[project.optional-dependencies]
54+
[dependency-groups]
6155
dev = [
6256
"black==25.1.0", # Must match .pre-commit-config.yaml
6357
"flake8-bugbear==24.12.12",
@@ -70,6 +64,12 @@ dev = [
7064
"types-pyflakes<4",
7165
]
7266

67+
[project.urls]
68+
"Homepage" = "https://github.com/PyCQA/flake8-pyi"
69+
"Source" = "https://github.com/PyCQA/flake8-pyi"
70+
"Bug Tracker" = "https://github.com/PyCQA/flake8-pyi/issues"
71+
"Changelog" = "https://github.com/PyCQA/flake8-pyi/blob/main/CHANGELOG.md"
72+
7373
[project.entry-points]
7474
"flake8.extension" = {Y0 = "pyi:PyiTreeChecker"}
7575

0 commit comments

Comments
 (0)