From 29d01ccdd71ff539777566660b0800d2fd48dca7 Mon Sep 17 00:00:00 2001 From: Johannes Laurin Hoermann Date: Mon, 15 Jan 2024 17:08:15 +0100 Subject: [PATCH] DOC: conditionally exclude fenics-dependent notebooks when building the documentation if fenics not available --- docs/conf.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index 1bb3240f..c27f922d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -87,6 +87,11 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build'] +# conditionally exclude fenics-dependent jupyter notebook if fenics not available +try: + import fenics +except ModuleNotFoundError: + exclude_patterns.extend(["applications/electrochemistry_2.py"]) # The reST default role (used for this markup: `text`) to use for all # documents.