Skip to content

Commit 9757d1f

Browse files
ambujpawarAmbuj Pawar
and
Ambuj Pawar
authored
CI: add warning when not in pandas dev and running stubtest (#48267)
* add warning when not in pandas dev and running stubtest * add url to the warning * add trailing underscore in version * Format the warning message * resolve review comments Co-authored-by: Ambuj Pawar <[email protected]>
1 parent e97b082 commit 9757d1f

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

scripts/run_stubtest.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,26 @@
88

99
import pandas as pd
1010

11+
pd_version = getattr(pd, "__version__", "")
12+
1113
# fail early if pandas is not installed
12-
if not getattr(pd, "__version__", ""):
14+
if not pd_version:
1315
# fail on the CI, soft fail during local development
1416
warnings.warn("You need to install the development version of pandas")
1517
if pd.compat.is_ci_environment():
1618
sys.exit(1)
1719
else:
1820
sys.exit(0)
1921

22+
# GH 48260
23+
if "dev" not in pd_version:
24+
warnings.warn(
25+
f"stubtest may fail as {pd_version} is not a dev version. "
26+
f"Please install a pandas dev version or see https://pandas.pydata.org/"
27+
f"pandas-docs/stable/development/contributing_codebase.html"
28+
f"#validating-type-hints on how to skip the stubtest"
29+
)
30+
2031

2132
_ALLOWLIST = [ # should be empty
2233
# TODO (child classes implement these methods)

0 commit comments

Comments
 (0)