Skip to content

Commit

Permalink
fix example lint
Browse files Browse the repository at this point in the history
  • Loading branch information
linshokaku committed Jan 24, 2024
1 parent c35d7e4 commit e31ef9f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ mpitest: ## Run all tests except for ones requiring GPU.

.PHONY: example_lint
example_lint: ## Format the Python code.
$(PY) -m pysen --config ./example/pysen.toml run lint
cp "$$($(PIP) show torch | awk '/^Location:/ { print $$2 }')/torch/__init__.py" stubs/torch/__init__.py
trap "rm -f stubs/torch/__init__.py" EXIT; $(PY) -m pysen --config ./example_pysen.toml run lint

.PHONY: help
help: ## Display this help message.
Expand Down
9 changes: 5 additions & 4 deletions example/pysen.toml → example_pysen.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[build-system]
requires = ["setuptools<64", "wheel"]

[tool.pysen]
version = "0.10.1"

Expand All @@ -12,6 +9,10 @@ enable_mypy = true
mypy_preset = "entry"
line_length = 80
py_version = "py38"
mypy_path = ["./stubs"]

[tool.pysen.lint.mypy_modules."torch.*"]
ignore_errors = true

[[tool.pysen.lint.mypy_targets]]
paths = ["."]
paths = ["./example"]
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ enable_mypy = true
mypy_preset = "strict"
line_length = 80
py_version = "py38"
mypy_path = ["./stubs"]

[[tool.pysen.lint.mypy_targets]]
paths = ["pytorch_pfn_extras"]
Expand Down

0 comments on commit e31ef9f

Please sign in to comment.