ashb commented on code in PR #51153:
URL: https://github.com/apache/airflow/pull/51153#discussion_r2132096306


##########
task-sdk/docs/conf.py:
##########
@@ -0,0 +1,95 @@
+# Disable Flake8 because of all the sphinx imports
+#
+# 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.
+from __future__ import annotations
+
+from pathlib import Path
+
+CONF_DIR = Path(__file__).parent.absolute()
+
+project = "Apache Airflow Task SDK"
+
+language = "en"
+locale_dirs: list[str] = []
+
+extensions = [
+    "sphinx.ext.autodoc",
+    "autoapi.extension",
+    "sphinx.ext.intersphinx",
+]
+
+autoapi_dirs = [CONF_DIR.joinpath("..", "src").resolve()]
+autoapi_root = "api"
+autoapi_ignore = [
+    "*/airflow/sdk/execution_time",
+    "*/airflow/sdk/api",
+    "*/_internal*",
+]
+autoapi_options = [
+    "undoc-members",
+    "members",
+    "imported-members",
+]
+autoapi_add_toctree_entry = False
+autoapi_generate_api_docs = False
+
+autodoc_typehints = "description"
+
+# Prefer pyi over py files if both are found
+autoapi_file_patterns = ["*.pyi", "*.py"]
+# autoapi_generate_api_docs = False
+
+html_theme = "sphinx_airflow_theme"
+
+# Add static path for custom CSS overrides
+html_static_path = [str(CONF_DIR / "_static")]
+
+# Custom CSS files to override default theme spacing
+html_css_files = [
+    "custom.css",
+]
+
+global_substitutions = {
+    "experimental": "This is an :ref:`experimental feature <experimental>`.",
+}
+
+rst_epilog = "\n".join(f".. |{key}| replace:: {replace}" for key, replace in 
global_substitutions.items())
+
+
+intersphinx_resolve_self = "airflow"
+intersphinx_mapping = {
+    "airflow": ("https://airflow.apache.org/docs/apache-airflow/stable/";, 
None),
+}
+suppress_warnings = [
+    "autoapi.python_import_resolution",
+    "autodoc",
+]
+
+
+def skip_util_classes(app, objtype, name, obj, skip, options):
+    if "definitions" in name:
+        if name == "DAG":
+            obj.id = "airflow.sdk.DAG"
+            return skip
+        skip = True
+    return skip
+
+
+def setup(app):
+    # Skip utility classes from definitions modules, but expose DAG under 
airflow.sdk.DAG
+    app.connect("autoapi-skip-member", skip_util_classes)

Review Comment:
   Is this needed still?



-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org

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

Reply via email to