From 3016616ccbba3dc9bb6a80eb4a81a846ddf49cc9 Mon Sep 17 00:00:00 2001 From: Nikita Shulga Date: Thu, 18 Sep 2025 18:43:07 -0700 Subject: [PATCH] [BE] Update Python min version to 3.10 (#162310) Pull Request resolved: https://github.com/pytorch/pytorch/pull/162310 Approved by: https://github.com/atalman, https://github.com/Skylion007, https://github.com/ZainRizvi ghstack dependencies: #162862 --- pyproject.toml | 3 +-- setup.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 874c629273d7..12e686621e00 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,7 +53,7 @@ dev = [ name = "torch" description = "Tensors and Dynamic neural networks in Python with strong GPU acceleration" readme = "README.md" -requires-python = ">=3.9" +requires-python = ">=3.10" # TODO: change to `license = "BSD-3-Clause"` and enable PEP 639 after pinning setuptools>=77 # FIXME: As of 2025.06.20, it is hard to ensure the minimum version of setuptools in our CI environment. # TOML-table-based license deprecated in setuptools>=77, and the deprecation warning will be changed @@ -74,7 +74,6 @@ classifiers = [ "Topic :: Software Development :: Libraries :: Python Modules", "Programming Language :: C++", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", diff --git a/setup.py b/setup.py index 2bb63a93cec8..e181beba06c1 100644 --- a/setup.py +++ b/setup.py @@ -256,7 +256,7 @@ import platform # Also update `project.requires-python` in pyproject.toml when changing this -python_min_version = (3, 9, 0) +python_min_version = (3, 10, 0) python_min_version_str = ".".join(map(str, python_min_version)) if sys.version_info < python_min_version: print( @@ -1029,7 +1029,7 @@ def build_deps() -> None: CWD / "third_party/valgrind-headers/callgrind.h", CWD / "third_party/valgrind-headers/valgrind.h", ] - for sym_file, orig_file in zip(sym_files, orig_files): + for sym_file, orig_file in zip(sym_files, orig_files, strict=True): same = False if sym_file.exists(): if filecmp.cmp(sym_file, orig_file):