From eab6d4ebacd31eba4159caef51fa4420904892a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20W=C3=B6rtwein?= Date: Wed, 29 Sep 2021 14:31:51 -0400 Subject: [PATCH 1/5] run pyright in the manual stage of the pre-commit --- .github/workflows/pre-commit.yml | 2 -- .pre-commit-config.yaml | 1 + doc/source/development/contributing_codebase.rst | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 9afb0e34f1075..0609755678d78 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -13,8 +13,6 @@ jobs: concurrency: group: ${{ github.ref }}-pre-commit cancel-in-progress: ${{github.event_name == 'pull_request'}} - env: - SKIP: pyright steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f15a340e75181..577729c629348 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -89,6 +89,7 @@ repos: language: node pass_filenames: false types: [python] + stages: [manual] # note: keep version in sync with .github/workflows/ci.yml additional_dependencies: ['pyright@1.1.171'] - repo: local diff --git a/doc/source/development/contributing_codebase.rst b/doc/source/development/contributing_codebase.rst index eeba46a46dfd9..44a35078d27cb 100644 --- a/doc/source/development/contributing_codebase.rst +++ b/doc/source/development/contributing_codebase.rst @@ -402,7 +402,7 @@ pandas uses `mypy `_ and `pyright Date: Wed, 29 Sep 2021 16:18:34 -0400 Subject: [PATCH 2/5] added note about numpy version --- doc/source/development/contributing_codebase.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/source/development/contributing_codebase.rst b/doc/source/development/contributing_codebase.rst index 44a35078d27cb..d5743e9c8dd4b 100644 --- a/doc/source/development/contributing_codebase.rst +++ b/doc/source/development/contributing_codebase.rst @@ -406,6 +406,8 @@ pandas uses `mypy `_ and `pyright =1.21.0` installed when validating types, since this is the first version that provides `numpy.typing`. + .. _contributing.ci: Testing with continuous integration From 9dbec910045dce616c8bb4e167d2a6c46ef6e6af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20W=C3=B6rtwein?= Date: Wed, 29 Sep 2021 17:53:33 -0400 Subject: [PATCH 3/5] make sure the CI uses numpy>=1.21.0 when type checking --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c8f5f0385732f..d6b5d64833e28 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,6 +32,9 @@ jobs: with: fetch-depth: 0 + - name: numpy>=1.21.0 for type checkers + run: sed -i "s/numpy>=1.18.5/numpy>=1.21.0/g" ${{ env.ENV_FILE }} + - name: Cache conda uses: actions/cache@v2 with: From 7749e8cea360bbff8ac85b071cf6d7647f994176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20W=C3=B6rtwein?= Date: Wed, 29 Sep 2021 18:05:29 -0400 Subject: [PATCH 4/5] formatting --- doc/source/development/contributing_codebase.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/development/contributing_codebase.rst b/doc/source/development/contributing_codebase.rst index d5743e9c8dd4b..73eceb68c046e 100644 --- a/doc/source/development/contributing_codebase.rst +++ b/doc/source/development/contributing_codebase.rst @@ -406,7 +406,7 @@ pandas uses `mypy `_ and `pyright =1.21.0` installed when validating types, since this is the first version that provides `numpy.typing`. +Please make sure to have ``numpy>=1.21.0`` installed when validating types, since this is the first version that provides ``numpy.typing``. .. _contributing.ci: From a14a4428b9b5748529bca9a0a0adf2a31124bbe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20W=C3=B6rtwein?= Date: Thu, 30 Sep 2021 17:37:20 -0400 Subject: [PATCH 5/5] remove CI parts --- .github/workflows/ci.yml | 3 --- doc/source/development/contributing_codebase.rst | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d6b5d64833e28..c8f5f0385732f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,9 +32,6 @@ jobs: with: fetch-depth: 0 - - name: numpy>=1.21.0 for type checkers - run: sed -i "s/numpy>=1.18.5/numpy>=1.21.0/g" ${{ env.ENV_FILE }} - - name: Cache conda uses: actions/cache@v2 with: diff --git a/doc/source/development/contributing_codebase.rst b/doc/source/development/contributing_codebase.rst index 73eceb68c046e..936db7d1bee88 100644 --- a/doc/source/development/contributing_codebase.rst +++ b/doc/source/development/contributing_codebase.rst @@ -406,7 +406,7 @@ pandas uses `mypy `_ and `pyright =1.21.0`` installed when validating types, since this is the first version that provides ``numpy.typing``. +A recent version of ``numpy`` (>=1.21.0) is required for type validation. .. _contributing.ci: