rmartin16 / qbittorrent-api

Python client implementation for qBittorrent's Web API
https://qbittorrent-api.readthedocs.io/
MIT License
402 stars 66 forks source link

Build docs with sphinx-build is broken #165

Closed fabricionaweb closed 1 year ago

fabricionaweb commented 1 year ago

Describe the bug

In the change d950c1bb62dca8e039fddb016ee89f2e63e7e252 the project have been moved to src/qbittorrentapi folder but the sphinix still try to import from qbittorrentapi and it breaks

Warning, treated as error:
autodoc: failed to import class 'app.AppAPIMixIn' from module 'qbittorrentapi'; the following exception was raised:
No module named 'qbittorrentapi'

Steps to reproduce

  1. sphinx-build -W -b man docs/source docs/build

Expected behavior

To build without break.

Screenshots

No response

Environment

Additional context

I was able to fix it by adding src to the syspath in the docs/source/config.py:19 to something like this:

sys.path.insert(0, os.path.join(base_path, "src"))

Not sure it is the best solution, but its my 2cents :)

rmartin16 commented 1 year ago

Good timing; I was actually just updating docs building.

I always build the docs with an editable install of qbittorrent-api; so, I never hit this. But the base_path is already being inserted in to sys.path, so no reason not to update that to your recommendation.

Thanks for letting me know.