This is an automated email from the ASF dual-hosted git repository. kaxilnaik pushed a commit to branch v3-0-test in repository https://gitbox.apache.org/repos/asf/airflow.git
commit cae42b4dfd6883348c7f021641e04392f1c1d38f Author: Jarek Potiuk <ja...@potiuk.com> AuthorDate: Sun Jul 6 00:37:23 2025 +0200 [v3-0-test] Slightly speed up package preparation and upgrade latest build deps (#52909) (#52924) I noticed that we did not have `pre-commit-uv` in the image that was building the distribution packages. Adding it should slightly speed up building such an image for isolated package preparation. The `uv` has been upgraded along the way, also the comment that we should automate updating the versions in release_management_command.py has been removed - because we already have automation in place. The missing pieces were adding "hatch", "pyyaml", "gitpython" and "rich". (cherry picked from commit bbc8f7427188c453b66d6c75b33fcbb308e14c01) --- .github/actions/install-pre-commit/action.yml | 2 +- .github/workflows/basic-tests.yml | 6 +-- .github/workflows/ci-amd.yml | 2 +- Dockerfile | 2 +- Dockerfile.ci | 2 +- dev/breeze/doc/ci/02_images.md | 2 +- .../commands/release_management_commands.py | 10 ++-- dev/breeze/src/airflow_breeze/global_constants.py | 2 +- pyproject.toml | 2 +- scripts/ci/install_breeze.sh | 2 +- .../pre_commit/update_installers_and_pre_commit.py | 56 ++++++++++++++++++++++ scripts/tools/setup_breeze | 2 +- 12 files changed, 72 insertions(+), 18 deletions(-) diff --git a/.github/actions/install-pre-commit/action.yml b/.github/actions/install-pre-commit/action.yml index 66cd6a49629..8a68bc00363 100644 --- a/.github/actions/install-pre-commit/action.yml +++ b/.github/actions/install-pre-commit/action.yml @@ -24,7 +24,7 @@ inputs: default: "3.9" uv-version: description: 'uv version to use' - default: "0.7.17" # Keep this comment to allow automatic replacement of uv version + default: "0.7.19" # Keep this comment to allow automatic replacement of uv version pre-commit-version: description: 'pre-commit version to use' default: "4.2.0" # Keep this comment to allow automatic replacement of pre-commit version diff --git a/.github/workflows/basic-tests.yml b/.github/workflows/basic-tests.yml index 161ba36d580..59a326d49b1 100644 --- a/.github/workflows/basic-tests.yml +++ b/.github/workflows/basic-tests.yml @@ -284,25 +284,23 @@ jobs: # 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)" + - name: "Run automated upgrade for uv (not failing - just informational)" run: > pre-commit run --all-files --show-diff-on-failure --color always --verbose --hook-stage manual update-installers-and-pre-commit || true if: always() env: - UPGRADE_UV: "true" UPGRADE_PIP: "false" UPGRADE_PRE_COMMIT: "false" UPGRADE_NODE_LTS: "false" - - name: "Run automated upgrade for pip, pre-commit and node" + - name: "Run automated upgrade for pip, pre-commit and node (failing if needed)" run: > pre-commit run --all-files --show-diff-on-failure --color always --verbose --hook-stage manual update-installers-and-pre-commit if: always() env: - UPGRADE_UV: "false" UPGRADE_PIP: "true" UPGRADE_PRE_COMMIT: "true" UPGRADE_NODE_LTS: "true" diff --git a/.github/workflows/ci-amd.yml b/.github/workflows/ci-amd.yml index 4a3f5b69f90..a0a1ed4c8e1 100644 --- a/.github/workflows/ci-amd.yml +++ b/.github/workflows/ci-amd.yml @@ -186,7 +186,7 @@ jobs: - name: Install pre-commit, uv, and pre-commit-uv shell: bash env: - UV_VERSION: "0.7.17" # Keep this comment to allow automatic replacement of uv version + UV_VERSION: "0.7.19" # Keep this comment to allow automatic replacement of uv version PRE_COMMIT_VERSION: "4.2.0" # Keep this comment to allow automatic replacement of pre-commit version PRE_COMMIT_UV_VERSION: "4.1.4" # Keep this comment to allow automatic replacement of pre-commit-uv version run: | diff --git a/Dockerfile b/Dockerfile index 5b3a704c70c..023fb244294 100644 --- a/Dockerfile +++ b/Dockerfile @@ -57,7 +57,7 @@ ARG PYTHON_BASE_IMAGE="python:3.9-slim-bookworm" ARG AIRFLOW_PIP_VERSION=25.1.1 # ARG AIRFLOW_PIP_VERSION="git+https://github.com/pypa/pip.git@main" ARG AIRFLOW_SETUPTOOLS_VERSION=80.9.0 -ARG AIRFLOW_UV_VERSION=0.7.17 +ARG AIRFLOW_UV_VERSION=0.7.19 ARG AIRFLOW_USE_UV="false" ARG UV_HTTP_TIMEOUT="300" ARG AIRFLOW_IMAGE_REPOSITORY="https://github.com/apache/airflow" diff --git a/Dockerfile.ci b/Dockerfile.ci index 0d95a48e180..7fc0d572bf0 100644 --- a/Dockerfile.ci +++ b/Dockerfile.ci @@ -1393,7 +1393,7 @@ COPY --from=scripts common.sh install_packaging_tools.sh install_additional_depe ARG AIRFLOW_PIP_VERSION=25.1.1 # ARG AIRFLOW_PIP_VERSION="git+https://github.com/pypa/pip.git@main" ARG AIRFLOW_SETUPTOOLS_VERSION=80.9.0 -ARG AIRFLOW_UV_VERSION=0.7.17 +ARG AIRFLOW_UV_VERSION=0.7.19 # TODO(potiuk): automate with upgrade check (possibly) ARG AIRFLOW_PRE_COMMIT_VERSION="4.2.0" ARG AIRFLOW_PRE_COMMIT_UV_VERSION="4.1.4" diff --git a/dev/breeze/doc/ci/02_images.md b/dev/breeze/doc/ci/02_images.md index c5d29856af2..c6c2b853586 100644 --- a/dev/breeze/doc/ci/02_images.md +++ b/dev/breeze/doc/ci/02_images.md @@ -443,7 +443,7 @@ can be used for CI images: | `ADDITIONAL_DEV_APT_DEPS` | | Additional apt dev dependencies installed in the first part of the image | | `ADDITIONAL_DEV_APT_ENV` | | Additional env variables defined when installing dev deps | | `AIRFLOW_PIP_VERSION` | `25.1.1` | `pip` version used. | -| `AIRFLOW_UV_VERSION` | `0.7.17` | `uv` version used. | +| `AIRFLOW_UV_VERSION` | `0.7.19` | `uv` version used. | | `AIRFLOW_PRE_COMMIT_VERSION` | `4.2.0` | `pre-commit` version used. | | `AIRFLOW_PRE_COMMIT_UV_VERSION` | `4.1.4` | `pre-commit-uv` version used. | | `AIRFLOW_USE_UV` | `true` | Whether to use UV for installation. | diff --git a/dev/breeze/src/airflow_breeze/commands/release_management_commands.py b/dev/breeze/src/airflow_breeze/commands/release_management_commands.py index 13aa0c03289..f75697fb1ce 100644 --- a/dev/breeze/src/airflow_breeze/commands/release_management_commands.py +++ b/dev/breeze/src/airflow_breeze/commands/release_management_commands.py @@ -245,13 +245,13 @@ class VersionedFile(NamedTuple): AIRFLOW_PIP_VERSION = "25.1.1" -AIRFLOW_UV_VERSION = "0.7.17" +AIRFLOW_UV_VERSION = "0.7.19" AIRFLOW_USE_UV = False -# TODO(potiuk): automate upgrades of these versions (likely via requirements.txt file) GITPYTHON_VERSION = "3.1.44" -RICH_VERSION = "13.9.4" +RICH_VERSION = "14.0.0" PRE_COMMIT_VERSION = "4.2.0" -HATCH_VERSION = "1.14.0" +PRE_COMMIT_UV_VERSION = "4.1.4" +HATCH_VERSION = "1.14.1" PYYAML_VERSION = "6.0.2" # no need for pre-commit-uv. Those commands will only ever initialize the compile-www-assets @@ -264,7 +264,7 @@ RUN pip install uv=={UV_VERSION} RUN --mount=type=cache,id=cache-airflow-build-dockerfile-installation,target=/root/.cache/ \ uv pip install --system ignore pip=={AIRFLOW_PIP_VERSION} hatch=={HATCH_VERSION} \ pyyaml=={PYYAML_VERSION} gitpython=={GITPYTHON_VERSION} rich=={RICH_VERSION} \ - pre-commit=={PRE_COMMIT_VERSION} + pre-commit=={PRE_COMMIT_VERSION} pre-commit-uv=={PRE_COMMIT_UV_VERSION} COPY . /opt/airflow """ diff --git a/dev/breeze/src/airflow_breeze/global_constants.py b/dev/breeze/src/airflow_breeze/global_constants.py index a45b4d35c52..7e0f5fff5f9 100644 --- a/dev/breeze/src/airflow_breeze/global_constants.py +++ b/dev/breeze/src/airflow_breeze/global_constants.py @@ -199,7 +199,7 @@ if MYSQL_INNOVATION_RELEASE: ALLOWED_INSTALL_MYSQL_CLIENT_TYPES = ["mariadb", "mysql"] PIP_VERSION = "25.1.1" -UV_VERSION = "0.7.17" +UV_VERSION = "0.7.19" DEFAULT_UV_HTTP_TIMEOUT = 300 DEFAULT_WSL2_HTTP_TIMEOUT = 900 diff --git a/pyproject.toml b/pyproject.toml index cafe7b15def..16fb8709196 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -518,7 +518,7 @@ packages = [] "apache-airflow-providers-amazon[s3fs]", ] "uv" = [ - "uv>=0.7.17", + "uv>=0.7.19", ] diff --git a/scripts/ci/install_breeze.sh b/scripts/ci/install_breeze.sh index 15d0fd6c4cf..4a3f642ec35 100755 --- a/scripts/ci/install_breeze.sh +++ b/scripts/ci/install_breeze.sh @@ -22,7 +22,7 @@ cd "$( dirname "${BASH_SOURCE[0]}" )/../../" PYTHON_ARG="" PIP_VERSION="25.1.1" -UV_VERSION="0.7.17" +UV_VERSION="0.7.19" if [[ ${PYTHON_VERSION=} != "" ]]; then PYTHON_ARG="--python=$(which python"${PYTHON_VERSION}") " fi diff --git a/scripts/ci/pre_commit/update_installers_and_pre_commit.py b/scripts/ci/pre_commit/update_installers_and_pre_commit.py index ef1b745f9fe..34b6a0b85ff 100755 --- a/scripts/ci/pre_commit/update_installers_and_pre_commit.py +++ b/scripts/ci/pre_commit/update_installers_and_pre_commit.py @@ -170,6 +170,10 @@ UPGRADE_PIP: bool = os.environ.get("UPGRADE_PIP", "true").lower() == "true" UPGRADE_SETUPTOOLS: bool = os.environ.get("UPGRADE_SETUPTOOLS", "true").lower() == "true" UPGRADE_PRE_COMMIT: bool = os.environ.get("UPGRADE_PRE_COMMIT", "true").lower() == "true" UPGRADE_NODE_LTS: bool = os.environ.get("UPGRADE_NODE_LTS", "true").lower() == "true" +UPGRADE_HATCH: bool = os.environ.get("UPGRADE_HATCH", "true").lower() == "true" +UPGRADE_PYYAML: bool = os.environ.get("UPGRADE_PYYAML", "true").lower() == "true" +UPGRADE_GITPYTHON: bool = os.environ.get("UPGRADE_GITPYTHON", "true").lower() == "true" +UPGRADE_RICH: bool = os.environ.get("UPGRADE_RICH", "true").lower() == "true" def replace_version(pattern: re.Pattern[str], version: str, text: str, keep_total_length: bool = True) -> str: @@ -206,6 +210,10 @@ if __name__ == "__main__": setuptools_version = get_latest_pypi_version("setuptools") pre_commit_version = get_latest_pypi_version("pre-commit") pre_commit_uv_version = get_latest_pypi_version("pre-commit-uv") + hatch_version = get_latest_pypi_version("hatch") + pyyaml_version = get_latest_pypi_version("PyYAML") + gitpython_version = get_latest_pypi_version("GitPython") + rich_version = get_latest_pypi_version("rich") node_lts_version = get_latest_lts_node_version() for file, keep_length in FILES_TO_UPDATE: console.print(f"[bright_blue]Updating {file}") @@ -253,6 +261,54 @@ if __name__ == "__main__": new_content, keep_length, ) + if UPGRADE_HATCH: + console.print(f"[bright_blue]Latest hatch version: {hatch_version}") + new_content = re.sub( + r"(HATCH_VERSION = )(\"[0-9.]+\")", + f'HATCH_VERSION = "{hatch_version}"', + new_content, + ) + new_content = re.sub( + r"(HATCH_VERSION=)(\"[0-9.]+\")", + f'HATCH_VERSION="{hatch_version}"', + new_content, + ) + if UPGRADE_PYYAML: + console.print(f"[bright_blue]Latest PyYAML version: {pyyaml_version}") + new_content = re.sub( + r"(PYYAML_VERSION = )(\"[0-9.]+\")", + f'PYYAML_VERSION = "{pyyaml_version}"', + new_content, + ) + new_content = re.sub( + r"(PYYAML_VERSION=)(\"[0-9.]+\")", + f'PYYAML_VERSION="{pyyaml_version}"', + new_content, + ) + if UPGRADE_GITPYTHON: + console.print(f"[bright_blue]Latest GitPython version: {gitpython_version}") + new_content = re.sub( + r"(GITPYTHON_VERSION = )(\"[0-9.]+\")", + f'GITPYTHON_VERSION = "{gitpython_version}"', + new_content, + ) + new_content = re.sub( + r"(GITPYTHON_VERSION=)(\"[0-9.]+\")", + f'GITPYTHON_VERSION="{gitpython_version}"', + new_content, + ) + if UPGRADE_RICH: + console.print(f"[bright_blue]Latest rich version: {rich_version}") + new_content = re.sub( + r"(RICH_VERSION = )(\"[0-9.]+\")", + f'RICH_VERSION = "{rich_version}"', + new_content, + ) + new_content = re.sub( + r"(RICH_VERSION=)(\"[0-9.]+\")", + f'RICH_VERSION="{rich_version}"', + new_content, + ) if new_content != file_content: file.write_text(new_content) console.print(f"[bright_blue]Updated {file}") diff --git a/scripts/tools/setup_breeze b/scripts/tools/setup_breeze index 2cf2f23bfd5..8ba3b773fb3 100755 --- a/scripts/tools/setup_breeze +++ b/scripts/tools/setup_breeze @@ -27,7 +27,7 @@ COLOR_YELLOW=$'\e[33m' COLOR_BLUE=$'\e[34m' COLOR_RESET=$'\e[0m' -UV_VERSION="0.7.17" +UV_VERSION="0.7.19" function manual_instructions() { echo