Index: mpi4py/conf/requirements-docs.txt
===================================================================
--- mpi4py.orig/conf/requirements-docs.txt	2025-07-18 14:22:12.942878941 +0200
+++ mpi4py/conf/requirements-docs.txt	2025-07-22 22:16:43.641538933 +0200
@@ -1,4 +1,4 @@
 docutils >= 0.21
-sphinx == 8.2.3
+sphinx == 8.1.3
 sphinx-copybutton == 0.5.2
 sphinx-rtd-theme == 3.0.2
Index: mpi4py/docs/source/conf.py
===================================================================
--- mpi4py.orig/docs/source/conf.py	2025-07-22 22:13:45.492173901 +0200
+++ mpi4py/docs/source/conf.py	2025-07-22 22:21:48.548580922 +0200
@@ -165,16 +165,14 @@
         autodoc_type_aliases[name] = f"~mpi4py.typing.{name}"
 
     from sphinx.domains.python import PythonDomain
-    from sphinx.util.inspect import TypeAliasForwardRef
 
     PythonDomain.object_types["data"].roles += ("class",)
-    TypeAliasForwardRef.__repr__ = lambda self: self.name
 
 
 def _setup_autodoc(app):
     from sphinx.ext import autodoc, autosummary
     from sphinx.locale import _
-    from sphinx.util.typing import restify
+    from sphinx.util import typing
 
     #
 
@@ -249,7 +247,7 @@
                 more_content.append(content, "")
                 more_content.append("", "")
             if istypealias(obj, self.name):
-                content = _("alias of %s") % restify(obj)
+                content = _('alias of %s') % typing.restify(obj)
                 more_content.append(content, "")
                 more_content.append("", "")
             super().update_content(more_content)
@@ -268,27 +266,18 @@
     class ExceptionDocumenterCustom(ExceptionDocumenter):
         objtype = "class"
 
-    def get_documenter(*args, **kwargs):
-        if hasattr(autosummary, "_get_documenter"):
-            obj, args = args[0], args[1:]
-            get_documenter = autosummary._get_documenter
-        else:
-            obj, args = args[1], (args[0], *args[2:])
-            get_documenter = autosummary.get_documenter
+    def get_documenter(app, obj, parent):
         if isinstance(obj, type) and issubclass(obj, BaseException):
             caller = sys._getframe().f_back.f_code.co_name
             if caller == "generate_autosummary_content":
                 if obj.__module__ == "mpi4py.MPI":
                     if obj.__name__ == "Exception":
                         return ExceptionDocumenterCustom
-        return get_documenter(obj, *args, **kwargs)
+        return autosummary.get_documenter(app, obj, parent)
 
     from sphinx.ext.autosummary import generate
 
-    if hasattr(generate, "_get_documenter"):
-        generate._get_documenter = get_documenter
-    else:
-        generate.get_documenter = get_documenter
+    generate.get_documenter = get_documenter
 
 
 def setup(app):
