Skip to content
Snippets Groups Projects
Commit b6661e1d authored by Ian Bell's avatar Ian Bell
Browse files

Only execute on RTD

parent d8d2a0db
No related branches found
No related tags found
No related merge requests found
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html # https://www.sphinx-doc.org/en/master/usage/configuration.html
import os, subprocess import os, subprocess
on_rtd = os.environ.get('READTHEDOCS') == 'True'
# -- Path setup -------------------------------------------------------------- # -- Path setup --------------------------------------------------------------
...@@ -27,13 +28,14 @@ author = 'Ian Bell' ...@@ -27,13 +28,14 @@ author = 'Ian Bell'
import teqp import teqp
release = teqp.__version__ release = teqp.__version__
# -- Exeucute all notebooks -------------------------------------------------- # -- Execute all notebooks --------------------------------------------------
# subprocess.check_output(f'jupyter nbconvert --version', shell=True) if on_rtd:
for path, dirs, files in os.walk('.'): # subprocess.check_output(f'jupyter nbconvert --version', shell=True)
for file in files: for path, dirs, files in os.walk('.'):
if file.endswith('.ipynb') and '.ipynb_checkpoints' not in path: for file in files:
subprocess.check_output(f'jupyter nbconvert --to notebook --output {file} --execute {file}', shell=True, cwd=path) if file.endswith('.ipynb') and '.ipynb_checkpoints' not in path:
# --ExecutePreprocessor.allow_errors=True (this allows you to allow errors globally, but a raises-exception cell tag is better) subprocess.check_output(f'jupyter nbconvert --to notebook --output {file} --execute {file}', shell=True, cwd=path)
# --ExecutePreprocessor.allow_errors=True (this allows you to allow errors globally, but a raises-exception cell tag is better)
### -- Auto-generate API documentation ----------------------------------------- ### -- Auto-generate API documentation -----------------------------------------
here = os.path.dirname(__file__) here = os.path.dirname(__file__)
...@@ -62,7 +64,6 @@ exclude_patterns = [] ...@@ -62,7 +64,6 @@ exclude_patterns = []
# The theme to use for HTML and HTML Help pages. See the documentation for # The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes. # a list of builtin themes.
# #
on_rtd = os.environ.get('READTHEDOCS') == 'True'
if on_rtd: if on_rtd:
html_theme = 'default' html_theme = 'default'
else: else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment