ephraimbuddy commented on code in PR #38764:
URL: https://github.com/apache/airflow/pull/38764#discussion_r1555570656


##########
hatch_build.py:
##########
@@ -577,29 +594,48 @@ def get_provider_requirement(provider_spec: str) -> str:
         return f"apache-airflow-providers-{provider_spec.replace('.', '-')}"
 
 
-# if providers are ready, we can preinstall them
-PREINSTALLED_PROVIDERS = [
+# if providers are ready, we build provider requirements for them
+PREINSTALLED_PROVIDER_REQUIREMENTS = [
     get_provider_requirement(provider_spec)
     for provider_spec in PRE_INSTALLED_PROVIDERS
     if PROVIDER_DEPENDENCIES[get_provider_id(provider_spec)]["state"] == 
"ready"
 ]
 
-# if provider is in not-ready or pre-release, we need to install its 
dependencies
-# however we need to skip apache-airflow itself and potentially any providers 
that are
-PREINSTALLED_NOT_READY_DEPS = []
+# Here we keep all pre-installed provider dependencies, so that we can add 
them as requirements in
+# editable build to make sure that all dependencies are installed when we 
install Airflow in editable mode
+# We need to skip apache-airflow min-versions and flag (exit) when 
pre-installed provider has
+# dependency to another provider
+ALL_PREINSTALLED_PROVIDER_DEPS: list[str] = []
+
+# We very rarely - and only for the time when we plan to release a new 
preinstalled provider in next release
+# we have the preinstalled provider that is in non-ready state.
+# If provider is in not-ready state, we need to install its dependencies in 
editable mode as well as
+# when we are building the wheel in CI. In pre-release branch we should never 
have a non-ready provider
+# added, so this will only be used in main branch for CI builds.
+PREINSTALLED_NOT_READY_PROVIDER_DEPS: list[str] = []
+
 for provider_spec in PRE_INSTALLED_PROVIDERS:
     provider_id = get_provider_id(provider_spec)
-    if PROVIDER_DEPENDENCIES[provider_id]["state"] not in ["ready", 
"suspended", "removed"]:
-        for dependency in PROVIDER_DEPENDENCIES[provider_id]["deps"]:
-            if dependency.startswith("apache-airflow-providers"):
-                msg = (
-                    f"The provider {provider_id} is pre-installed and it has 
as dependency "
-                    f"to another provider {dependency}. This is not allowed. 
Pre-installed"
-                    f"providers should only have 'apache-airflow' and regular 
dependencies."
-                )
-                raise SystemExit(msg)
-            if not dependency.startswith("apache-airflow"):
-                PREINSTALLED_NOT_READY_DEPS.append(dependency)
+    for dependency in PROVIDER_DEPENDENCIES[provider_id]["deps"]:
+        if (
+            dependency.startswith("apache-airflow-providers")
+            and get_provider_id(dependency) not in PRE_INSTALLED_PROVIDERS
+        ):
+            msg = (
+                f"The provider {provider_id} is pre-installed and it has as 
dependency "

Review Comment:
   ```suggestion
                   f"The provider {provider_id} is pre-installed and it has a 
dependency "
   ```



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