diff --git a/scripts/run_stubtest.py b/scripts/run_stubtest.py index 8cf5b81ba398c..d90f8575234e8 100644 --- a/scripts/run_stubtest.py +++ b/scripts/run_stubtest.py @@ -8,8 +8,10 @@ import pandas as pd +pd_version = getattr(pd, "__version__", "") + # fail early if pandas is not installed -if not getattr(pd, "__version__", ""): +if not 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(): @@ -17,6 +19,15 @@ else: sys.exit(0) +# GH 48260 +if "dev" not in pd_version: + warnings.warn( + f"stubtest may fail as {pd_version} is not a dev version. " + f"Please install a pandas dev version or see https://pandas.pydata.org/" + f"pandas-docs/stable/development/contributing_codebase.html" + f"#validating-type-hints on how to skip the stubtest" + ) + _ALLOWLIST = [ # should be empty # TODO (child classes implement these methods)