From a917b0be42d3820a856dd50e14b79f08740a5abe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20W=C3=B6rtwein?= Date: Thu, 19 May 2022 19:00:35 -0400 Subject: [PATCH] CI: use github action for pyright --- .github/workflows/code-checks.yml | 15 ++++++--------- ci/code_checks.sh | 7 ------- pandas/_libs/missing.pyi | 3 ++- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/.github/workflows/code-checks.yml b/.github/workflows/code-checks.yml index 7d24b26f5538b..18bed0714e5c5 100644 --- a/.github/workflows/code-checks.yml +++ b/.github/workflows/code-checks.yml @@ -67,15 +67,6 @@ jobs: environment-file: ${{ env.ENV_FILE }} use-only-tar-bz2: true - - name: Install node.js (for pyright) - uses: actions/setup-node@v3 - with: - node-version: "16" - - - name: Install pyright - # note: keep version in sync with .pre-commit-config.yaml - run: npm install -g pyright@1.1.247 - - name: Build Pandas id: build uses: ./.github/actions/build_pandas @@ -100,6 +91,12 @@ jobs: run: ci/code_checks.sh typing if: ${{ steps.build.outcome == 'success' }} + - uses: jakebailey/pyright-action@v1 + with: + # note: keep version in sync with .pre-commit-config.yaml + version: 1.1.247 + extra-args: --skipunannotated + - name: Run docstring validation script tests run: pytest scripts if: ${{ steps.build.outcome == 'success' }} diff --git a/ci/code_checks.sh b/ci/code_checks.sh index d7e685f8d055f..d5848b3293525 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -94,13 +94,6 @@ if [[ -z "$CHECK" || "$CHECK" == "typing" ]]; then MSG='Performing static analysis using mypy' ; echo $MSG mypy RET=$(($RET + $?)) ; echo $MSG "DONE" - - # run pyright, if it is installed - if command -v pyright &> /dev/null ; then - MSG='Performing static analysis using pyright' ; echo $MSG - pyright - RET=$(($RET + $?)) ; echo $MSG "DONE" - fi fi ### SINGLE-PAGE DOCS ### diff --git a/pandas/_libs/missing.pyi b/pandas/_libs/missing.pyi index 3a4cc9def07bd..e7d0ba275ac4d 100644 --- a/pandas/_libs/missing.pyi +++ b/pandas/_libs/missing.pyi @@ -10,7 +10,8 @@ def is_matching_na( ) -> bool: ... def isposinf_scalar(val: object) -> bool: ... def isneginf_scalar(val: object) -> bool: ... -def checknull(val: object, inf_as_na: bool = ...) -> bool: ... +# test pyright + github action (reportInvalidStubStatement) +def checknull(val: object, inf_as_na: bool = True) -> bool: ... def isnaobj(arr: np.ndarray, inf_as_na: bool = ...) -> npt.NDArray[np.bool_]: ... def isnaobj2d(arr: np.ndarray, inf_as_na: bool = ...) -> npt.NDArray[np.bool_]: ... def is_numeric_na(values: np.ndarray) -> npt.NDArray[np.bool_]: ...