From 12ea3245b25cc0ff1a4ac961697168783698b7f5 Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Thu, 14 Mar 2024 14:11:54 +0100 Subject: [PATCH] Upgrade uv to 0.1.20 and stop notifying about new uv versions (#38145) The UV tool is iterating super-quickly with multiple releases a week and until it slows down we do not want to be notified about every release. Still in the CI the update will be running and we will be able to see if there is a new version, but canary builds will not fail when new version of uv is released. The build will fail when a new version of `pip` is released and we will still be able to update uv independently by running the same pre-commmit manually. --- .github/workflows/ci.yml | 22 ++++++++++++++----- Dockerfile | 2 +- Dockerfile.ci | 4 ++-- pyproject.toml | 2 +- .../pre_commit_update_installers.py | 4 +++- 5 files changed, 24 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 62b6a255a206e8..81368e6d5a6f71 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -583,22 +583,34 @@ jobs: --hook-stage manual update-build-dependencies if: always() - - name: "Run automated upgrade for installers" + - name: "Run automated upgrade for chart dependencies" run: > pre-commit run --all-files --show-diff-on-failure --color always --verbose --hook-stage manual - update-installers + update-chart-dependencies + if: always() + # For UV we are not failing the upgrade installers check if it is updated because + # it is upgraded very frequently, so we want to manually upgrade it rather than + # get notified about it - until it stabilizes in 1.* version + - name: "Run automated upgrade for uv (open to see if new version is updated)" + run: > + pre-commit run + --all-files --show-diff-on-failure --color always --verbose + --hook-stage manual update-installers || true if: always() env: UPGRADE_UV: "true" - - name: "Run automated upgrade for chart dependencies" + UPGRADE_PIP: "false" + - name: "Run automated upgrade for pip" run: > pre-commit run --all-files --show-diff-on-failure --color always --verbose - --hook-stage manual - update-chart-dependencies + --hook-stage manual update-installers if: always() + env: + UPGRADE_UV: "false" + UPGRADE_PIP: "true" mypy: name: "MyPy tests" diff --git a/Dockerfile b/Dockerfile index 5adb456d8583ef..534b0c68a710e9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,7 +50,7 @@ ARG AIRFLOW_VERSION="2.8.2" ARG PYTHON_BASE_IMAGE="python:3.8-slim-bookworm" ARG AIRFLOW_PIP_VERSION=24.0 -ARG AIRFLOW_UV_VERSION=0.1.19 +ARG AIRFLOW_UV_VERSION=0.1.20 ARG AIRFLOW_USE_UV="false" ARG AIRFLOW_IMAGE_REPOSITORY="https://github.com/apache/airflow" ARG AIRFLOW_IMAGE_README_URL="https://raw.githubusercontent.com/apache/airflow/main/docs/docker-stack/README.md" diff --git a/Dockerfile.ci b/Dockerfile.ci index 65c8f41dd72179..8e048e77795fa4 100644 --- a/Dockerfile.ci +++ b/Dockerfile.ci @@ -1199,7 +1199,7 @@ ARG DEFAULT_CONSTRAINTS_BRANCH="constraints-main" ARG AIRFLOW_CI_BUILD_EPOCH="10" ARG AIRFLOW_PRE_CACHED_PIP_PACKAGES="true" ARG AIRFLOW_PIP_VERSION=24.0 -ARG AIRFLOW_UV_VERSION=0.1.19 +ARG AIRFLOW_UV_VERSION=0.1.20 ARG AIRFLOW_USE_UV="true" # Setup PIP # By default PIP install run without cache to make image smaller @@ -1222,7 +1222,7 @@ ARG AIRFLOW_VERSION="" ARG ADDITIONAL_PIP_INSTALL_FLAGS="" ARG AIRFLOW_PIP_VERSION=24.0 -ARG AIRFLOW_UV_VERSION=0.1.19 +ARG AIRFLOW_UV_VERSION=0.1.20 ARG AIRFLOW_USE_UV="true" ENV AIRFLOW_REPO=${AIRFLOW_REPO}\ diff --git a/pyproject.toml b/pyproject.toml index b338a667cf37eb..156194047ed77e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -244,7 +244,7 @@ statsd = [ "statsd>=3.3.0", ] uv = [ - "uv>=0.1.19", + "uv>=0.1.20", ] virtualenv = [ "virtualenv", diff --git a/scripts/ci/pre_commit/pre_commit_update_installers.py b/scripts/ci/pre_commit/pre_commit_update_installers.py index 863dad06db51d8..1cbd38c8333a21 100755 --- a/scripts/ci/pre_commit/pre_commit_update_installers.py +++ b/scripts/ci/pre_commit/pre_commit_update_installers.py @@ -48,6 +48,7 @@ def get_latest_pypi_version(package_name: str) -> str: UV_GREATER_PATTERN = re.compile(r'"uv>=[0-9]+[0-9.]+"') UPGRADE_UV: bool = os.environ.get("UPGRADE_UV", "true").lower() == "true" +UPGRADE_PIP: bool = os.environ.get("UPGRADE_PIP", "true").lower() == "true" if __name__ == "__main__": pip_version = get_latest_pypi_version("pip") @@ -60,7 +61,8 @@ def get_latest_pypi_version(package_name: str) -> str: console.print(f"[bright_blue]Updating {file}") file_content = file.read_text() new_content = file_content - new_content = re.sub(PIP_PATTERN, f"AIRFLOW_PIP_VERSION={pip_version}", new_content, re.MULTILINE) + if UPGRADE_PIP: + new_content = re.sub(PIP_PATTERN, f"AIRFLOW_PIP_VERSION={pip_version}", new_content, re.MULTILINE) if UPGRADE_UV: new_content = re.sub(UV_PATTERN, f"AIRFLOW_UV_VERSION={uv_version}", new_content, re.MULTILINE) new_content = re.sub(UV_GREATER_PATTERN, f'"uv>={uv_version}"', new_content, re.MULTILINE)