You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "uranusjr (via GitHub)" <gi...@apache.org> on 2026/06/26 20:47:19 UTC

Re: [PR] Fix inconsistency between generated provider docs and pyproject.toml [airflow]

uranusjr commented on code in PR #68991:
URL: https://github.com/apache/airflow/pull/68991#discussion_r3484035912


##########
dev/breeze/src/airflow_breeze/utils/packages.py:
##########
@@ -683,6 +683,27 @@ def get_cross_provider_dependent_packages(provider_id: str) -> list[str]:
     return get_provider_dependencies()[provider_id]["cross-providers-deps"]
 
 
+def get_cross_provider_dependencies_for_extras(provider_id: str) -> list[str]:
+    """Return cross-provider dependencies that can be rendered as installable extras.
+
+    ``cross-providers-deps`` is an import-level graph. Some entries are already
+    required dependencies, so they should not be documented as ``pkg[extra]``.
+    This mirrors the filtering used when generating provider ``pyproject.toml``.
+    """
+    cross_provider_dependencies = get_cross_provider_dependent_packages(provider_id)
+    if not cross_provider_dependencies:
+        return []
+
+    suspended_provider_ids = get_suspended_provider_ids()
+    required_dependencies = "\n".join(get_provider_requirements(provider_id))
+    return [
+        cross_provider_id
+        for cross_provider_id in cross_provider_dependencies
+        if cross_provider_id not in suspended_provider_ids
+        and get_pip_package_name(cross_provider_id) not in required_dependencies

Review Comment:
   This may be brittle in a provider’s name is a substring of another provider’s. Instead of comparing to a string, this can parse the return value of `get_provider_requirements` with `packaging.requirements` and actually match the package names instead.



-- 
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-unsubscribe@airflow.apache.org

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