mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 13:44:15 +08:00
Remove distutils (#57040)
Summary: [distutils](https://docs.python.org/3/library/distutils.html) is on its way out and will be deprecated-on-import for Python 3.10+ and removed in Python 3.12 (see [PEP 632](https://www.python.org/dev/peps/pep-0632/)). There's no reason for us to keep it around since all the functionality we want from it can be found in `setuptools` / `sysconfig`. `setuptools` includes a copy of most of `distutils` (which is fine to use according to the PEP), that it uses under the hood, so this PR also uses that in some places. Fixes #56527 Pull Request resolved: https://github.com/pytorch/pytorch/pull/57040 Pulled By: driazati Reviewed By: nikithamalgifb Differential Revision: D28051356 fbshipit-source-id: 1ca312219032540e755593e50da0c9e23c62d720
This commit is contained in:
committed by
Facebook GitHub Bot
parent
21be40b390
commit
4b96fc060b
@ -15,12 +15,12 @@
|
||||
|
||||
|
||||
|
||||
from distutils import sysconfig
|
||||
import sysconfig
|
||||
import sys
|
||||
|
||||
flags = [
|
||||
'-DPYTHON_EXECUTABLE:FILEPATH={}'.format(sys.executable),
|
||||
'-DPYTHON_INCLUDE_DIR={}'.format(sysconfig.get_python_inc()),
|
||||
'-DPYTHON_INCLUDE_DIR={}'.format(sysconfig.get_path('include')),
|
||||
]
|
||||
|
||||
print(' '.join(flags), end='')
|
||||
|
Reference in New Issue
Block a user