Skip to content

Commit 1c8f84f

Browse files
authored
ci: switch to dependency groups (#149)
1 parent 9e66024 commit 1c8f84f

2 files changed

Lines changed: 43 additions & 35 deletions

File tree

.readthedocs.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1+
# https://docs.readthedocs.io/en/stable/config-file/v2.html
12
version: 2
23
build:
34
os: ubuntu-24.04
45
tools:
5-
python: "3.12"
6-
sphinx:
7-
configuration: docs/conf.py
8-
fail_on_warning: true
9-
python:
10-
install:
11-
- method: pip
12-
path: .
13-
extra_requirements:
14-
- docs
6+
python: '3.14'
7+
jobs:
8+
post_checkout:
9+
# unshallow so version can be derived from tag
10+
- git fetch --unshallow || true
11+
create_environment:
12+
- asdf plugin add uv
13+
- asdf install uv latest
14+
- asdf global uv latest
15+
build:
16+
html:
17+
- uvx hatch run docs:build
18+
- mv docs/_build $READTHEDOCS_OUTPUT

pyproject.toml

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -24,49 +24,54 @@ classifiers = [
2424
]
2525
dynamic = [ "description", "version" ]
2626
dependencies = [ ]
27-
optional-dependencies.docs = [
28-
"click!=8.3",
27+
optional-dependencies.jupyter = [ "ipywidgets" ]
28+
urls.Documentation = "https://session-info2.readthedocs.io/"
29+
urls.Issues = "https://github.com/flying-sheep/session-info2/issues"
30+
urls.Source = "https://github.com/flying-sheep/session-info2"
31+
scripts.session-info = "session_info2.cli:main"
32+
scripts.session-info2 = "session_info2.cli:main" # So `uvx session-info2` works
33+
34+
[dependency-groups]
35+
test = [
36+
"coverage[toml]>=6.5",
37+
"ipykernel",
38+
"jupyter-client",
39+
"pytest",
40+
"pytest-asyncio",
41+
"pytest-md", # For GitHub report
42+
"pytest-subprocess",
43+
"testing-common-database", # Example package as “test data”
44+
]
45+
docs = [
46+
"click>=8.3.1",
2947
"furo",
3048
"hatch",
31-
"myst-nb",
49+
"ipywidgets",
50+
"myst-nb>=1.3",
3251
"session-info2[notebook]",
3352
"sphinx",
3453
"sphinx-autodoc-typehints",
3554
"sphinx-codeautolink",
3655
]
37-
optional-dependencies.jupyter = [ "ipywidgets" ]
3856
# Dependencies needed to run the notebook
39-
optional-dependencies.notebook = [
57+
notebook = [
4058
"numpy",
4159
"session-info",
4260
"session-info2[jupyter]",
4361
]
44-
optional-dependencies.test = [
45-
"coverage[toml]>=6.5",
46-
"ipykernel",
47-
"jupyter-client",
48-
"pytest",
49-
"pytest-asyncio",
50-
"pytest-md", # For GitHub report
51-
"pytest-subprocess",
52-
"testing-common-database", # Example package as “test data”
53-
]
54-
urls.Documentation = "https://github.com/flying-sheep/session-info2#readme"
55-
urls.Issues = "https://github.com/flying-sheep/session-info2/issues"
56-
urls.Source = "https://github.com/flying-sheep/session-info2"
57-
scripts.session-info = "session_info2.cli:main"
58-
scripts.session-info2 = "session_info2.cli:main" # So `uvx session-info2` works
5962

60-
[tool.hatch.envs.docs]
63+
[tool.hatch.envs.default]
6164
installer = "uv"
62-
features = [ "docs" ]
65+
66+
[tool.hatch.envs.docs]
67+
dependency-groups = [ "docs" ]
6368
scripts.build = "sphinx-build -W --keep-going -b html docs docs/_build/html {args}"
6469
scripts.open = "python3 -m webbrowser -t docs/_build/html/index.html"
6570
scripts.clean = "git clean -fdX -- {args:docs}"
6671

6772
[tool.hatch.envs.hatch-test]
6873
default-args = [ ]
69-
features = [ "test" ]
74+
dependency-groups = [ "test" ]
7075
extra-dependencies = [ "pyinstrument" ]
7176
overrides.matrix.deps.features = [
7277
{ if = [ "all" ], value = "jupyter" },
@@ -77,8 +82,7 @@ python = [ "3.14", "3.10" ]
7782
deps = [ "all", "min" ]
7883

7984
[tool.hatch.envs.notebook]
80-
# installer = "uv" # https://github.com/astral-sh/uv/issues/6032
81-
features = [ "notebook" ]
85+
dependency-groups = [ "notebook" ]
8286
extra-dependencies = [ "ipykernel" ]
8387
scripts.install-kernel = "python -m ipykernel install --user --name=session-info2 --display-name=session-info2 --env COLUMNS 110"
8488

0 commit comments

Comments
 (0)