blender/build_files/windows/autopep8.cmd
Ray Molenkamp 9f1f869e16 make.bat: Enable .py formatting with make format
autopep8_format_paths.py was never wired up in the windows tooling,
this PR wires it up, to get around a 8191 limitation for command
lines on windows an alternative "--no-subprocess" option has been
introduced to call the pep8 module directly from python.

TODO: A subprocess is still used for getting the version information

Contributors:

- @campbellbarton fixes to autopep8_format_paths.py to support
  the -no-subprocess option.

Pull Request: https://projects.blender.org/blender/blender/pulls/120794
2024-06-06 09:10:19 -06:00

18 lines
618 B
Batchfile

if NOT EXIST %PYTHON% (
echo python not found, required for this operation
exit /b 1
)
set FORMAT_PATHS=%BLENDER_DIR%\tools\utils_maintenance\autopep8_format_paths.py
for %%a in (%PYTHON%) do (
set PEP8_LOCATION=%%~dpa\..\lib\site-packages\autopep8.py
)
REM Use -B to avoid writing __pycache__ in lib directory and causing update conflicts.
REM While we run with --no-subprocess a sub process is still used to get the version
REM information, so we stil have to supply a valid --autopep8-command here.
%PYTHON% -B %FORMAT_PATHS% --autopep8-command "%PEP8_LOCATION%" --no-subprocess %FORMAT_ARGS%
:EOF