canonical / sphinx-docs-starter-pack

A documentation starter-pack
https://canonical-starter-pack.readthedocs-hosted.com/
Other
15 stars 38 forks source link

`InvalidGitRepositoryError` when building docs in a subdirectory of Git repository #228

Closed tang-mm closed 4 months ago

tang-mm commented 4 months ago

I was trying to initialise a new Sphinx project in the docs/ subdirectory of an existing Git repository. The starter-pack (latest version SHA 4a9b1e4) runs well in the cloned repository. However, when files are copied into the new docs/ subfolder, running local doc builds with make html in the subfolder reports the following error:

Theme error:
An error happened in rendering the page README.
Reason: InvalidGitRepositoryError('/<path>/zapper/docs')
make: *** [Makefile:75: html] Error 2

Apparently, the error is reported by the GitPython module because it failed to search the parent directory. This module was introduced by https://github.com/canonical/sphinx-docs-starter-pack/pull/203

As a temporary solution, I rolled back to a version prior to the commit, and it worked again.

ru-fu commented 4 months ago

Could you check if the patch in https://github.com/canonical/sphinx-docs-starter-pack/pull/229 fixes this?