This is an automated email from the ASF dual-hosted git repository. kaxilnaik pushed a commit to branch v3-1-test in repository https://gitbox.apache.org/repos/asf/airflow.git
commit b6bfb313bf9583fb31daf95210f58bb9ba4967e6 Author: GPK <[email protected]> AuthorDate: Fri Sep 12 23:06:36 2025 +0100 Include mypy upgrades to upgrade-important-versions prek hook (#55597) (cherry picked from commit fe2ddb090c7921552599531ed89bb9df05cbca55) --- .github/workflows/basic-tests.yml | 2 ++ scripts/ci/prek/upgrade_important_versions.py | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/.github/workflows/basic-tests.yml b/.github/workflows/basic-tests.yml index b729c0efabd..48978c1351b 100644 --- a/.github/workflows/basic-tests.yml +++ b/.github/workflows/basic-tests.yml @@ -319,6 +319,7 @@ jobs: UPGRADE_GITPYTHON: "false" UPGRADE_RICH: "false" UPGRADE_RUFF: "false" + UPGRADE_MYPY: "false" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: "Run automated upgrade for important versions minus uv(failing if needed)" run: > @@ -338,6 +339,7 @@ jobs: UPGRADE_GITPYTHON: "true" UPGRADE_RICH: "true" UPGRADE_RUFF: "true" + UPGRADE_MYPY: "true" GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} test-airflow-release-commands: diff --git a/scripts/ci/prek/upgrade_important_versions.py b/scripts/ci/prek/upgrade_important_versions.py index 9beecc67e76..75dc99e1be2 100755 --- a/scripts/ci/prek/upgrade_important_versions.py +++ b/scripts/ci/prek/upgrade_important_versions.py @@ -223,6 +223,7 @@ 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" UPGRADE_RUFF: bool = os.environ.get("UPGRADE_RUFF", "true").lower() == "true" +UPGRADE_MYPY: bool = os.environ.get("UPGRADE_MYPY", "true").lower() == "true" ALL_PYTHON_MAJOR_MINOR_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13"] DEFAULT_PROD_IMAGE_PYTHON_VERSION = "3.12" @@ -269,6 +270,7 @@ if __name__ == "__main__": rich_version = get_latest_pypi_version("rich") ruff_version = get_latest_pypi_version("ruff") node_lts_version = get_latest_lts_node_version() + mypy_version = get_latest_pypi_version("mypy") for file, keep_length in FILES_TO_UPDATE: console.print(f"[bright_blue]Updating {file}") file_content = file.read_text() @@ -396,6 +398,15 @@ if __name__ == "__main__": f"ruff>={ruff_version}", new_content, ) + if UPGRADE_MYPY: + console.print(f"[bright_blue]Latest mypy version: {mypy_version}") + + new_content = re.sub( + r"(mypy==)([0-9.]+)", + f"mypy=={mypy_version}", + new_content, + ) + if new_content != file_content: file.write_text(new_content) console.print(f"[bright_blue]Updated {file}")
