diff options
Diffstat (limited to 'mesonbuild/modules')
-rw-r--r-- | mesonbuild/modules/hotdoc.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/mesonbuild/modules/hotdoc.py b/mesonbuild/modules/hotdoc.py index 800f766..6a0c48b 100644 --- a/mesonbuild/modules/hotdoc.py +++ b/mesonbuild/modules/hotdoc.py @@ -15,6 +15,7 @@ '''This module provides helper functions for generating documentation using hotdoc''' import os +import subprocess from collections import OrderedDict from mesonbuild import mesonlib @@ -392,12 +393,14 @@ class HotDocModule(ExtensionModule): self.hotdoc = ExternalProgram('hotdoc') if not self.hotdoc.found(): raise MesonException('hotdoc executable not found') + version = self.hotdoc.get_version(interpreter) + if not mesonlib.version_compare(version, f'>={MIN_HOTDOC_VERSION}'): + raise MesonException(f'hotdoc {MIN_HOTDOC_VERSION} required but not found.)') - try: - from hotdoc.run_hotdoc import run # noqa: F401 - self.hotdoc.run_hotdoc = run - except Exception as e: - raise MesonException(f'hotdoc {MIN_HOTDOC_VERSION} required but not found. ({e})') + def run_hotdoc(cmd): + return subprocess.run(self.hotdoc.get_command() + cmd, stdout=subprocess.DEVNULL).returncode + + self.hotdoc.run_hotdoc = run_hotdoc self.methods.update({ 'has_extensions': self.has_extensions, 'generate_doc': self.generate_doc, |