Skip to content

Sphinx 4.1.2 breaks base class detection #9504

@adamjstewart

Description

@adamjstewart

Describe the bug

We noticed a regression in Sphinx 4.1.2 in our CI. In Spack, we have a single base class, PackageBase, that is subclassed in several places, including BundlePackage.

In Sphinx 4.1.1, the base class of BundlePackage was correctly detected as spack.package.PackageBase. In Sphinx 4.1.2, the base class is now detected as spack.package.None. This may have something to do with our use of six.with_metaclass since all other base classes are correctly determined.

How to Reproduce

$ git clone https://github.com/spack/spack
$ cd spack/lib/spack/docs
$ pip install -r requirements.txt
$ make
...
Warning, treated as error:
/home/runner/work/spack/spack/lib/spack/spack/package.py:docstring of spack.package.BundlePackage:1:py:obj reference target not found: spack.package.None

Expected behavior

I would expect the base class to be resolved correctly just like in Sphinx 4.1.1.

Your project

https://github.com/spack/spack

Screenshots

No response

OS

Ubuntu 20.04

Python version

3.8.11

Sphinx version

4.1.2

Sphinx extensions

sphinx.ext.autodoc

Extra tools

graphviz

Additional context

For now, we're pinning Sphinx to 4.1.1 or older, see spack/spack#25097

@scheibelp

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions