Skip to content

Commit 3bc6bdc

Browse files
XuehaiPanpytorchmergebot
authored andcommitted
[BE] add type annotations and run mypy on setup.py (pytorch#156741)
Pull Request resolved: pytorch#156741 Approved by: https://github.com/aorenste
1 parent 47f10d0 commit 3bc6bdc

File tree

3 files changed

+119
-111
lines changed

3 files changed

+119
-111
lines changed

.lintrunner.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ is_formatter = true
122122
[[linter]]
123123
code = 'MYPY'
124124
include_patterns = [
125+
'setup.py',
125126
'torch/**/*.py',
126127
'torch/**/*.pyi',
127128
'caffe2/**/*.py',

Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,15 @@ setup-env-cuda:
5757
setup-env-rocm:
5858
$(MAKE) setup-env PYTHON="$(PYTHON)" NIGHTLY_TOOL_OPTS="$(NIGHTLY_TOOL_OPTS) --rocm"
5959

60-
.lintbin/.lintrunner.sha256: requirements.txt pyproject.toml .lintrunner.toml
60+
.PHONY: setup-lint
61+
setup-lint .lintbin/.lintrunner.sha256: requirements.txt pyproject.toml .lintrunner.toml
6162
@echo "Setting up lintrunner..."
6263
$(PIP) install lintrunner
6364
lintrunner init
6465
@echo "Generating .lintrunner.sha256..."
6566
@mkdir -p .lintbin
6667
@sha256sum requirements.txt pyproject.toml .lintrunner.toml > .lintbin/.lintrunner.sha256
6768

68-
.PHONY: setup-lint
69-
setup-lint: .lintbin/.lintrunner.sha256
70-
7169
.PHONY: lazy-setup-lint
7270
lazy-setup-lint: .lintbin/.lintrunner.sha256
7371
@if [ ! -x "$(shell command -v lintrunner)" ]; then \

0 commit comments

Comments
 (0)