Skip to content

Commit af09beb

Browse files
authored
ci: switch to dependency groups (#2276)
1 parent f100cae commit af09beb

7 files changed

Lines changed: 32 additions & 28 deletions

File tree

.github/workflows/benchmark.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
ASV_DIR: "./benchmarks"
3333

3434
steps:
35-
- uses: actions/checkout@v5
35+
- uses: actions/checkout@v6
3636
with:
3737
fetch-depth: 0
3838
# no blob filter so asv can checkout other commits

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
permissions:
1212
id-token: write # to authenticate as Trusted Publisher to pypi.org
1313
steps:
14-
- uses: actions/checkout@v5
14+
- uses: actions/checkout@v6
1515
with:
1616
fetch-depth: 0
1717
filter: blob:none

.github/workflows/test-cpu.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
outputs:
2222
envs: ${{ steps.get-envs.outputs.envs }}
2323
steps:
24-
- uses: actions/checkout@v5
24+
- uses: actions/checkout@v6
2525
with:
2626
filter: blob:none
2727
fetch-depth: 0
@@ -48,7 +48,7 @@ jobs:
4848
ENV_NAME: ${{ matrix.env.name }}
4949
IO_MARK: ${{ matrix.io_mark }}
5050
steps:
51-
- uses: actions/checkout@v5
51+
- uses: actions/checkout@v6
5252
with:
5353
fetch-depth: 0
5454
filter: blob:none
@@ -93,7 +93,7 @@ jobs:
9393
build:
9494
runs-on: ubuntu-24.04
9595
steps:
96-
- uses: actions/checkout@v5
96+
- uses: actions/checkout@v6
9797
with:
9898
fetch-depth: 0
9999
filter: blob:none

.github/workflows/test-gpu.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,12 @@ jobs:
7373
- name: Install AnnData
7474
run: |
7575
uv venv
76-
uv pip install -e ".[dev,test,cu12]" -c ci/constraints.txt
76+
uv pip install -e ".[cu12]" --group=test -c ci/constraints.txt
7777
7878
- name: Env list
7979
run: uv pip list
8080

81-
- name: Run test
82-
env:
83-
COVERAGE_PROCESS_START: ${{ github.workspace }}/pyproject.toml
81+
- name: Run tests
8482
run: |
8583
uv run coverage run -m pytest -m gpu -n auto
8684
uv run coverage combine

.readthedocs.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# https://docs.readthedocs.io/en/stable/config-file/v2.html
12
version: 2
23
build:
34
os: ubuntu-24.04
@@ -7,18 +8,17 @@ build:
78
post_checkout:
89
# unshallow so version can be derived from tag
910
- git fetch --unshallow || true
11+
create_environment:
12+
- asdf plugin add uv
13+
- asdf install uv latest
14+
- asdf global uv latest
1015
pre_build:
1116
# run towncrier to preview the next version’s release notes
1217
- ( find docs/release-notes -regex '[^.]+[.][^.]+.md' | grep -q . ) && towncrier build --keep || true
13-
sphinx:
14-
configuration: docs/conf.py
15-
fail_on_warning: true # do not change or you will be fired
16-
python:
17-
install:
18-
- method: pip
19-
path: .
20-
extra_requirements:
21-
- doc
18+
build:
19+
html:
20+
- uvx hatch run docs:build
21+
- mv docs/_build $READTHEDOCS_OUTPUT
2222
submodules:
2323
include:
2424
- "docs/tutorials/notebooks"

hatch.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[envs.default]
22
installer = "uv"
3-
features = [ "dev" ]
3+
dependency-groups = [ "dev" ]
44

55
[envs.docs]
6-
features = [ "doc" ]
7-
scripts.build = "sphinx-build -M html docs docs/_build -W --keep-going {args}"
6+
dependency-groups = [ "doc" ]
7+
scripts.build = "sphinx-build -M html docs docs/_build -W {args}"
88
scripts.open = "python3 -m webbrowser -t docs/_build/html/index.html"
99
scripts.clean = "git clean -fdX -- {args:docs}"
1010

@@ -15,7 +15,7 @@ scripts.clean = "git restore --source=HEAD --staged --worktree -- docs/release-n
1515

1616
[envs.hatch-test]
1717
default-args = [ ]
18-
features = [ "dev", "test-min" ]
18+
dependency-groups = [ "dev", "test-min" ]
1919
extra-dependencies = [ "ipykernel" ]
2020
env-vars.UV_CONSTRAINT = "ci/constraints.txt"
2121
overrides.matrix.deps.env-vars = [
@@ -41,7 +41,7 @@ overrides.matrix.deps.python = [
4141
{ if = [ "stable" ], value = "3.13" },
4242
{ if = [ "pre" ], value = "3.14" },
4343
]
44-
overrides.matrix.deps.features = [
44+
overrides.matrix.deps.dependency-groups = [
4545
{ if = [ "stable", "pre" ], value = "test" },
4646
]
4747
overrides.matrix.deps.extra-args = { if = [ "stable", "pre" ], value = [ "--strict-warnings" ] }

pyproject.toml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,9 @@ Documentation = "https://anndata.readthedocs.io/"
5454
Source = "https://github.com/scverse/anndata"
5555
Home-page = "https://github.com/scverse/anndata"
5656

57-
58-
[project.optional-dependencies]
57+
[dependency-groups]
5958
dev = [
60-
"anndata[dev-doc]",
59+
{ include-group = "dev-doc" },
6160
]
6261
doc = [
6362
"sphinx>=8.2.1,<9", # https://github.com/tox-dev/sphinx-autodoc-typehints/issues/586
@@ -73,10 +72,16 @@ doc = [
7372
"IPython", # For syntax highlighting in notebooks
7473
"myst_parser",
7574
"sphinx_design>=0.5.0",
75+
"anndata[dask]",
7676
# for unreleased changes
77-
"anndata[dev-doc,dask]",
77+
{ include-group = "dev-doc" },
7878
]
7979
dev-doc = [ "towncrier>=24.8.0" ] # release notes tool
80+
test = [
81+
"fast-array-utils>=1.2.3",
82+
"anndata[lazy]",
83+
{ include-group = "test-min" },
84+
]
8085
test-min = [
8186
"pytest",
8287
"pytest-cov", # only for VS Code
@@ -98,7 +103,8 @@ test-min = [
98103
"pyarrow",
99104
"anndata[dask]",
100105
]
101-
test = [ "anndata[test-min,lazy]", "fast-array-utils>=1.2.3" ]
106+
107+
[project.optional-dependencies]
102108
gpu = [ "cupy" ]
103109
cu12 = [ "cupy-cuda12x" ]
104110
cu11 = [ "cupy-cuda11x" ]

0 commit comments

Comments
 (0)