Skip to content

Commit

Permalink
doc: work around circular dependency
Browse files Browse the repository at this point in the history
Manually install gitpython, because it must be available to
generate the requirements.txt file, which is before the venv is
created.

Issue for this is here:
canonical/sphinx-docs-starter-pack#197

Signed-off-by: Ruth Fuchss <[email protected]>
  • Loading branch information
ru-fu committed Mar 13, 2024
1 parent c29f250 commit 5db8be4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ update-metadata: build
.PHONY: doc-setup
doc-setup: client
@echo "Setting up documentation build environment"
pip3 install gitpython pyyaml
cd doc; LOCAL_SPHINX_BUILD=True python3 .sphinx/build_requirements.py
python3 -m venv doc/.sphinx/venv
. $(SPHINXENV) ; pip install --require-virtualenv --upgrade -r doc/.sphinx/requirements.txt --log doc/.sphinx/venv/pip_install.log
Expand Down
5 changes: 3 additions & 2 deletions doc/.readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ build:
golang: "1.21"
python: "3.11"
jobs:
post_checkout:
- cd doc; python3 .sphinx/build_requirements.py
pre_install:
- pip install gitpython pyyaml
- cd doc && python3 .sphinx/build_requirements.py
pre_build:
- go build -ldflags "-s -w" -o trimpath -o lxc.bin ./lxc
post_build:
Expand Down
7 changes: 5 additions & 2 deletions doc/custom_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,11 @@
# Generate man pages content

os.makedirs('.sphinx/deps/manpages', exist_ok=True)
subprocess.run([lxc, 'manpage', '.sphinx/deps/manpages/', '--format=md'],
check=True)
if (os.path.isfile(lxc)):
subprocess.run([lxc, 'manpage', '.sphinx/deps/manpages/', '--format=md'],
check=True)
else:
print('No man page content generated.')

# Preprocess man pages content

Expand Down

0 comments on commit 5db8be4

Please sign in to comment.