diff --git a/docs/requirements.txt b/docs/requirements.txt index af08a5a075..3b8f197617 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -3,7 +3,7 @@ tornado toolz cloudpickle git+https://github.com/dask/dask -sphinx>=8,<9 # FIXME https://github.com/dask/distributed/issues/9189 +sphinx>=8 dask-sphinx-theme>=4.0.0 sphinx-click memray diff --git a/docs/source/conf.py b/docs/source/conf.py index 3c0155a592..91eb1aaa69 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,5 +1,6 @@ from __future__ import annotations +from inspect import signature from pathlib import Path from docutils.parsers.rst import directives @@ -7,11 +8,21 @@ # -- Configuration to keep autosummary in sync with autoclass::members ---------------------------------------------- # Fixes issues/3693 # See https://stackoverflow.com/questions/20569011/python-sphinx-autosummary-automated-listing-of-member-functions -from sphinx.ext.autosummary import Autosummary, get_documenter +from sphinx.ext import autosummary as sphinx_autosummary +from sphinx.ext.autosummary import Autosummary from sphinx.util.inspect import safe_getattr import distributed + +def get_documenter_objtype(app, obj, parent): + """Return the Sphinx autodoc object type for an object.""" + get_documenter = sphinx_autosummary._get_documenter + if "registry" in signature(get_documenter).parameters: + return get_documenter(obj, parent, registry=app.registry).objtype + return get_documenter(obj, parent) + + # # Dask.distributed documentation build configuration file, created by # sphinx-quickstart on Tue Oct 6 14:42:44 2015. @@ -458,10 +469,10 @@ def get_members(app, obj, typ, include_public=None): items = [] for name in sorted(obj.__dict__.keys()): try: - documenter = get_documenter(app, safe_getattr(obj, name), obj) + objtype = get_documenter_objtype(app, safe_getattr(obj, name), obj) except AttributeError: continue - if documenter.objtype in typ: + if objtype in typ: items.append(name) public = [x for x in items if x in include_public or not x.startswith("_")] return public, items