[BE] add type annotations and run mypy on setup.py (#156741)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/156741
Approved by: https://github.com/aorenste
This commit is contained in:
Xuehai Pan
2025-07-01 16:18:53 +08:00
committed by PyTorch MergeBot
parent 47f10d0ad0
commit 3bc6bdc866
3 changed files with 119 additions and 111 deletions

View File

@ -57,7 +57,8 @@ setup-env-cuda:
setup-env-rocm:
$(MAKE) setup-env PYTHON="$(PYTHON)" NIGHTLY_TOOL_OPTS="$(NIGHTLY_TOOL_OPTS) --rocm"
.lintbin/.lintrunner.sha256: requirements.txt pyproject.toml .lintrunner.toml
.PHONY: setup-lint
setup-lint .lintbin/.lintrunner.sha256: requirements.txt pyproject.toml .lintrunner.toml
@echo "Setting up lintrunner..."
$(PIP) install lintrunner
lintrunner init
@ -65,9 +66,6 @@ setup-env-rocm:
@mkdir -p .lintbin
@sha256sum requirements.txt pyproject.toml .lintrunner.toml > .lintbin/.lintrunner.sha256
.PHONY: setup-lint
setup-lint: .lintbin/.lintrunner.sha256
.PHONY: lazy-setup-lint
lazy-setup-lint: .lintbin/.lintrunner.sha256
@if [ ! -x "$(shell command -v lintrunner)" ]; then \