Skip to content

Commit baf2800

Browse files
committed
Use dependency groups (PEP 735)
1 parent f53affa commit baf2800

5 files changed

Lines changed: 32 additions & 31 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ jobs:
163163

164164
- name: Install the Python dependencies without debugpy
165165
run: |
166-
pip install .[test]
166+
pip install . --group test
167167
pip uninstall --yes debugpy
168168
169169
- name: List installed packages

.readthedocs.yaml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,10 @@ build:
44
os: ubuntu-22.04
55
tools:
66
python: "3.13"
7+
jobs:
8+
install:
9+
- pip install --upgrade pip
10+
- pip install --group docs
711

812
sphinx:
913
configuration: docs/conf.py
10-
11-
python:
12-
install:
13-
# install itself with pip install .
14-
- method: pip
15-
path: .
16-
extra_requirements:
17-
- docs

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ipykernel is a pure Python package, so setting up for development is the same as
1414
git clone https://github.com/ipython/ipykernel
1515
cd ipykernel
1616
# do a 'development' or 'editable' install with pip:
17-
pip install -e .
17+
pip install -e . --group dev
1818
```
1919

2020
## Code Styling

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This package provides the IPython kernel for Jupyter.
99

1010
1. `git clone`
1111
1. `cd ipykernel`
12-
1. `pip install -e ".[test]"`
12+
1. `pip install -e . --group test`
1313

1414
After that, all normal `ipython` commands will use this newly-installed version of the kernel.
1515

pyproject.toml

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,35 +41,40 @@ Source = "https://github.com/ipython/ipykernel"
4141
Tracker = "https://github.com/ipython/ipykernel/issues"
4242

4343
[project.optional-dependencies]
44+
pyqt5 = ["pyqt5"]
45+
pyside6 = ["pyside6"]
46+
47+
[dependency-groups]
4448
docs = [
45-
"sphinx",
46-
"myst_parser",
47-
"pydata_sphinx_theme",
48-
"sphinxcontrib_github_alt",
49-
"sphinxcontrib-spelling",
50-
"sphinx-autodoc-typehints",
51-
"intersphinx_registry",
52-
"trio"
49+
"intersphinx_registry",
50+
"myst_parser",
51+
"pydata_sphinx_theme",
52+
"sphinx",
53+
"sphinxcontrib_github_alt",
54+
"sphinxcontrib-spelling",
55+
"sphinx-autodoc-typehints",
56+
"trio"
5357
]
5458
test = [
55-
"pytest>=7.0,<10",
56-
"pytest-cov",
5759
# 'pytest-xvfb; platform_system == "Linux"',
5860
"flaky",
5961
"ipyparallel",
60-
"pre-commit",
6162
"psutil>=5.7",
63+
"pytest>=7.0,<10",
64+
"pytest-cov",
6265
"pytest-asyncio>=0.23.5",
6366
"pytest-timeout"
6467
]
6568
cov = [
66-
"coverage[toml]",
67-
"pytest-cov",
68-
"matplotlib",
69-
"trio",
69+
"coverage[toml]",
70+
"matplotlib",
71+
"pytest-cov",
72+
"trio",
73+
]
74+
dev = [
75+
"pre-commit",
76+
{include-group = "test"},
7077
]
71-
pyqt5 = ["pyqt5"]
72-
pyside6 = ["pyside6"]
7378

7479
[tool.hatch.version]
7580
path = "ipykernel/_version.py"
@@ -84,20 +89,20 @@ path = "ipykernel/_version.py"
8489
"./ipykernel_launcher.py" = "ipykernel_launcher.py"
8590

8691
[tool.hatch.envs.docs]
87-
features = ["docs"]
92+
dependency-groups = ["docs"]
8893
[tool.hatch.envs.docs.scripts]
8994
build = "make -C docs html SPHINXOPTS='-W'"
9095
api = "sphinx-apidoc -o docs/api -f -E ipykernel tests ipykernel/datapub.py ipykernel/pickleutil.py ipykernel/serialize.py ipykernel/gui ipykernel/pylab ipykernel/utils.py"
9196

9297
[tool.hatch.envs.test]
93-
features = ["test"]
98+
dependency-groups = ["test"]
9499
[tool.hatch.envs.test.scripts]
95100
list = "python -m pip freeze"
96101
test = "python -m pytest -vv {args}"
97102
nowarn = "test -W default {args}"
98103

99104
[tool.hatch.envs.cov]
100-
features = ["test", "cov"]
105+
dependency-groups = ["test", "cov"]
101106
[tool.hatch.envs.cov.scripts]
102107
test = "python -m pytest -vv --cov ipykernel --cov-branch --cov-report term-missing:skip-covered {args}"
103108
nowarn = "test -W default {args}"

0 commit comments

Comments
 (0)