From 576c694a71e1f67f0b02f414f23d8eca3a85352e Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Thu, 25 Aug 2022 09:34:58 +0200 Subject: [PATCH 1/2] Fix mypy erroring on backport branches --- scripts/run_stubtest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/run_stubtest.py b/scripts/run_stubtest.py index cea9665e649d6..dc5af3744a2ed 100644 --- a/scripts/run_stubtest.py +++ b/scripts/run_stubtest.py @@ -9,7 +9,9 @@ import pandas as pd # fail early if pandas is not installed -if "dev" not in getattr(pd, "__version__", ""): +if "dev" not in getattr(pd, "__version__", "") and "1.5." not in getattr( + pd, "__version__", "" +): # fail on the CI, soft fail during local development warnings.warn("You need to install the development version of pandas") if pd.compat.is_ci_environment(): From 0e794a75e38f88892e21cabd08de34677a6b6f69 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Thu, 25 Aug 2022 15:39:42 +0200 Subject: [PATCH 2/2] Add comment --- doc/source/development/contributing_codebase.rst | 6 +++++- scripts/run_stubtest.py | 4 +--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/source/development/contributing_codebase.rst b/doc/source/development/contributing_codebase.rst index bc85a54e61f22..15931a1a3eb83 100644 --- a/doc/source/development/contributing_codebase.rst +++ b/doc/source/development/contributing_codebase.rst @@ -265,7 +265,11 @@ pandas uses `mypy `_ and `pyright =1.22.0) is required for type validation. diff --git a/scripts/run_stubtest.py b/scripts/run_stubtest.py index dc5af3744a2ed..8cf5b81ba398c 100644 --- a/scripts/run_stubtest.py +++ b/scripts/run_stubtest.py @@ -9,9 +9,7 @@ import pandas as pd # fail early if pandas is not installed -if "dev" not in getattr(pd, "__version__", "") and "1.5." not in getattr( - pd, "__version__", "" -): +if not getattr(pd, "__version__", ""): # fail on the CI, soft fail during local development warnings.warn("You need to install the development version of pandas") if pd.compat.is_ci_environment():