Skip to content

Commit 58c6d66

Browse files
github-actions[bot]potiukclaude
authored andcommitted
[v3-2-test] Run uv lock --upgrade locally in breeze ci upgrade instead of inside CI image (#64804) (#64806)
With uv.lock, we can now base all the lock preparation on uv's smartness to figure out all the dependencies without building a CI image first. The `uv lock --upgrade` command resolves dependencies purely from pyproject.toml metadata — it does not need an installed environment, so there is no reason to build the Breeze CI image just for this step. This removes the `breeze ci-image build --python 3.10` step from `breeze ci upgrade` and runs `uv lock --upgrade` directly on the host. The manual `update-uv-lock` pre-commit hook is also removed since it is no longer invoked via prek. (cherry picked from commit c3d4905) Co-authored-by: Jarek Potiuk <jarek@potiuk.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f5c871b commit 58c6d66

2 files changed

Lines changed: 6 additions & 41 deletions

File tree

.pre-commit-config.yaml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,17 +1069,3 @@ repos:
10691069
language: python
10701070
files: .*test.*\.py$
10711071
pass_filenames: true
1072-
# This is a manual hook, run by `breeze ci upgrade` - upgrading all dependencies inside the
1073-
# Breeze CI image - which allows checking all dependencies for all providers.
1074-
# ALWAYS keep it at the end so that it can take into account all the other hook's changes.
1075-
- id: update-uv-lock
1076-
stages: ['manual']
1077-
name: Update uv.lock (manual)
1078-
entry: breeze run uv lock --upgrade
1079-
language: system
1080-
files: >
1081-
(?x)
1082-
(^|/)pyproject\.toml$|
1083-
^uv\.lock$
1084-
pass_filenames: false
1085-
require_serial: true

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

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -778,9 +778,9 @@ def upgrade(
778778
"Commands may fail if they require authentication.[/]"
779779
)
780780

781-
# Define upgrade commands to run before building the CI image (all run with check=False
782-
# to continue on errors). These may update Dockerfiles and other build inputs.
783-
pre_image_commands: list[tuple[str, str]] = [
781+
# All upgrade commands run locally with check=False to continue on errors.
782+
# The uv lock --upgrade step must run last so it can incorporate changes from the other steps.
783+
upgrade_commands: list[tuple[str, str]] = [
784784
("autoupdate", "prek autoupdate --cooldown-days 4 --freeze"),
785785
(
786786
"update-chart-dependencies",
@@ -790,14 +790,9 @@ def upgrade(
790790
"upgrade-important-versions",
791791
"prek --all-files --show-diff-on-failure --color always --verbose --stage manual upgrade-important-versions",
792792
),
793-
]
794-
795-
# Define upgrade commands to run after building the CI image (they run inside the image
796-
# and need an up-to-date environment).
797-
post_image_commands: list[tuple[str, str]] = [
798793
(
799794
"update-uv-lock",
800-
"prek --all-files --show-diff-on-failure --color always --verbose update-uv-lock --stage manual",
795+
"uv lock --upgrade",
801796
),
802797
]
803798

@@ -808,24 +803,8 @@ def upgrade(
808803
"update-uv-lock": update_uv_lock,
809804
}
810805

811-
# Execute pre-image upgrade commands (may update Dockerfiles)
812-
for step_name, command in pre_image_commands:
813-
if step_enabled[step_name]:
814-
run_command(command.split(), check=False, env=command_env)
815-
else:
816-
console_print(f"[info]Skipping {step_name} (disabled).[/]")
817-
818-
# Build the CI image for Python 3.10 after Dockerfiles have been updated so that
819-
# subsequent steps (e.g. uv lock updates inside the image) use an up-to-date environment.
820-
console_print("[info]Building CI image for Python 3.10 …[/]")
821-
run_command(
822-
["breeze", "ci-image", "build", "--python", "3.10"],
823-
check=False,
824-
env=command_env,
825-
)
826-
827-
# Execute post-image upgrade commands (run inside the freshly built image)
828-
for step_name, command in post_image_commands:
806+
# Execute upgrade commands
807+
for step_name, command in upgrade_commands:
829808
if step_enabled[step_name]:
830809
run_command(command.split(), check=False, env=command_env)
831810
else:

0 commit comments

Comments
 (0)