-1

When I run make html with sphinx autodoc enabled, the functions' docstrings are not the actual docstrings.

I have the path configured in my conf.py file

import os
import sys
sys.path.insert(0, os.path.abspath("../../")) # Where the module is located

The output of autodoc:

enter image description here

The actual docstring:

enter image description here

Content of my .rst file:

Subreddit
=========================================

.. autoclass:: redditeasy.Subreddit
   :members:

The output of autodoc is the outdated one. I changed the docstring multiple times but autodoc just kept using the old version.

I cleared cache and uninstalled autodoc multiple times but none of them did anything. Why does this happen? How can I update the docstrings?

mzjn
  • 48,958
  • 13
  • 128
  • 248
Emir Sürmen
  • 884
  • 3
  • 14
  • 33
  • When you "cleared cache", did you do `make clean` to do so? Sphinx only detects changes in document source files, not package source files. – Steve Piercy Feb 28 '22 at 05:51
  • Yes, thats exactly what I did @StevePiercy – Emir Sürmen Mar 03 '22 at 17:15
  • Please provide a [Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example) – Steve Piercy Mar 04 '22 at 10:34
  • @StevePiercy https://github.com/MakufonSkifto/RedditEasy/tree/main/docs is exactly what I use. – Emir Sürmen Mar 05 '22 at 11:02
  • I can't reproduce this. I used `main` branch to build the docs. See before and after I edited the docstring: https://imgur.com/a/5L1UEFh It sounds like you are not editing `redditeasy/subreddit.py`. – Steve Piercy Mar 06 '22 at 10:33

1 Answers1

0

I fixed the issue. It was giving a "no module found" error.

Emir Sürmen
  • 884
  • 3
  • 14
  • 33