Skip to content

Commit b82af37

Browse files
committed
Enable ignoring missing constraints on py3.14
1 parent d1cc5b5 commit b82af37

4 files changed

Lines changed: 57 additions & 1 deletion

File tree

dev/breeze/src/airflow_breeze/commands/release_management_commands.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,11 +1429,15 @@ def generate_constraints(
14291429
f"--upgrade-to-newer-dependencies\n"
14301430
)
14311431
sys.exit(1)
1432+
# TODO: Remove the Python 3.14 special-case once constraints-3.14.txt exists on the constraints branch.
14321433
if run_in_parallel:
14331434
python_version_list = get_python_version_list(python_versions)
14341435
shell_params_list = [
14351436
ShellParams(
14361437
airflow_constraints_mode=airflow_constraints_mode,
1438+
airflow_fallback_no_constraints_installation=(
1439+
allow_missing_previous_constraints_file and python == "3.14"
1440+
),
14371441
allow_missing_previous_constraints_file=allow_missing_previous_constraints_file,
14381442
github_repository=github_repository,
14391443
python=python,
@@ -1453,6 +1457,9 @@ def generate_constraints(
14531457
else:
14541458
shell_params = ShellParams(
14551459
airflow_constraints_mode=airflow_constraints_mode,
1460+
airflow_fallback_no_constraints_installation=(
1461+
allow_missing_previous_constraints_file and python == "3.14"
1462+
),
14561463
allow_missing_previous_constraints_file=allow_missing_previous_constraints_file,
14571464
github_repository=github_repository,
14581465
python=python,

dev/breeze/src/airflow_breeze/params/shell_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ class ShellParams:
163163
airflow_constraints_location: str = ""
164164
airflow_constraints_mode: str = ALLOWED_CONSTRAINTS_MODES_CI[0]
165165
airflow_constraints_reference: str = ""
166+
airflow_fallback_no_constraints_installation: bool = False
166167
airflow_extras: str = ""
167168
allow_missing_previous_constraints_file: bool = False
168169
allow_pre_releases: bool = False
@@ -631,6 +632,11 @@ def env_variables_for_docker_commands(self) -> dict[str, str]:
631632
"ALLOW_MISSING_PREVIOUS_CONSTRAINTS_FILE",
632633
self.allow_missing_previous_constraints_file,
633634
)
635+
_set_var(
636+
_env,
637+
"AIRFLOW_FALLBACK_NO_CONSTRAINTS_INSTALLATION",
638+
self.airflow_fallback_no_constraints_installation,
639+
)
634640
_set_var(_env, "BACKEND", self.backend)
635641
if self.backend == "custom":
636642
_set_var(_env, "AIRFLOW__DATABASE__SQL_ALCHEMY_CONN", self.custom_db_url or None)

dev/breeze/tests/test_release_management_commands.py

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from airflow_breeze.utils.confirm import Answer
2020

2121

22-
def test_generate_constraints_forwards_allow_missing_previous_constraints_file(monkeypatch):
22+
def test_generate_constraints_enables_bootstrap_flags_for_python_3_14(monkeypatch):
2323
import airflow_breeze.commands.release_management_commands as module
2424

2525
captured_shell_params = {}
@@ -50,3 +50,38 @@ def fake_run_generate_constraints(shell_params, output):
5050
)
5151

5252
assert captured_shell_params["value"].allow_missing_previous_constraints_file is True
53+
assert captured_shell_params["value"].airflow_fallback_no_constraints_installation is True
54+
55+
56+
def test_generate_constraints_keeps_no_constraints_fallback_disabled_for_older_python(monkeypatch):
57+
import airflow_breeze.commands.release_management_commands as module
58+
59+
captured_shell_params = {}
60+
61+
monkeypatch.setattr(module, "perform_environment_checks", lambda: None)
62+
monkeypatch.setattr(module, "check_remote_ghcr_io_commands", lambda: None)
63+
monkeypatch.setattr(module, "fix_ownership_using_docker", lambda: None)
64+
monkeypatch.setattr(module, "cleanup_python_generated_files", lambda: None)
65+
monkeypatch.setattr(module, "user_confirm", lambda *args, **kwargs: Answer.YES)
66+
67+
def fake_run_generate_constraints(shell_params, output):
68+
captured_shell_params["value"] = shell_params
69+
return 0, "constraints-source-providers:3.13"
70+
71+
monkeypatch.setattr(module, "run_generate_constraints", fake_run_generate_constraints)
72+
73+
module.generate_constraints.callback(
74+
airflow_constraints_mode="constraints-source-providers",
75+
allow_missing_previous_constraints_file=True,
76+
debug_resources=False,
77+
github_repository="apache/airflow",
78+
parallelism=1,
79+
python="3.13",
80+
python_versions="3.13",
81+
run_in_parallel=False,
82+
skip_cleanup=False,
83+
use_uv=True,
84+
)
85+
86+
assert captured_shell_params["value"].allow_missing_previous_constraints_file is True
87+
assert captured_shell_params["value"].airflow_fallback_no_constraints_installation is False

dev/breeze/tests/test_shell_params.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,14 @@
166166
},
167167
id="allow missing previous constraints file",
168168
),
169+
pytest.param(
170+
{},
171+
{"airflow_fallback_no_constraints_installation": True},
172+
{
173+
"AIRFLOW_FALLBACK_NO_CONSTRAINTS_INSTALLATION": "true",
174+
},
175+
id="airflow fallback no constraints installation",
176+
),
169177
pytest.param(
170178
{"PYTHONWARNINGS": "default"},
171179
{},

0 commit comments

Comments
 (0)