Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sphinx won't update html page when python file is updated

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: enter image description here

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: enter image description here

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.

like image 989
Leockl Avatar asked Oct 17 '25 20:10

Leockl


2 Answers

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.

like image 88
bluesummers Avatar answered Oct 20 '25 11:10

bluesummers


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:

  1. Install my module with the -e flag:

pip install -e .

  1. Set the PYTHONPATH to point directly at my module when calling make:

PYTHONPATH=<path/to/your/module> make html

like image 42
Fatore Avatar answered Oct 20 '25 09:10

Fatore