mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 00:21:07 +01:00
This PR is a follow up on the pyupgrade series to convert more strings to use f-strings using `flynt`. - https://docs.python.org/3/reference/lexical_analysis.html#f-strings - https://pypi.org/project/flynt/ Command used: ``` flynt torch/ -ll 120 flynt scripts/ -ll 120 flynt tools/ -ll 120 ``` and excluded `collect_env.py` Pull Request resolved: https://github.com/pytorch/pytorch/pull/105538 Approved by: https://github.com/ezyang, https://github.com/malfet
27 lines
732 B
Python
27 lines
732 B
Python
## @package get_python_cmake_flags
|
|
# Module scripts.get_python_cmake_flags
|
|
##############################################################################
|
|
# Use this script to find your preferred python installation.
|
|
##############################################################################
|
|
#
|
|
# You can use the following to build with your preferred version of python
|
|
# if your installation is not being properly detected by CMake.
|
|
#
|
|
# mkdir -p build && cd build
|
|
# cmake $(python ../scripts/get_python_cmake_flags.py) ..
|
|
# make
|
|
#
|
|
|
|
|
|
|
|
|
|
import sysconfig
|
|
import sys
|
|
|
|
flags = [
|
|
f'-DPYTHON_EXECUTABLE:FILEPATH={sys.executable}',
|
|
f"-DPYTHON_INCLUDE_DIR={sysconfig.get_path('include')}",
|
|
]
|
|
|
|
print(' '.join(flags), end='')
|