Skip to content

Commit ce7dd3a

Browse files
committed
ci(github-actions): Upgrade uv and ruff versions to fix CI
(cherry picked from commit 26c93bc)
1 parent fcb5233 commit ce7dd3a

File tree

17 files changed

+610
-1302
lines changed

17 files changed

+610
-1302
lines changed

.github/actions/breeze/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ inputs:
2424
default: "3.10"
2525
uv-version:
2626
description: 'uv version to use'
27-
default: "0.9.4" # Keep this comment to allow automatic replacement of uv version
27+
default: "0.9.7" # Keep this comment to allow automatic replacement of uv version
2828
outputs:
2929
host-python-version:
3030
description: Python version used in host

.github/actions/install-prek/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ inputs:
2424
default: "3.10"
2525
uv-version:
2626
description: 'uv version to use'
27-
default: "0.9.4" # Keep this comment to allow automatic replacement of uv version
27+
default: "0.9.7" # Keep this comment to allow automatic replacement of uv version
2828
prek-version:
2929
description: 'prek version to use'
30-
default: "0.2.10" # Keep this comment to allow automatic replacement of prek version
30+
default: "0.2.12" # Keep this comment to allow automatic replacement of prek version
3131
save-cache:
3232
description: "Whether to save prek cache"
3333
required: true

.github/workflows/basic-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ on: # yamllint disable-line rule:truthy
6666
type: string
6767
uv-version:
6868
description: 'uv version to use'
69-
default: "0.9.4" # Keep this comment to allow automatic replacement of uv version
69+
default: "0.9.7" # Keep this comment to allow automatic replacement of uv version
7070
type: string
7171
platform:
7272
description: 'Platform for the build - linux/amd64 or linux/arm64'

.github/workflows/release_dockerhub_image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
AIRFLOW_VERSION: ${{ github.event.inputs.airflowVersion }}
5959
AMD_ONLY: ${{ github.event.inputs.amdOnly }}
6060
LIMIT_PYTHON_VERSIONS: ${{ github.event.inputs.limitPythonVersions }}
61-
UV_VERSION: "0.9.4" # Keep this comment to allow automatic replacement of uv version
61+
UV_VERSION: "0.9.7" # Keep this comment to allow automatic replacement of uv version
6262
if: contains(fromJSON('[
6363
"ashb",
6464
"eladkal",

.pre-commit-config.yaml

Lines changed: 71 additions & 830 deletions
Large diffs are not rendered by default.

Dockerfile

Lines changed: 37 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,17 @@ ARG AIRFLOW_UID="50000"
4646
ARG AIRFLOW_USER_HOME_DIR=/home/airflow
4747

4848
# latest released version here
49-
ARG AIRFLOW_VERSION="3.0.6"
49+
ARG AIRFLOW_VERSION="3.1.1"
5050

5151
ARG BASE_IMAGE="debian:bookworm-slim"
5252
ARG AIRFLOW_PYTHON_VERSION="3.12.12"
5353

5454
# You can swap comments between those two args to test pip from the main version
5555
# When you attempt to test if the version of `pip` from specified branch works for our builds
5656
# Also use `force pip` label on your PR to swap all places we use `uv` to `pip`
57-
ARG AIRFLOW_PIP_VERSION=25.2
57+
ARG AIRFLOW_PIP_VERSION=25.3
5858
# ARG AIRFLOW_PIP_VERSION="git+https://github.com/pypa/pip.git@main"
59-
ARG AIRFLOW_UV_VERSION=0.9.4
59+
ARG AIRFLOW_UV_VERSION=0.9.7
6060
ARG AIRFLOW_USE_UV="false"
6161
ARG UV_HTTP_TIMEOUT="300"
6262
ARG AIRFLOW_IMAGE_REPOSITORY="https://github.com/apache/airflow"
@@ -443,12 +443,41 @@ set -euo pipefail
443443
common::get_colors
444444
declare -a packages
445445

446-
readonly MYSQL_LTS_VERSION="8.0"
447446
readonly MARIADB_LTS_VERSION="10.11"
448447

449448
: "${INSTALL_MYSQL_CLIENT:?Should be true or false}"
450449
: "${INSTALL_MYSQL_CLIENT_TYPE:-mariadb}"
451450

451+
if [[ "${INSTALL_MYSQL_CLIENT}" != "true" && "${INSTALL_MYSQL_CLIENT}" != "false" ]]; then
452+
echo
453+
echo "${COLOR_RED}INSTALL_MYSQL_CLIENT must be either true or false${COLOR_RESET}"
454+
echo
455+
exit 1
456+
fi
457+
458+
if [[ "${INSTALL_MYSQL_CLIENT_TYPE}" != "mysql" && "${INSTALL_MYSQL_CLIENT_TYPE}" != "mariadb" ]]; then
459+
echo
460+
echo "${COLOR_RED}INSTALL_MYSQL_CLIENT_TYPE must be either mysql or mariadb${COLOR_RESET}"
461+
echo
462+
exit 1
463+
fi
464+
465+
if [[ "${INSTALL_MYSQL_CLIENT_TYPE}" == "mysql" ]]; then
466+
echo
467+
echo "${COLOR_RED}The 'mysql' client type is not supported any more. Use 'mariadb' instead.${COLOR_RESET}"
468+
echo
469+
echo "The MySQL drivers are wrongly packaged and released by Oracle with an expiration date on their GPG keys,"
470+
echo "which causes builds to fail after the expiration date. MariaDB client is protocol-compatible with MySQL client."
471+
echo ""
472+
echo "Every two years the MySQL packages fail and Oracle team is always surprised and struggling"
473+
echo "with fixes and re-signing the packages which lasts few days"
474+
echo "See https://bugs.mysql.com/bug.php?id=113432 for more details."
475+
echo "As a community we are not able to support this broken packaging practice from Oracle"
476+
echo "Feel free however to install MySQL drivers on your own as extension of the image."
477+
echo
478+
exit 1
479+
fi
480+
452481
retry() {
453482
local retries=3
454483
local count=0
@@ -467,44 +496,6 @@ retry() {
467496
done
468497
}
469498

470-
install_mysql_client() {
471-
if [[ "${1}" == "dev" ]]; then
472-
packages=("libmysqlclient-dev" "mysql-client")
473-
elif [[ "${1}" == "prod" ]]; then
474-
# `libmysqlclientXX` where XX is number, and it should be increased every new GA MySQL release, for example
475-
# 18 - MySQL 5.6.48
476-
# 20 - MySQL 5.7.42
477-
# 21 - MySQL 8.0.34
478-
# 22 - MySQL 8.1
479-
packages=("libmysqlclient21" "mysql-client")
480-
else
481-
echo
482-
echo "${COLOR_RED}Specify either prod or dev${COLOR_RESET}"
483-
echo
484-
exit 1
485-
fi
486-
487-
common::import_trusted_gpg "B7B3B788A8D3785C" "mysql"
488-
489-
echo
490-
echo "${COLOR_BLUE}Installing Oracle MySQL client version ${MYSQL_LTS_VERSION}: ${1}${COLOR_RESET}"
491-
echo
492-
493-
echo "deb http://repo.mysql.com/apt/debian/ $(lsb_release -cs) mysql-${MYSQL_LTS_VERSION}" > \
494-
/etc/apt/sources.list.d/mysql.list
495-
retry apt-get update
496-
retry apt-get install --no-install-recommends -y "${packages[@]}"
497-
apt-get autoremove -yqq --purge
498-
apt-get clean && rm -rf /var/lib/apt/lists/*
499-
500-
# Remove mysql repository from sources.list.d as MySQL repos have a basic flaw that they put expiry
501-
# date on their GPG signing keys and they sign their repo with those keys. This means that after a
502-
# certain date, the GPG key becomes invalid and if you have the repository added in your sources.list
503-
# then you will not be able to install anything from any other repository. This id unlike any other
504-
# repository we have seen (for example Postgres, MariaDB, MsSQL - all have non-expiring signing keys)
505-
rm /etc/apt/sources.list.d/mysql.list
506-
}
507-
508499
install_mariadb_client() {
509500
# List of compatible package Oracle MySQL -> MariaDB:
510501
# `mysql-client` -> `mariadb-client` or `mariadb-client-compat` (11+)
@@ -544,23 +535,7 @@ install_mariadb_client() {
544535
}
545536

546537
if [[ ${INSTALL_MYSQL_CLIENT:="true"} == "true" ]]; then
547-
if [[ $(uname -m) == "arm64" || $(uname -m) == "aarch64" ]]; then
548-
INSTALL_MYSQL_CLIENT_TYPE="mariadb"
549-
echo
550-
echo "${COLOR_YELLOW}Client forced to mariadb for ARM${COLOR_RESET}"
551-
echo
552-
fi
553-
554-
if [[ "${INSTALL_MYSQL_CLIENT_TYPE}" == "mysql" ]]; then
555-
install_mysql_client "${@}"
556-
elif [[ "${INSTALL_MYSQL_CLIENT_TYPE}" == "mariadb" ]]; then
557-
install_mariadb_client "${@}"
558-
else
559-
echo
560-
echo "${COLOR_RED}Specify either mysql or mariadb, got ${INSTALL_MYSQL_CLIENT_TYPE}${COLOR_RESET}"
561-
echo
562-
exit 1
563-
fi
538+
install_mariadb_client "${@}"
564539
fi
565540
EOF
566541

@@ -1116,6 +1091,8 @@ function install_from_sources() {
11161091
--editable ./airflow-core --editable ./task-sdk --editable ./airflow-ctl \
11171092
--editable ./kubernetes-tests --editable ./docker-tests --editable ./helm-tests \
11181093
--editable ./task-sdk-tests \
1094+
--editable ./airflow-ctl-tests \
1095+
--editable ./airflow-e2e-tests \
11191096
--editable ./devel-common[all] --editable ./dev \
11201097
--group dev --group docs --group docs-gen --group leveldb"
11211098
local -a projects_with_devel_dependencies
@@ -1877,7 +1854,7 @@ COPY --from=scripts install_from_docker_context_files.sh install_airflow_when_bu
18771854
# an incorrect architecture.
18781855
ARG TARGETARCH
18791856
# Value to be able to easily change cache id and therefore use a bare new cache
1880-
ARG DEPENDENCY_CACHE_EPOCH="10"
1857+
ARG DEPENDENCY_CACHE_EPOCH="11"
18811858

18821859
# hadolint ignore=SC2086, SC2010, DL3042
18831860
RUN --mount=type=cache,id=prod-$TARGETARCH-$DEPENDENCY_CACHE_EPOCH,target=/tmp/.cache/,uid=${AIRFLOW_UID} \

Dockerfile.ci

Lines changed: 58 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -383,12 +383,41 @@ set -euo pipefail
383383
common::get_colors
384384
declare -a packages
385385

386-
readonly MYSQL_LTS_VERSION="8.0"
387386
readonly MARIADB_LTS_VERSION="10.11"
388387

389388
: "${INSTALL_MYSQL_CLIENT:?Should be true or false}"
390389
: "${INSTALL_MYSQL_CLIENT_TYPE:-mariadb}"
391390

391+
if [[ "${INSTALL_MYSQL_CLIENT}" != "true" && "${INSTALL_MYSQL_CLIENT}" != "false" ]]; then
392+
echo
393+
echo "${COLOR_RED}INSTALL_MYSQL_CLIENT must be either true or false${COLOR_RESET}"
394+
echo
395+
exit 1
396+
fi
397+
398+
if [[ "${INSTALL_MYSQL_CLIENT_TYPE}" != "mysql" && "${INSTALL_MYSQL_CLIENT_TYPE}" != "mariadb" ]]; then
399+
echo
400+
echo "${COLOR_RED}INSTALL_MYSQL_CLIENT_TYPE must be either mysql or mariadb${COLOR_RESET}"
401+
echo
402+
exit 1
403+
fi
404+
405+
if [[ "${INSTALL_MYSQL_CLIENT_TYPE}" == "mysql" ]]; then
406+
echo
407+
echo "${COLOR_RED}The 'mysql' client type is not supported any more. Use 'mariadb' instead.${COLOR_RESET}"
408+
echo
409+
echo "The MySQL drivers are wrongly packaged and released by Oracle with an expiration date on their GPG keys,"
410+
echo "which causes builds to fail after the expiration date. MariaDB client is protocol-compatible with MySQL client."
411+
echo ""
412+
echo "Every two years the MySQL packages fail and Oracle team is always surprised and struggling"
413+
echo "with fixes and re-signing the packages which lasts few days"
414+
echo "See https://bugs.mysql.com/bug.php?id=113432 for more details."
415+
echo "As a community we are not able to support this broken packaging practice from Oracle"
416+
echo "Feel free however to install MySQL drivers on your own as extension of the image."
417+
echo
418+
exit 1
419+
fi
420+
392421
retry() {
393422
local retries=3
394423
local count=0
@@ -407,44 +436,6 @@ retry() {
407436
done
408437
}
409438

410-
install_mysql_client() {
411-
if [[ "${1}" == "dev" ]]; then
412-
packages=("libmysqlclient-dev" "mysql-client")
413-
elif [[ "${1}" == "prod" ]]; then
414-
# `libmysqlclientXX` where XX is number, and it should be increased every new GA MySQL release, for example
415-
# 18 - MySQL 5.6.48
416-
# 20 - MySQL 5.7.42
417-
# 21 - MySQL 8.0.34
418-
# 22 - MySQL 8.1
419-
packages=("libmysqlclient21" "mysql-client")
420-
else
421-
echo
422-
echo "${COLOR_RED}Specify either prod or dev${COLOR_RESET}"
423-
echo
424-
exit 1
425-
fi
426-
427-
common::import_trusted_gpg "B7B3B788A8D3785C" "mysql"
428-
429-
echo
430-
echo "${COLOR_BLUE}Installing Oracle MySQL client version ${MYSQL_LTS_VERSION}: ${1}${COLOR_RESET}"
431-
echo
432-
433-
echo "deb http://repo.mysql.com/apt/debian/ $(lsb_release -cs) mysql-${MYSQL_LTS_VERSION}" > \
434-
/etc/apt/sources.list.d/mysql.list
435-
retry apt-get update
436-
retry apt-get install --no-install-recommends -y "${packages[@]}"
437-
apt-get autoremove -yqq --purge
438-
apt-get clean && rm -rf /var/lib/apt/lists/*
439-
440-
# Remove mysql repository from sources.list.d as MySQL repos have a basic flaw that they put expiry
441-
# date on their GPG signing keys and they sign their repo with those keys. This means that after a
442-
# certain date, the GPG key becomes invalid and if you have the repository added in your sources.list
443-
# then you will not be able to install anything from any other repository. This id unlike any other
444-
# repository we have seen (for example Postgres, MariaDB, MsSQL - all have non-expiring signing keys)
445-
rm /etc/apt/sources.list.d/mysql.list
446-
}
447-
448439
install_mariadb_client() {
449440
# List of compatible package Oracle MySQL -> MariaDB:
450441
# `mysql-client` -> `mariadb-client` or `mariadb-client-compat` (11+)
@@ -484,23 +475,7 @@ install_mariadb_client() {
484475
}
485476

486477
if [[ ${INSTALL_MYSQL_CLIENT:="true"} == "true" ]]; then
487-
if [[ $(uname -m) == "arm64" || $(uname -m) == "aarch64" ]]; then
488-
INSTALL_MYSQL_CLIENT_TYPE="mariadb"
489-
echo
490-
echo "${COLOR_YELLOW}Client forced to mariadb for ARM${COLOR_RESET}"
491-
echo
492-
fi
493-
494-
if [[ "${INSTALL_MYSQL_CLIENT_TYPE}" == "mysql" ]]; then
495-
install_mysql_client "${@}"
496-
elif [[ "${INSTALL_MYSQL_CLIENT_TYPE}" == "mariadb" ]]; then
497-
install_mariadb_client "${@}"
498-
else
499-
echo
500-
echo "${COLOR_RED}Specify either mysql or mariadb, got ${INSTALL_MYSQL_CLIENT_TYPE}${COLOR_RESET}"
501-
echo
502-
exit 1
503-
fi
478+
install_mariadb_client "${@}"
504479
fi
505480
EOF
506481

@@ -870,6 +845,8 @@ function install_from_sources() {
870845
--editable ./airflow-core --editable ./task-sdk --editable ./airflow-ctl \
871846
--editable ./kubernetes-tests --editable ./docker-tests --editable ./helm-tests \
872847
--editable ./task-sdk-tests \
848+
--editable ./airflow-ctl-tests \
849+
--editable ./airflow-e2e-tests \
873850
--editable ./devel-common[all] --editable ./dev \
874851
--group dev --group docs --group docs-gen --group leveldb"
875852
local -a projects_with_devel_dependencies
@@ -1207,6 +1184,27 @@ function environment_initialization() {
12071184
ssh-keyscan -H localhost >> ~/.ssh/known_hosts 2>/dev/null
12081185
fi
12091186

1187+
if [[ ${INTEGRATION_LOCALSTACK:-"false"} == "true" ]]; then
1188+
echo
1189+
echo "${COLOR_BLUE}Configuring LocalStack integration${COLOR_RESET}"
1190+
echo
1191+
1192+
# Define LocalStack AWS configuration
1193+
declare -A localstack_config=(
1194+
["AWS_ENDPOINT_URL"]="http://localstack:4566"
1195+
["AWS_ACCESS_KEY_ID"]="test"
1196+
["AWS_SECRET_ACCESS_KEY"]="test"
1197+
["AWS_DEFAULT_REGION"]="us-east-1"
1198+
)
1199+
1200+
# Export each configuration variable and log it
1201+
for key in "${!localstack_config[@]}"; do
1202+
export "$key"="${localstack_config[$key]}"
1203+
echo " * ${COLOR_BLUE}${key}:${COLOR_RESET} ${localstack_config[$key]}"
1204+
done
1205+
echo
1206+
fi
1207+
12101208
cd "${AIRFLOW_SOURCES}"
12111209

12121210
# Temporarily add /opt/airflow/providers/standard/tests to PYTHONPATH in order to see example dags
@@ -1653,10 +1651,10 @@ COPY --from=scripts common.sh install_packaging_tools.sh install_additional_depe
16531651
# You can swap comments between those two args to test pip from the main version
16541652
# When you attempt to test if the version of `pip` from specified branch works for our builds
16551653
# Also use `force pip` label on your PR to swap all places we use `uv` to `pip`
1656-
ARG AIRFLOW_PIP_VERSION=25.2
1654+
ARG AIRFLOW_PIP_VERSION=25.3
16571655
# ARG AIRFLOW_PIP_VERSION="git+https://github.com/pypa/pip.git@main"
1658-
ARG AIRFLOW_UV_VERSION=0.9.4
1659-
ARG AIRFLOW_PREK_VERSION="0.2.10"
1656+
ARG AIRFLOW_UV_VERSION=0.9.7
1657+
ARG AIRFLOW_PREK_VERSION="0.2.12"
16601658

16611659
# UV_LINK_MODE=copy is needed since we are using cache mounted from the host
16621660
ENV AIRFLOW_PIP_VERSION=${AIRFLOW_PIP_VERSION} \
@@ -1670,7 +1668,7 @@ ENV PATH="/usr/python/bin:/root/.local/bin:/root/.cargo/bin:${PATH}"
16701668
# an incorrect architecture.
16711669
ARG TARGETARCH
16721670
# Value to be able to easily change cache id and therefore use a bare new cache
1673-
ARG DEPENDENCY_CACHE_EPOCH="1"
1671+
ARG DEPENDENCY_CACHE_EPOCH="2"
16741672

16751673
# Install useful command line tools in their own virtualenv so that they do not clash with
16761674
# dependencies installed in Airflow also reinstall PIP and UV to make sure they are installed

airflow-core/docs/best-practices.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ Installing and Using ruff
310310

311311
.. code-block:: bash
312312
313-
pip install "ruff>=0.14.1"
313+
pip install "ruff>=0.14.3"
314314
315315
2. **Running ruff**: Execute ``ruff`` to check your Dags for potential issues:
316316

@@ -725,7 +725,7 @@ Unit tests ensure that there is no incorrect code in your Dag. You can write uni
725725
726726
import pytest
727727
728-
from airflow.models import DagBag
728+
from airflow.dag_processing.dagbag import DagBag
729729
730730
731731
@pytest.fixture()

dev/breeze/doc/ci/02_images.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -442,9 +442,9 @@ can be used for CI images:
442442
| `DEV_APT_DEPS` | | Dev APT dependencies installed in the first part of the image (default empty means default dependencies are used) |
443443
| `ADDITIONAL_DEV_APT_DEPS` | | Additional apt dev dependencies installed in the first part of the image |
444444
| `ADDITIONAL_DEV_APT_ENV` | | Additional env variables defined when installing dev deps |
445-
| `AIRFLOW_PIP_VERSION` | `25.2` | `pip` version used. |
446-
| `AIRFLOW_UV_VERSION` | `0.9.4` | `uv` version used. |
447-
| `AIRFLOW_PREK_VERSION` | `0.2.10` | `prek` version used. |
445+
| `AIRFLOW_PIP_VERSION` | `25.3` | `pip` version used. |
446+
| `AIRFLOW_UV_VERSION` | `0.9.7` | `uv` version used. |
447+
| `AIRFLOW_PREK_VERSION` | `0.2.12` | `prek` version used. |
448448
| `AIRFLOW_USE_UV` | `true` | Whether to use UV for installation. |
449449
| `PIP_PROGRESS_BAR` | `on` | Progress bar for PIP installation |
450450

0 commit comments

Comments
 (0)