This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch v3-2-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-2-test by this push:
new 7f73bb76d78 [v3-2-test] Run `uv lock --upgrade` locally in `breeze ci
upgrade` instead of inside CI image (#64804) (#64806)
7f73bb76d78 is described below
commit 7f73bb76d78888b85bd6a8402fb7381416dc4693
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Wed Apr 8 14:23:15 2026 +0300
[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 c3d4905a155070350bd5e5b71fd8a0e63882c574)
Co-authored-by: Jarek Potiuk <[email protected]>
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
---
.pre-commit-config.yaml | 14 ---------
.../src/airflow_breeze/commands/ci_commands.py | 33 ++++------------------
2 files changed, 6 insertions(+), 41 deletions(-)
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index c8bb00b2ff9..c8c3f701c55 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -1069,17 +1069,3 @@ repos:
language: python
files: .*test.*\.py$
pass_filenames: true
- # This is a manual hook, run by `breeze ci upgrade` - upgrading all
dependencies inside the
- # Breeze CI image - which allows checking all dependencies for all
providers.
- # ALWAYS keep it at the end so that it can take into account all the
other hook's changes.
- - id: update-uv-lock
- stages: ['manual']
- name: Update uv.lock (manual)
- entry: breeze run uv lock --upgrade
- language: system
- files: >
- (?x)
- (^|/)pyproject\.toml$|
- ^uv\.lock$
- pass_filenames: false
- require_serial: true
diff --git a/dev/breeze/src/airflow_breeze/commands/ci_commands.py
b/dev/breeze/src/airflow_breeze/commands/ci_commands.py
index c7cd5e2b8ae..68c184d2423 100644
--- a/dev/breeze/src/airflow_breeze/commands/ci_commands.py
+++ b/dev/breeze/src/airflow_breeze/commands/ci_commands.py
@@ -778,9 +778,9 @@ def upgrade(
"Commands may fail if they require authentication.[/]"
)
- # Define upgrade commands to run before building the CI image (all run
with check=False
- # to continue on errors). These may update Dockerfiles and other build
inputs.
- pre_image_commands: list[tuple[str, str]] = [
+ # All upgrade commands run locally with check=False to continue on errors.
+ # The uv lock --upgrade step must run last so it can incorporate changes
from the other steps.
+ upgrade_commands: list[tuple[str, str]] = [
("autoupdate", "prek autoupdate --cooldown-days 4 --freeze"),
(
"update-chart-dependencies",
@@ -790,14 +790,9 @@ def upgrade(
"upgrade-important-versions",
"prek --all-files --show-diff-on-failure --color always --verbose
--stage manual upgrade-important-versions",
),
- ]
-
- # Define upgrade commands to run after building the CI image (they run
inside the image
- # and need an up-to-date environment).
- post_image_commands: list[tuple[str, str]] = [
(
"update-uv-lock",
- "prek --all-files --show-diff-on-failure --color always --verbose
update-uv-lock --stage manual",
+ "uv lock --upgrade",
),
]
@@ -808,24 +803,8 @@ def upgrade(
"update-uv-lock": update_uv_lock,
}
- # Execute pre-image upgrade commands (may update Dockerfiles)
- for step_name, command in pre_image_commands:
- if step_enabled[step_name]:
- run_command(command.split(), check=False, env=command_env)
- else:
- console_print(f"[info]Skipping {step_name} (disabled).[/]")
-
- # Build the CI image for Python 3.10 after Dockerfiles have been updated
so that
- # subsequent steps (e.g. uv lock updates inside the image) use an
up-to-date environment.
- console_print("[info]Building CI image for Python 3.10 …[/]")
- run_command(
- ["breeze", "ci-image", "build", "--python", "3.10"],
- check=False,
- env=command_env,
- )
-
- # Execute post-image upgrade commands (run inside the freshly built image)
- for step_name, command in post_image_commands:
+ # Execute upgrade commands
+ for step_name, command in upgrade_commands:
if step_enabled[step_name]:
run_command(command.split(), check=False, env=command_env)
else: