Skip to content

Commit

Permalink
[dev-ops] Type annotation validation GitHub action (#902)
Browse files Browse the repository at this point in the history
* add pyright as dev dependency

* add empty configuration for pyright to pyproject.toml

* add github action for pyright

* test the other pyright github action (hopefully with inline comments)

* add github token for pyright action

* Revert "test the other pyright github action (hopefully with inline comments)"

This reverts commit 2012f51.

* install python and requirements for pyright checks

* define python version for pyright

* also install docs requirements to fix type warnings for docs folder

* limit type checks to a single file to get started

* add missing dependency path to type check action

* shorten upgrade parameter for pip

* fix requirements/base.txt file location
  • Loading branch information
noxan authored Dec 2, 2022
1 parent 9237bfd commit b04a5bc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,19 @@ jobs:
uses: psf/black@stable
with:
jupyter: true

pyright:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"
cache-dependency-path: "**/requirements/*.txt"
- name: Setup Requirements
run: pip install -U -r requirements/base.txt -r requirements/docs.txt
- name: pyright
uses: jakebailey/pyright-action@v1
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ exclude = '''
[tool.isort]
profile = "black"
line_length = 120

[tool.pyright]
include = ["neuralprophet/configure.py"]
1 change: 1 addition & 0 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ black[jupyter]
flake8
isort
livelossplot>=0.5.3
pyright
pytest-cov
pytest>=6.2.3
twine
Expand Down

0 comments on commit b04a5bc

Please sign in to comment.