Skip to content

CI: add warning when not in pandas dev and running stubtest #48267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion scripts/run_stubtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,26 @@

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():
sys.exit(1)
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://github.com/pandas-dev"
f"/pandas/blob/main/doc/source/development/contributing_codebase.rst"
f"#validating-type-hints> on how to skip the stubtest"
)


_ALLOWLIST = [ # should be empty
# TODO (child classes implement these methods)
Expand Down