You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
…ent class
Autodoc generates incorrect references to the parent class the target
class inherites the class having `_name` attribute. It conciders the
parent is a kind of SpecialForm'ed class by mistake. This uses
`isinstance(X, SpecialForm)` to check that.
Note: SpecialForm became a class since Python 3.7.
Thank you for reporting. This must be a regression of 4.1.2. I'll fix this soon (see #9515).
Note: I confirmed the error with this Dockefile:
FROM python:3.8-slim
RUN apt update; apt install -y build-essential curl git unzip vim
RUN git clone https://github.com/spack/spack
WORKDIR /spack/lib/spack/docs
RUN pip3 install -r requirements.txt
RUN apt install -y graphviz
RUN pip3 install -U Sphinx
RUN make
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 asspack.package.PackageBase
. In Sphinx 4.1.2, the base class is now detected asspack.package.None
. This may have something to do with our use ofsix.with_metaclass
since all other base classes are correctly determined.How to Reproduce
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
The text was updated successfully, but these errors were encountered: