Skip to content

Commit

Permalink
Upgrade uv to 0.1.20 and stop notifying about new uv versions (apache…
Browse files Browse the repository at this point in the history
…#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.
  • Loading branch information
potiuk authored and utkarsharma2 committed Apr 22, 2024
1 parent 3132888 commit 12ea324
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 10 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.ci
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}\
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ statsd = [
"statsd>=3.3.0",
]
uv = [
"uv>=0.1.19",
"uv>=0.1.20",
]
virtualenv = [
"virtualenv",
Expand Down
4 changes: 3 additions & 1 deletion scripts/ci/pre_commit/pre_commit_update_installers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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)
Expand Down

0 comments on commit 12ea324

Please sign in to comment.