From f542afb37fe852b7b02327a7b1b4fe827a8ff8a2 Mon Sep 17 00:00:00 2001 From: Philipp Heckel Date: Mon, 6 Jun 2022 14:38:28 -0400 Subject: [PATCH] Hack to make sure docs are built with the right Python version --- Makefile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f2e741d5..b2f40bcc 100644 --- a/Makefile +++ b/Makefile @@ -96,7 +96,18 @@ build-deps-ubuntu: docs: docs-deps docs-build docs-build: .PHONY - mkdocs build + @if ! /bin/echo -e "import sys\nif sys.version_info < (3,8):\n exit(1)" | python3; then \ + if which python3.8; then \ + echo "python3.8 $(shell which mkdocs) build"; \ + python3.8 $(shell which mkdocs) build; \ + else \ + echo "ERROR: Python version too low. mkdocs-material needs >= 3.8"; \ + exit 1; \ + fi; \ + else \ + echo "mkdocs build"; \ + mkdocs build; \ + fi docs-deps: .PHONY pip3 install -r requirements.txt