This is an automated email from the ASF dual-hosted git repository.

tomaz pushed a commit to branch apidocs_improvements
in repository https://gitbox.apache.org/repos/asf/libcloud.git

commit d7f0a8bb17089d361bf01fb6c7d751253e06a9fe
Author: Tomaz Muraus <to...@tomaz.me>
AuthorDate: Tue Aug 8 22:46:25 2023 +0200

    Remove docs/apidocs/ directory if it already exists to ensure we always
    start with a clean environment when building apidocs.
---
 docs/conf.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/docs/conf.py b/docs/conf.py
index d3c94288c..9e6f4cba9 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -15,6 +15,7 @@ import os
 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

Reply via email to