Skip to content

Commit

Permalink
ci: add Pyright
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Aug 15, 2023
1 parent 840fe22 commit d34f50b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,29 @@ jobs:

- run: python -Im tox run -e mypy-pkg

pyright:
name: Check code base & API w/ Pyright
runs-on: ubuntu-latest
needs: build-package

steps:
- name: Download pre-built packages
uses: actions/download-artifact@v3
with:
name: Packages
path: dist
- run: tar xf dist/*.tar.gz --strip-components=1
- uses: actions/setup-python@v4
with:
cache: pip
python-version-file: .python-version-default

- run: |
python -Im venv .venv
.venv/bin/python -Im pip install .[typing]
echo "$PWD/.venv/bin" >> $GITHUB_PATH
- uses: jakebailey/pyright-action@v1

docs:
name: Build docs & run doctests
runs-on: ubuntu-latest
Expand Down Expand Up @@ -219,6 +242,7 @@ jobs:
needs:
- coverage
- mypy-pkg
- pyright
- docs
- install-dev
- system-package
Expand Down
15 changes: 15 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,21 @@ deps = pre-commit
commands = pre-commit run --all-files


[testenv:pyright]
# Install and configure node and pyright
# Use nodeenv to configure node in the running tox virtual environment
# Seeing errors using "nodeenv -p"
# Use npm install -g to install "globally" into the virtual environment
# Does not run by default locally because it's slow.
deps = nodeenv
extras = typing
commands_pre =
nodeenv --prebuilt --node=lts --force {envdir}
npm install -g --no-package-lock --no-save pyright
pyright --version
commands = pyright tests/typing src


[testenv:mypy-pkg]
description = Check own code.
deps = mypy
Expand Down

0 comments on commit d34f50b

Please sign in to comment.