[build] pin setuptools>=77 to enable PEP 639 (#158104)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/158104
Approved by: https://github.com/rgommers, https://github.com/Skylion007, https://github.com/atalman
This commit is contained in:
Xuehai Pan
2025-07-18 13:23:09 +08:00
committed by PyTorch MergeBot
parent 27af877f84
commit a4ec381302
15 changed files with 46 additions and 40 deletions

View File

@ -2,13 +2,12 @@
[build-system]
requires = [
# 70.1.0: min version for integrated bdist_wheel command from wheel package
# 77.0.0: min version for SPDX expression support for project.license
"setuptools>=70.1.0,<80.0",
"setuptools>=77.0.0,<80.0",
"cmake>=3.27",
"ninja",
"numpy",
"packaging",
"packaging>=24.2",
"pyyaml",
"requests",
"six", # dependency chain: NNPACK -> PeachPy -> six
@ -21,11 +20,7 @@ name = "torch"
description = "Tensors and Dynamic neural networks in Python with strong GPU acceleration"
readme = "README.md"
requires-python = ">=3.9,<3.14"
# 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
# to an error on 2026.02.18. See also: https://github.com/pypa/setuptools/issues/4903
license = { text = "BSD-3-Clause" }
license = "BSD-3-Clause"
authors = [{ name = "PyTorch Team", email = "packages@pytorch.org" }]
keywords = ["pytorch", "machine learning"]
classifiers = [