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


##########
airflow-core/src/airflow/providers_manager.py:
##########
@@ -52,6 +57,33 @@
     "apache-airflow-providers-celery": "2.1.0",
 }
 
+BLOCKED_PROVIDER_MIN_VERSIONS = {
+    "apache-airflow-providers-common-ai": "1.0.0",
+}
+
+
+def _is_source_install(dist: Distribution) -> bool:
+    """Whether the distribution was installed from a local directory, editable 
or not (PEP 610)."""
+    with contextlib.suppress(ValueError):
+        return "dir_info" in json.loads(dist.read_text("direct_url.json") or 
"{}")
+    return False
+
+
+def provider_incompatibility_reason(dist: Distribution) -> str | None:
+    """Return a reason to skip a provider that cannot run with this Airflow 
version."""
+    package_name = canonicalize_name(dist.metadata["Name"])
+    minimum_version = BLOCKED_PROVIDER_MIN_VERSIONS.get(package_name)
+    if minimum_version is None or Version(dist.version) >= 
Version(minimum_version):

Review Comment:
   Good spot



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to