potiuk commented on code in PR #25306:
URL: https://github.com/apache/airflow/pull/25306#discussion_r932079700


##########
dev/provider_packages/prepare_provider_packages.py:
##########
@@ -314,7 +314,20 @@ def get_install_requirements(provider_package_id: str, 
version_suffix: str) -> s
 
     :return: install requirements of the package
     """
-    install_requires = ALL_DEPENDENCIES[provider_package_id][DEPS]
+
+    def apply_version_suffix(install_clause: str) -> str:
+        if install_clause.startswith("apache-airflow") and ">=" in 
install_clause and version_suffix != "":
+            # This is workaround for `pip` bug. When you specify dependency as 
>= X.Y.Z, and you
+            # Have packages X.Y.Zdev0 or X.Y.Zrc1, the "=" part does not 
include the pre-release versions
+            # you need to explicitly specify >= X.Y.Za0 to include pre-release 
versions.
+            # Therefore, when we are preparing pre-releases we always add a0 
for airflow and other providers
+            # to Allow installing two packages released in rc* that depend on 
each-other

Review Comment:
   Actually after further reading of the PEP, I tested one more approach. It's 
not explicitly mentioned in the PEP, but apparently it works.
   
   Seems that converting the "pre-release" depencies to have  ".*" at the end 
even in >= would include all kinds of pre-releases, so at least we have a way 
to specify "all pre-releases including development ones" in our dependencies. 
So `apache-airflow-providers-common-sql>=1.1.0.*` works in this case and that's 
what I am going to settle with I think. 
   
   This is the part of meta-data fron .whl in the Google Provider that works:
   
   ```
   Requires-Dist: PyOpenSSL
   Requires-Dist: apache-airflow-providers-common-sql (>=1.1.0.*)
   Requires-Dist: apache-airflow (>=2.2.0.*)
   Requires-Dist: google-ads (>=15.1.1)
   ```
   
   I think that's sustainable for our case (but we have to manually modify the 
requirements). Would be great to add this behaviour to `--pre` flag I guess, 
but we can definitely live with that even if it is not added.



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