Skip to content

Commit 5475617

Browse files
authored
Backport PR #2633 on branch 0.13.x (docs: adapt to type alias changes) (#2640)
1 parent 6ab0e19 commit 5475617

3 files changed

Lines changed: 21 additions & 16 deletions

File tree

‎.github/workflows/check-pr.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
name: Check for release notes
5858
runs-on: ubuntu-latest
5959
needs: check-milestone
60-
if: github.event.pull_request.user.login != 'pre-commit-ci[bot]' && github.event.pull_request.user.login != 'dependabot[bot]' && needs.check-milestone.outputs.no-relnotes-reason == '' && !contains(fromJSON('["style","refactor","test","build","ci"]'), needs.check-milestone.outputs.type)
60+
if: github.event.pull_request.user.login != 'pre-commit-ci[bot]' && github.event.pull_request.user.login != 'dependabot[bot]' && needs.check-milestone.outputs.no-relnotes-reason == '' && !contains(fromJSON('["style","refactor","test","build","ci","docs"]'), needs.check-milestone.outputs.type)
6161
steps:
6262
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
6363
with: { filter: "blob:none", fetch-depth: 0, persist-credentials: false }

‎docs/conf.py‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@ def setup(app: Sphinx) -> None:
9595
app.add_generic_role("small", partial(nodes.inline, classes=["small"]))
9696
app.add_generic_role("smaller", partial(nodes.inline, classes=["smaller"]))
9797

98+
# https://github.com/mkdocstrings/python/issues/339
99+
from sphinx.domains import ObjType
100+
from sphinx.domains.python import PythonDomain
101+
102+
PythonDomain.object_types.setdefault(
103+
"typealias", ObjType("type alias", "type", "obj")
104+
)
105+
98106
# TODO: move to scanpydoc
99107
if TYPE_CHECKING:
100108
from docutils.nodes import TextElement, reference
@@ -153,12 +161,8 @@ def res(
153161
},
154162
# Can’t use `set_module` for `type`s. When moving out of .experimental, define in actual location.
155163
"anndata._types.StorageType": "anndata.experimental.StorageType",
156-
# https://github.com/theislab/scanpydoc/issues/254
157-
"anndata.typing.Index1D": "anndata.typing.Index1D",
158-
"anndata.typing.Index": "anndata.typing.Index",
159-
"anndata.typing.RWAble": "anndata.typing.RWAble",
160-
"anndata.typing.AxisStorable": "anndata.typing.AxisStorable",
161-
"anndata.typing.InMemoryArray": "anndata.typing.InMemoryArray",
164+
#### zarr
165+
"zarr.core.group.StoreLike": "zarr.storage.StoreLike",
162166
#### h5py
163167
"h5py._hl.group.Group": "h5py.Group",
164168
"h5py._hl.files.File": "h5py.File",

‎pyproject.toml‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,19 +60,20 @@ dev = [
6060
{ include-group = "dev-doc" },
6161
]
6262
doc = [
63-
"sphinx>=9.1.0",
64-
"sphinx-book-theme>=1.1.0",
65-
"sphinx-autodoc-typehints>=3.6.2",
66-
"sphinx-issues>=5.0.1",
67-
"sphinx-copybutton",
68-
"sphinxext.opengraph",
63+
"awkward>=2.6.3",
64+
"ipython", # For syntax highlighting in notebooks
6965
"myst-nb>=1.4",
66+
"myst-parser",
7067
"scanpydoc[theme,typehints] >=0.17.1",
7168
"scverse-misc[sphinx]",
72-
"awkward>=2.6.3",
73-
"IPython", # For syntax highlighting in notebooks
74-
"myst-parser",
69+
"sphinx>=9.1",
70+
"sphinx-book-theme>=1.1",
71+
# TODO: drop URL once https://github.com/tox-dev/sphinx-autodoc-typehints/pull/766 is released
72+
"sphinx-autodoc-typehints @ git+https://github.com/tox-dev/sphinx-autodoc-typehints@refs/pull/766/head",
7573
"sphinx-design",
74+
"sphinx-issues>=5.0.1",
75+
"sphinx-copybutton",
76+
"sphinxext.opengraph",
7677
"anndata[dask]",
7778
"pandas>=3",
7879
"mudata",

0 commit comments

Comments
 (0)