readthedocs.org icon indicating copy to clipboard operation
readthedocs.org copied to clipboard

Building works locally, but fails on upload to readthedocs

Open thetazero opened this issue 3 years ago • 1 comments

Details

  • Read the Docs project URL: https://readthedocs.org/projects/pocketqube/
  • Build URL (if applicable): https://pocketqube.readthedocs.io/en/latest/
  • Read the Docs username (if applicable): https://readthedocs.org/profiles/thetazero/

Expected Result

When building with make html locally I get: Screenshot from 2022-07-25 16-50-59 On this page: https://pocketqube.readthedocs.io/en/latest/applications/flight/

Actual Result

However in the actual build I get this: Screenshot from 2022-07-25 16-52-22 And the logs say:

WARNING: autodoc: failed to import class 'naive.NaiveMessage' from module 'lib'; the following exception was raised:
No module named 'lib'
WARNING: autodoc: failed to import module 'priority_queue' from module 'lib'; the following exception was raised:
No module named 'lib'
WARNING: autodoc: failed to import function 'priority_queue.push' from module 'lib'; the following exception was raised:
No module named 'lib'
WARNING: autodoc: failed to import function 'priority_queue.pop' from module 'lib'; the following exception was raised:
No module named 'lib'
WARNING: autodoc: failed to import function 'priority_queue.heapify' from module 'lib'; the following exception was raised:
No module named 'lib'

Here is the entire build log if it helps: https://readthedocs.org/api/v2/build/17534486.txt

I was building on Ubuntu 22.04 LTS if it helps.

thetazero avatar Jul 25 '22 20:07 thetazero

Hi, this is probably because of the CWD being different on RTD (relative to where your conf.py file is), and your local CWD being your docs directory.

https://github.com/PyCubed-Mini/PyCubedMiniDocs/blob/f8b494f7db4124a368f38e9d3f008636c0cd67b9/docs/source/conf.py#L5

To avoid these problems, you should always use explicit absolute paths from your conf.py file, for example:

from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent / "../../flight_software/state_machine/applications/flight"))

stsewd avatar Jul 25 '22 23:07 stsewd