Skip to content

Commit

Permalink
Add pyright
Browse files Browse the repository at this point in the history
  • Loading branch information
Clément committed Sep 12, 2024
1 parent 5f0ac82 commit f2e5bb6
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 8 deletions.
43 changes: 37 additions & 6 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,16 @@ jobs:
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/cache@v3
name: Define a cache for the virtual environment based on the dependencies lock file
name: Define a cache for the virtual environment based on the dependencies file
with:
path: ./.venv
key: venv-${{ hashFiles('pyproject.toml') }}
path:
- ./.venv
- poetry.lock
key: venv-${{ hashFiles('pyproject.toml') }}-${{ matrix.python-version }}-${{ matrix.os }}
- name: Install the project dependencies
run: poetry install --with test
- name: Run the test
run: COLUMNS=80 poetry run coverage run -m pytest
run: poetry run coverage run -m pytest
- name: "Upload coverage data to GH artifacts 📤"
if: matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -77,7 +79,9 @@ jobs:
- uses: actions/cache@v3
name: Define a cache for the virtual environment based on the dependencies lock file
with:
path: ./.venv
path:
- ./.venv
- poetry.lock
key: venv-${{ hashFiles('pyproject.toml') }}
- name: Install the project dependencies
run: poetry install --with test
Expand Down Expand Up @@ -140,4 +144,31 @@ jobs:
with:
# leave default names
name: python-coverage-comment-action
path: python-coverage-comment-action.txt
path: python-coverage-comment-action.txt

run-pyright:
strategy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install poetry
uses: abatilo/actions-poetry@v3
- name: Setup poetry
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- uses: actions/cache@v3
name: Define a cache for the virtual environment based on the dependencies file
with:
path:
- ./.venv
- poetry.lock
key: venv-${{ hashFiles('pyproject.toml') }}
- name: Install the project dependencies
run: poetry install --with test
- run: echo "$PWD/.venv/bin" >> $GITHUB_PATH
- uses: jakebailey/pyright-action@v2
name: Run pyright
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
uses: py-cov-action/python-coverage-comment-action@v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PR_RUN_ID: ${{ github.event.workflow_run.id }}
GITHUB_PR_RUN_ID: ${{ github.event.workflow_run.id }}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ PyYAML = "^6.0.1"
imageio = "^2.31.3"
imagesize = "^1.4.1"
POT = "^0.9.1"
jsonschema-rs = "^0.16.3"
jsonschema-rs = "^0.18.3"
scikit-learn = "^1.3.0"
typing-extensions = "^4.7.1"
watchdog = "^3.0.0"
Expand Down

0 comments on commit f2e5bb6

Please sign in to comment.