Skip to content

Commit

Permalink
refactor: specify venv in pyright config (#430)
Browse files Browse the repository at this point in the history
tell pyright where to find the venv so we don't need to have it
activated for type checking to find imports

plus it looks a little cleaner
  • Loading branch information
tekumara authored May 14, 2023
1 parent a1b3105 commit 242d7c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ node_modules: package.json

## pyright
pyright: node_modules $(venv)
# activate venv so pyright can find dependencies
PATH="$(venv)/bin:$$PATH" node_modules/.bin/pyright
node_modules/.bin/pyright

## run tests
test: $(venv)
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ requires = ["setuptools", "setuptools_scm[toml]", "wheel"]
line-length = 120

[tool.pyright]
venvPath = "."
venv = ".venv"
include = ["src", "tests"]
strictListInference = true
strictDictionaryInference = true
Expand Down

0 comments on commit 242d7c3

Please sign in to comment.