Staging instance, all changes can be removed at any time

Skip to content

Fix documentation build issues because of Sphinx limitations

The recent refactoring done in abe741a9, then used in swh-loader-svn@72dfc411, introduced build issues with the documentation:

…/swh/loader/svn/directory.py:docstring of swh.loader.svn.directory.SvnDirectoryLoader.snapshot:1:
    WARNING: more than one target found for cross-reference 'Snapshot': swh.fuse.fs.artifact.Snapshot, swh.model.model.Snapshot
…/swh/loader/svn/directory.py:docstring of swh.loader.svn.directory.SvnDirectoryLoader.cnts:1:
    WARNING: more than one target found for cross-reference 'Content': swh.fuse.fs.artifact.Content, swh.model.from_disk.Content, swh.model.model.Content
…/swh/loader/svn/directory.py:docstring of swh.loader.svn.directory.SvnDirectoryLoader.dirs:1:
    WARNING: more than one target found for cross-reference 'Directory': swh.fuse.fs.artifact.Directory, swh.model.from_disk.Directory, swh.model.model.Directory

vlorentz explained the cause:

SvnDirectoryLoader inherits from BaseDirectoryLoader which inherits from NodeLoader, which defines:

self.snapshot: Optional[Snapshot] = None

and it loses the annotation's value (only keeps its string representation) because of the inheritence: https://github.com/sphinx-doc/sphinx/issues/10124

In order to fix this, we now use a qualified type reference in the initializers of NodeLoader and BaseDirectoryLoader.

Merge request reports

Loading