I am having an issue where Sphinx won't update the html page when my python file is updated.
My docs folder look like this:

The api.rst file in the folder above looks like this:
API Documentation
=================
This is a documentation for the Helstrom Quantum Centroid (HQC) classifier's API.
.. automodule:: hqc.HQC
:members:
The hqc folder looks like this:

Both the docs folder and the hqc folder are in the same HQC folder.
When I update the HQC.py file and run make html in the command prompt, the html page won't update itself.
But I noticed that when I change the folder name from hqc to a new folder name, say hqc1 (and change hqc.HQC to hqc1.HQC in the api.rst file too), then the html page updates when I run make html.
What am I missing or how do I fix this? Would really prefer the hqc folder name to stay as hqc.
Happens sometimes when sphinx doesn't recognize the changes, use make clean && make html, this will first delete all existing files and then create new ones.
I was struggling with the same problem and, in my case, the issue was that sphinx was looking at an older version of my module installed locally.
Two things worked for me:
-e flag:pip install -e .
PYTHONPATH to point directly at my module when calling make:PYTHONPATH=<path/to/your/module> make html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With