You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/04/03 15:19:25 UTC

[GitHub] [airflow] mik-laj commented on a change in pull request #15176: Less docker magic in docs building

mik-laj commented on a change in pull request #15176:
URL: https://github.com/apache/airflow/pull/15176#discussion_r606676122



##########
File path: docs/exts/docs_build/run-patched-sphinx.py
##########
@@ -0,0 +1,105 @@
+#!/usr/bin/env python
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import os
+import sys
+
+import autoapi
+from autoapi.extension import (
+    LOGGER,
+    ExtensionError,
+    bold,
+    darkgreen,
+    default_backend_mapping,
+    default_file_mapping,
+    default_ignore_patterns,
+)
+from sphinx.cmd.build import main
+
+
+def run_autoapi(app):
+    """Load AutoAPI data from the filesystem."""
+    if not app.config.autoapi_dirs:
+        raise ExtensionError("You must configure an autoapi_dirs setting")
+
+    # Make sure the paths are full
+    normalized_dirs = []
+    autoapi_dirs = app.config.autoapi_dirs
+    if isinstance(autoapi_dirs, str):
+        autoapi_dirs = [autoapi_dirs]
+    for path in autoapi_dirs:
+        if os.path.isabs(path):
+            normalized_dirs.append(path)
+        else:
+            normalized_dirs.append(os.path.normpath(os.path.join(app.confdir, path)))
+
+    for _dir in normalized_dirs:
+        if not os.path.exists(_dir):
+            raise ExtensionError(
+                "AutoAPI Directory `{dir}` not found. "
+                "Please check your `autoapi_dirs` setting.".format(dir=_dir)
+            )
+
+    # Change from app.confdir to app.srcdir.
+    # Before:
+    # - normalized_root = os.path.normpath(
+    # -    os.path.join(app.confdir, app.config.autoapi_root)
+    # -)
+    normalized_root = os.path.normpath(os.path.join(app.srcdir, app.config.autoapi_root))

Review comment:
       Here is the root of the problems. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org