Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Check Axes/Figure import paths in boilerplate.py #29948

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 1 commit into from
Apr 19, 2025
Merged
Changes from all 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
10 changes: 9 additions & 1 deletion tools/boilerplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,5 +459,13 @@ def update_sig_from_node(node, sig):
if len(sys.argv) > 1:
pyplot_path = Path(sys.argv[1])
else:
pyplot_path = Path(__file__).parent / "../lib/matplotlib/pyplot.py"
mpl_path = (Path(__file__).parent / ".." /"lib"/"matplotlib").resolve()
pyplot_path = mpl_path / "pyplot.py"
for cls in [Axes, Figure]:
if mpl_path not in Path(inspect.getfile(cls)).parents:
raise RuntimeError(
f"{cls.__name__} import path is not {mpl_path}.\n"
"Please make sure your Matplotlib installation "
"is from the same source checkout as boilerplate.py"
)
build_pyplot(pyplot_path)
Loading