diff --git a/docs/conf.py b/docs/conf.py index d3c94288ca..9e6f4cba93 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -15,6 +15,7 @@ import re import sys import glob +import shutil import datetime from sphinx.ext import apidoc @@ -338,6 +339,10 @@ def run_apidoc(_): # Problematic driver with hundreds of issues ignore_paths += ["../libcloud/compute/drivers/outscale.py"] + # Remove existing api docs directory if it exists so we start with a clean environment + apidocs_dir = os.path.abspath(os.path.join(BASE_DIR, "apidocs/")) + shutil.rmtree(apidocs_dir, ignore_errors=True) + argv = [ "--force", # Overwrite output files "--follow-links", # Follow symbolic links