You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by bu...@apache.org on 2026/02/06 19:04:14 UTC

(airflow) branch v3-1-test updated: [v3-1-test] Fix update_pyproject_dependency to include python_version (#61536) (#61542)

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

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


The following commit(s) were added to refs/heads/v3-1-test by this push:
     new 79a73fed6f5 [v3-1-test] Fix update_pyproject_dependency to include python_version (#61536) (#61542)
79a73fed6f5 is described below

commit 79a73fed6f5daf538403b31fedd31f9baf562e79
Author: github-actions[bot] <41...@users.noreply.github.com>
AuthorDate: Fri Feb 6 20:04:07 2026 +0100

    [v3-1-test] Fix update_pyproject_dependency to include python_version (#61536) (#61542)
    
    (cherry picked from commit 9d1a3eed9b81327a26cf4ba45466aa9884a134c5)
    
    Co-authored-by: Elad Kalif <45...@users.noreply.github.com>
---
 dev/breeze/src/airflow_breeze/utils/constraints_version_check.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/dev/breeze/src/airflow_breeze/utils/constraints_version_check.py b/dev/breeze/src/airflow_breeze/utils/constraints_version_check.py
index 88f74595815..6e475e199e4 100755
--- a/dev/breeze/src/airflow_breeze/utils/constraints_version_check.py
+++ b/dev/breeze/src/airflow_breeze/utils/constraints_version_check.py
@@ -318,21 +318,22 @@ def print_explanations(explanations: list[str]):
         get_console().print(explanation)
 
 
-def update_pyproject_dependency(pyproject_path: Path, pkg: str, latest_version: str):
+def update_pyproject_dependency(pyproject_path: Path, pkg: str, latest_version: str, python_version: str):
     lines = pyproject_path.read_text().splitlines()
     new_lines = []
     in_deps = False
     dep_added = False
+    dep_string = f"    \"{pkg}=={latest_version}; python_version=='{python_version}'\","
     for line in lines:
         new_lines.append(line)
         if line.strip() == "dependencies = [":
             in_deps = True
         elif in_deps and line.strip().startswith("]") and not dep_added:
-            new_lines.insert(-1, f'    "{pkg}=={latest_version}",')
+            new_lines.insert(-1, dep_string)
             dep_added = True
             in_deps = False
     if not dep_added:
-        new_lines.append(f'    "{pkg}=={latest_version}",')
+        new_lines.append(dep_string)
     pyproject_path.write_text("\n".join(new_lines) + "\n")
     if get_verbose():
         get_console().print(
@@ -515,7 +516,7 @@ def explain_package_upgrade(
             output=output_before,
             signal_error=False,
         )
-        update_pyproject_dependency(airflow_pyproject, pkg, latest_version)
+        update_pyproject_dependency(airflow_pyproject, pkg, latest_version, python_version)
         if get_verbose():
             syntax = Syntax(
                 airflow_pyproject.read_text(), "toml", theme="monokai", line_numbers=True, word_wrap=False