Fix autopep8 reference for "make format" on Linux

This commit is contained in:
Campbell Barton 2023-12-24 17:38:50 +11:00
parent 0fb89c2301
commit cd0967d3e1

View file

@ -204,11 +204,19 @@ ifndef PYTHON
PYTHON:=python3
endif
# The Python version bundled in `LIBDIR`,
# needed when macOS & Linux are out of sync while upgrading the Python version.
ifeq ($(OS_NCASE),darwin)
PY_LIB_VERSION:=3.10
else
PY_LIB_VERSION:=3.11
endif
# For macOS python3 is not installed by default, so fallback to python binary
# in libraries, or python 2 for running make update to get it.
ifeq ($(OS_NCASE),darwin)
ifeq (, $(shell command -v $(PYTHON)))
PYTHON:=$(DEPS_INSTALL_DIR)/python/bin/python3.10
PYTHON:=$(DEPS_INSTALL_DIR)/python/bin/python$(PY_LIB_VERSION)
ifeq (, $(shell command -v $(PYTHON)))
PYTHON:=python
endif
@ -228,7 +236,7 @@ endif
# Otherwise the "autopep8" command can be used.
ifndef AUTOPEP8
ifneq (, $(LIBDIR))
AUTOPEP8:=$(wildcard $(LIBDIR)/python/lib/python3.10/site-packages/autopep8.py)
AUTOPEP8:=$(wildcard $(LIBDIR)/python/lib/python$(PY_LIB_VERSION)/site-packages/autopep8.py)
endif
ifeq (, $(AUTOPEP8))
AUTOPEP8:=autopep8