Makefile should use python3 instead of python alias (#58786)

Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/58786

Reviewed By: driazati

Differential Revision: D28619802

Pulled By: malfet

fbshipit-source-id: 8f81298d39ba89c4e007f537ec2dd64bb23338af
This commit is contained in:
Nikita Shulga
2021-05-21 17:22:16 -07:00
committed by Facebook GitHub Bot
parent 1d885fbd0e
commit e094980060

View File

@ -1,7 +1,8 @@
# This makefile does nothing but delegating the actual building to cmake.
PYTHON = python3
all:
@mkdir -p build && cd build && cmake .. $(shell python ./scripts/get_python_cmake_flags.py) && $(MAKE)
@mkdir -p build && cd build && cmake .. $(shell $(PYTHON) ./scripts/get_python_cmake_flags.py) && $(MAKE)
local:
@./scripts/build_local.sh
@ -32,11 +33,11 @@ generate-gha-workflows:
$(MAKE) shellcheck-gha
setup_lint:
python tools/actions_local_runner.py --file .github/workflows/lint.yml \
$(PYTHON) tools/actions_local_runner.py --file .github/workflows/lint.yml \
--job 'flake8-py3' --step 'Install dependencies' --no-quiet
python tools/actions_local_runner.py --file .github/workflows/lint.yml \
$(PYTHON) tools/actions_local_runner.py --file .github/workflows/lint.yml \
--job 'cmakelint' --step 'Install dependencies' --no-quiet
python tools/actions_local_runner.py --file .github/workflows/lint.yml \
$(PYTHON) tools/actions_local_runner.py --file .github/workflows/lint.yml \
--job 'mypy' --step 'Install dependencies' --no-quiet
@if [ "$$(uname)" = "Darwin" ]; then \
@ -46,20 +47,20 @@ setup_lint:
fi; \
brew install shellcheck; \
else \
python tools/actions_local_runner.py --file .github/workflows/lint.yml \
$(PYTHON) tools/actions_local_runner.py --file .github/workflows/lint.yml \
--job 'quick-checks' --step 'Install ShellCheck' --no-quiet; \
fi
pip install jinja2
quick_checks:
@python tools/actions_local_runner.py \
@$(PYTHON) tools/actions_local_runner.py \
--file .github/workflows/lint.yml \
--job 'quick-checks' \
--step 'Extract scripts from GitHub Actions workflows'
# TODO: This is broken when 'git config submodule.recurse' is 'true' since the
# lints will descend into third_party submodules
@python tools/actions_local_runner.py \
@$(PYTHON) tools/actions_local_runner.py \
--file .github/workflows/lint.yml \
--job 'quick-checks' \
--step 'Ensure no trailing spaces' \
@ -74,19 +75,19 @@ quick_checks:
--step 'Ensure correct trailing newlines'
flake8:
@python tools/actions_local_runner.py \
@$(PYTHON) tools/actions_local_runner.py \
--file-filter '.py' \
$(CHANGED_ONLY) \
--job 'flake8-py3'
mypy:
@python tools/actions_local_runner.py \
@$(PYTHON) tools/actions_local_runner.py \
--file-filter '.py' \
$(CHANGED_ONLY) \
--job 'mypy'
cmakelint:
@python tools/actions_local_runner.py \
@$(PYTHON) tools/actions_local_runner.py \
--file .github/workflows/lint.yml \
--job 'cmakelint' \
--step 'Run cmakelint'
@ -96,7 +97,7 @@ clang_tidy:
exit 1
toc:
@python tools/actions_local_runner.py \
@$(PYTHON) tools/actions_local_runner.py \
--file .github/workflows/lint.yml \
--job 'toc' \
--step "Regenerate ToCs and check that they didn't change"