You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ka...@apache.org on 2025/06/06 09:27:22 UTC

(airflow) 02/09: [v3-0-test] Add sqlalchemy-spanner limitation for broken 1.12.0 release (#51393) (#51432)

This is an automated email from the ASF dual-hosted git repository.

kaxilnaik pushed a commit to branch v3-0-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 0da152ae2c64a5c49c75ea81e2ed60824922551b
Author: Wei Lee <we...@gmail.com>
AuthorDate: Thu Jun 5 20:17:39 2025 +0800

    [v3-0-test] Add sqlalchemy-spanner limitation for broken 1.12.0 release (#51393) (#51432)
    
    When constraints are calculated, we should termporarily exclude
    the sqlalchemy-spanner from the install command until they fix
    the problem where 1.12.0 was relesed without .whl files.
    
    Tracked in https://github.com/googleapis/python-spanner-sqlalchemy/issues/682
    
    Co-authored-by: Jarek Potiuk <ja...@potiuk.com>
---
 scripts/in_container/run_generate_constraints.py | 21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/scripts/in_container/run_generate_constraints.py b/scripts/in_container/run_generate_constraints.py
index 8353595e1b4..6db4f349fba 100755
--- a/scripts/in_container/run_generate_constraints.py
+++ b/scripts/in_container/run_generate_constraints.py
@@ -341,7 +341,15 @@ def generate_constraints_pypi_providers(config_params: ConfigParams) -> None:
     providers are used by our users to install Airflow in reproducible way.
     :return:
     """
-    run_command(
+
+    # In case we have some problems with installing highest resolution of a dependency of one of our
+    # providers in PyPI - we can exclude the buggy version here. For example this happened with
+    # sqlalchemy-spanner==1.4.0 which did not have `whl` file in PyPI and was not installable
+    # Current exclusions:
+    # * sqlalchemy-spanner: https://github.com/googleapis/python-spanner-sqlalchemy/issues/682
+    additional_constraints_for_highest_resolution = ["sqlalchemy-spanner!=1.12.0"]
+
+    result = run_command(
         cmd=[
             "uv",
             "pip",
@@ -351,6 +359,7 @@ def generate_constraints_pypi_providers(config_params: ConfigParams) -> None:
             "apache-airflow-core[all]",
             "apache-airflow-task-sdk",
             "./airflow-ctl",
+            *additional_constraints_for_highest_resolution,
             "--reinstall",  # We need to pull the provider distributions from PyPI or dist, not the local ones
             "--resolution",
             "highest",
@@ -358,8 +367,16 @@ def generate_constraints_pypi_providers(config_params: ConfigParams) -> None:
             "file://" + str(AIRFLOW_DIST_PATH),
         ],
         github_actions=config_params.github_actions,
-        check=True,
+        check=False,
     )
+    if result.returncode != 0:
+        console.print(
+            "[red]Failed to install airflow with PyPI providers with highest resolution.[/]\n"
+            "[yellow]Please check the output above for details. One of they ways how to resolve it, in "
+            "case it is caused by a specific broken dependency version, is to exclude it above in the "
+            f"`additional_constraints_for_highest_resolution` list in [/] {__file__}"
+        )
+        sys.exit(result.returncode)
     console.print("[success]Installed airflow with PyPI providers with eager upgrade.")
     distributions_to_exclude_from_constraints = get_locally_build_distribution_specs()
     with config_params.current_constraints_file.open("w") as constraints_file: