[Python] Drop support for Python 3.10 (#25216) Drop support for Python 3.10, which has reached its end of life: https://devguide.python.org/versions/#unsupported-versions Assisted-by: OpenAI Codex --------- Signed-off-by: Jakob Knauer <knauer@roofline.ai>
diff --git a/.github/workflows/build_package.yml b/.github/workflows/build_package.yml index beb3d77..607f011 100644 --- a/.github/workflows/build_package.yml +++ b/.github/workflows/build_package.yml
@@ -2,10 +2,10 @@ # * main-dist-linux (CMake 'install') # * py-compiler-pkg (`iree-base-compiler` Python package) # * Linux, macOS, Windows -# * All supported Python versions (e.g. 3.10, 3.11) +# * All supported Python versions (e.g. 3.11, 3.12) # * py-runtime-pkg (`iree-base-runtime` Python package) # * Linux, macOS, Windows -# * All supported Python versions (e.g. 3.10, 3.11) +# * All supported Python versions (e.g. 3.11, 3.12) # * py-tf-compiler-tools-pkg (`iree-tools-[tf, tflite]`, pure Python packages) name: Build Release Packages @@ -249,7 +249,7 @@ docker run --rm -w=/work \ -v $PWD:/work \ "${MANYLINUX_X86_64_IMAGE}" \ - bash -c 'export PATH=/opt/python/cp310-cp310/bin:$PATH; python ./c/build_tools/github_actions/build_dist.py main-dist' + bash -c 'export PATH=/opt/python/cp311-cp311/bin:$PATH; python ./c/build_tools/github_actions/build_dist.py main-dist' - name: Main distribution (Linux for Arm64) if: "matrix.build-package == 'main-dist-linux' && matrix.build-family == 'linux-aarch64'" @@ -258,7 +258,7 @@ docker run --rm -w=/work \ -v $PWD:/work \ "${MANYLINUX_AARCH64_IMAGE}" \ - bash -c 'export PATH=/opt/python/cp310-cp310/bin:$PATH; python ./c/build_tools/github_actions/build_dist.py main-dist' + bash -c 'export PATH=/opt/python/cp311-cp311/bin:$PATH; python ./c/build_tools/github_actions/build_dist.py main-dist' ########################################################################## # py-runtime-pkg @@ -358,7 +358,7 @@ docker run --rm -w=/work \ -v $PWD:/work \ "${MANYLINUX_X86_64_IMAGE}" \ - bash -c 'export PATH=/opt/python/cp310-cp310/bin:$PATH; python ./c/build_tools/github_actions/build_dist.py py-tf-compiler-tools-pkg' + bash -c 'export PATH=/opt/python/cp311-cp311/bin:$PATH; python ./c/build_tools/github_actions/build_dist.py py-tf-compiler-tools-pkg' - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with:
diff --git a/.github/workflows/validate_and_publish_release.yml b/.github/workflows/validate_and_publish_release.yml index 9aa318e..a7e2d83 100644 --- a/.github/workflows/validate_and_publish_release.yml +++ b/.github/workflows/validate_and_publish_release.yml
@@ -51,7 +51,7 @@ id: set_up_python uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 with: - python-version: "3.10" + python-version: "3.11" - name: Install python packages id: install_python_packages env: @@ -166,7 +166,7 @@ - name: Set up python uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 with: - python-version: "3.10" + python-version: "3.11" - name: Check for patch release env:
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3bf8cd3..ae6f9c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt
@@ -770,15 +770,15 @@ # "Bootstrapping" by first looking for the optional Development component # seems to be robust generally. # See: https://reviews.llvm.org/D118148 - # If building Python packages, we have a hard requirement on 3.10+. - find_package(Python3 3.10 COMPONENTS Interpreter Development NumPy) - find_package(Python3 3.10 COMPONENTS Interpreter Development.Module Development.SABIModule NumPy REQUIRED) + # If building Python packages, we have a hard requirement on 3.11+. + find_package(Python3 3.11 COMPONENTS Interpreter Development NumPy) + find_package(Python3 3.11 COMPONENTS Interpreter Development.Module Development.SABIModule NumPy REQUIRED) # Some parts of the build use FindPython instead of FindPython3. Why? No # one knows, but they are different. So make sure to bootstrap this one too. # Not doing this here risks them diverging, which on multi-Python systems, # can be troublesome. Note that nanobind requires FindPython. set(Python_EXECUTABLE "${Python3_EXECUTABLE}") - find_package(Python 3.10 COMPONENTS Interpreter Development.Module Development.SABIModule NumPy REQUIRED) + find_package(Python 3.11 COMPONENTS Interpreter Development.Module Development.SABIModule NumPy REQUIRED) # Auto-detect IREE_ENABLE_PYTHON_STABLE_ABI: enable for CPython 3.12+ with # GIL. Can be overridden by explicitly setting the cache variable.
diff --git a/build_tools/github_actions/configure_ci.py b/build_tools/github_actions/configure_ci.py index a033b34..4a687a5 100755 --- a/build_tools/github_actions/configure_ci.py +++ b/build_tools/github_actions/configure_ci.py
@@ -53,11 +53,8 @@ sys.path.insert(0, str(pathlib.Path(__file__).parent.with_name("python"))) -# We don't get StrEnum till Python 3.11 @enum.unique -class Trailer(str, enum.Enum): - __str__ = str.__str__ - +class Trailer(enum.StrEnum): SKIP_CI = "skip-ci" SKIP_JOBS = "ci-skip" EXTRA_JOBS = "ci-extra"
diff --git a/build_tools/pkgci/build_linux_packages.sh b/build_tools/pkgci/build_linux_packages.sh index b62305f..929179f 100755 --- a/build_tools/pkgci/build_linux_packages.sh +++ b/build_tools/pkgci/build_linux_packages.sh
@@ -16,14 +16,14 @@ # ./build_tools/python_deploy/build_linux_packages.sh # # Build specific Python versions and packages to custom directory: -# override_python_versions="cp310-cp310 cp311-cp311" \ +# override_python_versions="cp311-cp311 cp312-cp312" \ # packages="iree-base-runtime" \ # output_dir="/tmp/wheelhouse" \ # ./build_tools/python_deploy/build_linux_packages.sh # # Valid Python versions match a subdirectory under /opt/python in the docker # image. Typically: -# cp310-cp310 cp311-cp311 +# cp311-cp311 cp312-cp312 # # Valid packages: # iree-base-runtime
diff --git a/build_tools/python_deploy/README.md b/build_tools/python_deploy/README.md index b295d9b..174b6ab 100644 --- a/build_tools/python_deploy/README.md +++ b/build_tools/python_deploy/README.md
@@ -84,9 +84,9 @@ ``` [host ~/iree]$ docker run --interactive --tty --rm -v $(pwd):/work/iree gcr.io/iree-oss/manylinux2014_x86_64-release:prod -[root@c8f6d0041d79 /]# export PATH=/opt/python/cp310-cp310/bin:$PATH +[root@c8f6d0041d79 /]# export PATH=/opt/python/cp311-cp311/bin:$PATH [root@c8f6d0041d79 /]# python --version -Python 3.10.4 +Python 3.11.x # Two paths for further work.
diff --git a/build_tools/python_deploy/build_linux_packages.sh b/build_tools/python_deploy/build_linux_packages.sh index 4baa8a3..442452d 100755 --- a/build_tools/python_deploy/build_linux_packages.sh +++ b/build_tools/python_deploy/build_linux_packages.sh
@@ -16,14 +16,14 @@ # ./build_tools/python_deploy/build_linux_packages.sh # # Build specific Python versions and packages to custom directory: -# override_python_versions="cp310-cp310 cp311-cp311" \ +# override_python_versions="cp311-cp311 cp312-cp312" \ # packages="iree-base-runtime" \ # output_dir="/tmp/wheelhouse" \ # ./build_tools/python_deploy/build_linux_packages.sh # # Valid Python versions match a subdirectory under /opt/python in the docker # image. Typically: -# cp310-cp310 cp311-cp311 +# cp311-cp311 cp312-cp312 # # Valid packages: # iree-base-runtime @@ -67,7 +67,7 @@ manylinux_docker_image="${manylinux_docker_image:-$(uname -m | awk '{print ($1 == "aarch64") ? "quay.io/pypa/manylinux_2_28_aarch64:2026.11.01-2@sha256:54b271d9562a3686298880df05367909e949ed317e7b1b79b59c696d75f78676" : "ghcr.io/iree-org/manylinux_x86_64@sha256:2e0246137819cf10ed84240a971f9dd75cc3eb62dc6907dfd2080ee966b3c9f4" }')}" # Python versions to build. cp312 is the abi3 build (produces a wheel # compatible with 3.12+). Per-version builds are used for <3.12 and 3.13t. -python_versions="${override_python_versions:-cp310-cp310 cp311-cp311 cp312-cp312 cp313-cp313t}" +python_versions="${override_python_versions:-cp311-cp311 cp312-cp312 cp313-cp313t}" output_dir="${output_dir:-${this_dir}/wheelhouse}" packages="${packages:-iree-base-runtime iree-base-compiler}" package_suffix="${package_suffix:-}"
diff --git a/build_tools/python_deploy/build_macos_packages.sh b/build_tools/python_deploy/build_macos_packages.sh index 04ca522..cf4db27 100755 --- a/build_tools/python_deploy/build_macos_packages.sh +++ b/build_tools/python_deploy/build_macos_packages.sh
@@ -12,7 +12,7 @@ # with directory names under: # /Library/Frameworks/Python.framework/Versions # -# MacOS convention is to refer to this as major.minor (i.e. "3.10", "3.11"). +# MacOS convention is to refer to this as major.minor (i.e. "3.11", "3.12"). # Valid packages: # iree-base-runtime # iree-base-compiler
diff --git a/build_tools/python_deploy/install_macos_deps.sh b/build_tools/python_deploy/install_macos_deps.sh index bed5437..c976605 100755 --- a/build_tools/python_deploy/install_macos_deps.sh +++ b/build_tools/python_deploy/install_macos_deps.sh
@@ -24,7 +24,6 @@ 3.13@67c6f0a3190851e0013214d5abd725a42ec398ff1b50eec47826820fd052d86b@https://www.python.org/ftp/python/3.13.1/python-3.13.1-macos11.pkg 3.12@c411b5372d563532f5e6b589af7eb16e95613d61bd5af7bfe78563467130bbff@https://www.python.org/ftp/python/3.12.8/python-3.12.8-macos11.pkg 3.11@b6cfdee2571ca56ee895043ca1e7110fb78a878cee3eb0c21accb2de34d24b55@https://www.python.org/ftp/python/3.11.9/python-3.11.9-macos11.pkg - # 3.10@https://www.python.org/ftp/python/3.10.5/python-3.10.5-macos11.pkg ) # The python.org installers are signed with this Apple Developer ID.
diff --git a/build_tools/python_deploy/install_windows_deps.ps1 b/build_tools/python_deploy/install_windows_deps.ps1 index 319a271..82259b2 100644 --- a/build_tools/python_deploy/install_windows_deps.ps1 +++ b/build_tools/python_deploy/install_windows_deps.ps1
@@ -10,14 +10,12 @@ "3.13" #, "3.12" #, "3.11" #, - # "3.10" ) $PYTHON_VERSIONS_NO_DOT = @( "313" #, "312" #, "311" #, - # "310" ) # These can be discovered at https://www.python.org/downloads/windows/ @@ -25,7 +23,6 @@ "https://www.python.org/ftp/python/3.13.1/python-3.13.1-amd64.exe" #, "https://www.python.org/ftp/python/3.12.8/python-3.12.8-amd64.exe" #, "https://www.python.org/ftp/python/3.11.9/python-3.11.9-amd64.exe" #, - # "https://www.python.org/ftp/python/3.10.5/python-3.10.5-amd64.exe", ) # SHA-256 of each installer in $PYTHON_INSTALLER_URLS.
diff --git a/compiler/bindings/python/iree/build/executor.py b/compiler/bindings/python/iree/build/executor.py index 616f37a..9e70d1d 100644 --- a/compiler/bindings/python/iree/build/executor.py +++ b/compiler/bindings/python/iree/build/executor.py
@@ -624,12 +624,6 @@ except TimeoutError: pass - except concurrent.futures.TimeoutError: - # In Python 3.10, future access throws concurrent.futures.TimeoutError. - # In 3.11, that was made a subclass of TimeoutError, which is advertised - # as thrown (and the original is marked as deprecated). - # TODO: Remove this clause once 3.10 support is dropped. - pass # Purge done from in-flight list. self.in_flight_deps.difference_update(completed_deps)
diff --git a/compiler/setup.py b/compiler/setup.py index b0e243c..60ca637 100644 --- a/compiler/setup.py +++ b/compiler/setup.py
@@ -491,7 +491,6 @@ "Development Status :: 3 - Alpha", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", @@ -501,6 +500,7 @@ "repository": "https://github.com/iree-org/iree", "documentation": "https://iree.dev/reference/bindings/python/", }, + python_requires=">=3.11", ext_modules=[ CMakeExtension("iree.compiler._mlir_libs._mlir", py_limited_api=_is_abi3_build), # TODO: MHLO has been broken for a while so disabling. If re-enabling,
diff --git a/docs/website/docs/building-from-source/getting-started.md b/docs/website/docs/building-from-source/getting-started.md index 6479d20..c95249d 100644 --- a/docs/website/docs/building-from-source/getting-started.md +++ b/docs/website/docs/building-from-source/getting-started.md
@@ -322,7 +322,7 @@ ### Dependencies -You will need Python >=3.10. IREE supports +You will need Python >=3.11. IREE supports [non-EOL Python versions](https://endoflife.date/python), following the same lifecycle policy as LLVM's minimum required Python version — see the [LLVM's Python support policy](https://discourse.llvm.org/t/rfc-adopt-regularly-scheduled-python-minimum-version-bumps/88841).
diff --git a/docs/website/docs/developers/debugging/releases.md b/docs/website/docs/developers/debugging/releases.md index a2f30a8..812def7 100644 --- a/docs/website/docs/developers/debugging/releases.md +++ b/docs/website/docs/developers/debugging/releases.md
@@ -60,7 +60,7 @@ ones: ```shell -export PATH=/opt/python/cp310-cp310/bin:$PATH +export PATH=/opt/python/cp311-cp311/bin:$PATH ``` Build core installation:
diff --git a/docs/website/docs/reference/bindings/python.md b/docs/website/docs/reference/bindings/python.md index ba7fe07..24c33b9 100644 --- a/docs/website/docs/reference/bindings/python.md +++ b/docs/website/docs/reference/bindings/python.md
@@ -39,16 +39,15 @@ ## :octicons-download-16: Prerequisites To use IREE's Python bindings, you will first need to install -[Python 3](https://www.python.org/downloads/) and +[Python 3.11 or newer](https://www.python.org/downloads/) and [pip](https://pip.pypa.io/en/stable/installing/), as needed. ???+ Info "Note - Python version compatibility" IREE's release wheels use the [Python Stable ABI (abi3)](https://docs.python.org/3/c-api/stable.html). The `cp312-abi3` wheels are compatible with any standard (with GIL) - Python 3.12+ version. Separate `cp310` and `cp311` wheels are provided - for older supported versions. A free-threaded (`cp313t`) wheel is also - available for Python 3.13t (no GIL). + Python 3.12+ version. Separate `cp311` wheels are provided for Python 3.11. + A free-threaded (`cp313t`) wheel is also available for Python 3.13t (no GIL). ???+ Tip "Tip - Virtual environments" We recommend using virtual environments to manage python packages, such as
diff --git a/integrations/tensorflow/python_projects/iree_tf/setup.py b/integrations/tensorflow/python_projects/iree_tf/setup.py index 8f4defc..3711569 100644 --- a/integrations/tensorflow/python_projects/iree_tf/setup.py +++ b/integrations/tensorflow/python_projects/iree_tf/setup.py
@@ -55,12 +55,11 @@ "Development Status :: 3 - Alpha", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", ], - python_requires=">=3.10", + python_requires=">=3.11", packages=find_namespace_packages( include=[ "iree.tools.tf",
diff --git a/integrations/tensorflow/python_projects/iree_tflite/setup.py b/integrations/tensorflow/python_projects/iree_tflite/setup.py index 97f45ce..018fa2d 100644 --- a/integrations/tensorflow/python_projects/iree_tflite/setup.py +++ b/integrations/tensorflow/python_projects/iree_tflite/setup.py
@@ -55,12 +55,11 @@ "Development Status :: 3 - Alpha", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", ], - python_requires=">=3.10", + python_requires=">=3.11", packages=find_namespace_packages( include=[ "iree.tools.tflite",
diff --git a/runtime/bindings/python/pyrightconfig.json b/runtime/bindings/python/pyrightconfig.json index 8382457..a96b356 100644 --- a/runtime/bindings/python/pyrightconfig.json +++ b/runtime/bindings/python/pyrightconfig.json
@@ -1,6 +1,6 @@ { "typeCheckingMode": "basic", - "pythonVersion": "3.10", + "pythonVersion": "3.11", "include": [ "iree" ],
diff --git a/runtime/setup.py b/runtime/setup.py index d6be6d8..90e5424 100644 --- a/runtime/setup.py +++ b/runtime/setup.py
@@ -588,7 +588,6 @@ "Development Status :: 3 - Alpha", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", @@ -598,7 +597,7 @@ "repository": "https://github.com/iree-org/iree", "documentation": "https://iree.dev/reference/bindings/python/", }, - python_requires=">=3.10", + python_requires=">=3.11", ext_modules=( [ CMakeExtension(