-
Notifications
You must be signed in to change notification settings - Fork 49
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
Pep517HookCaller's prepare_metadata_for_build_wheel throws subprocess.CalledProcessError instead of something nice #38
Comments
So I think you're asking for the hooks to propagate the Python exception information back to the caller. That's possible, but I suspect it's not worth the extra complexity. The build backend invoked by this module can run absolutely arbitrary code - extension modules, network requests, even running non-Python subprocesses. By design, the frontend doesn't know what the backend is doing. Thus, if the backend fails, the frontend can't really make sense of what went wrong. An All the frontend can really understand is whether the operation succeeded or failed. If it failed, the only reasonable options are to try a generic fallback (such as running |
While it's not @Jonast's use case (and I suspect the requirements are significantly different) there is an advantage in propagating more details of backend errors back to the frontend, which is to provide better error reporting. At the moment, pip gets a BackendUnavailable error when the import of the backend gives ImportError. We can't really do anything more than report that to the user. If we had the ImportError details (at least the traceback) we could print it and give the user a better chance of diagnosing the issue. See pypa/pip#6164 for an example. |
That's actually kind of asking for less specific handling of errors. For all 'normal' backend errors, you'll get a But we can probably arrange to include the traceback with those errors. |
@pfmoore a I really don't care for the traceback at all, my problem is that right now it's kind of designed to make me catch |
IIUC, this can be closed correct? |
@pradyunsg was the behavior changed such that a more pep517-specific error is thrown? (like a |
Is this issue a duplicate of #10? |
It is a duplicate of #10. |
Pep517HookCaller's prepare_metadata_for_build_wheel throws subprocess.CalledProcessError if
wheel
is not installed, and that it throws an error in that case is of course expected, but wouldn't some sort of other error make more sense? I'm a bit afraid to catch this specific one now since this error seems extremely implementation-specific (related to how it's internally called) rather than problem-descriptive (telling me thatwheel
is missing), but I don't want to catchException
either. So I'm not sure how to best catch this sort of problem...?The text was updated successfully, but these errors were encountered: