Add runtime dependency on setuptools for cpp_extensions (#127921)

As per title since this was removed from the builtin python binary in 3.12 and we use it `torch.utils.cpp_extension.*`.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/127921
Approved by: https://github.com/Skylion007
This commit is contained in:
albanD
2024-06-05 23:59:36 +00:00
committed by PyTorch MergeBot
parent 2fd75667b4
commit 8bcebc8dae

View File

@ -1137,6 +1137,9 @@ def main():
'mkl>=2021.1.1,<=2021.4.0; platform_system == "Windows"',
]
if sys.version_info >= (3, 12, 0):
install_requires.append("setuptools")
if BUILD_PYTHON_ONLY:
install_requires.append(LIBTORCH_PKG_NAME)