Skip to content
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

Improve error message when CMake is not found #309

Merged
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
8 changes: 7 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,13 @@ def run_process(args, **kwargs):
try:
run_process(("cmake", "--version"))
except Exception as ex:
raise RuntimeError(_make_message_box("!! CMake not found !!")) from ex
raise RuntimeError(
_make_message_box(
"!! CMake not found !!",
"Ensure PIP is updated to the latest version to handle build dependencies automatically,",
Copy link
Contributor

@apartridge apartridge Dec 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I would consider to prefix this with "Tip:" and maybe some blank lines before and after just so this part is more visibile. Often people get overwhelmed by long error messages and won't see the tips/solution.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will look like this:
image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

"or install CMake and Ninja manually.",
)
) from ex
with tempfile.TemporaryDirectory(prefix="zivid-python-build-") as temp_dir:
with (Path(temp_dir) / "lib.cpp").open("w") as lib_cpp:
# MSVC does not report itself as C++17, on Windoes we have to rely on the CMAKE_CXX_STANDARD test below
Expand Down
Loading