-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Report install errors and failures in JSON format #11316
Comments
👋 Hi from the We'd love to see something like this, it'd make our error parsing code a bit less fragile. This is actually a common problem we encounter across package managers in many language ecosystems, so if you are looking for design input, feel free to give us a holler (our main issue tracker is https://github.com/dependabot/dependabot-core/) and we'd happily share some of what we've observed elsewhere. Also, what's the next step on this issue?
|
IMO, this is a reasonable suggestion, so I think it's awaiting someone to take it further. This isn't something that needs a PEP, as it's a pip implementation matter, but it will have an impact on how our error handling code works, so I think it might be worth some sort of discussion about how this will be implemented before someone launches into writing a PR. (That's assuming an external contributor wants to tackle this, rather than waiting for one of the pip maintainers to have the time to pick it up). |
+1 to all that Paul said. To be explicit, the next step is 2 with the caveat that we should discuss the design here before implementing it, since it redoes a fairly foundational design piece of the code base's CLI. FWIW, this request also aligns nicely with the UX design direction that #10421 sent us down (where all errors follow the same schema/structure, and have unique user-facing error codes). I wouldn't be opposed to migrating just those errors to be JSON-serializable for the output and then leaving out the long tail of errors that need to migrate to the DiagnosticError model. And, https://github.com/pradyunsg/diagnostic became a thing last week. So, breaking this up into smaller design problems is also doable. :) |
On behalf of |
It's been a little bit so I'll speak for the project (with my triager hat on). We generally would welcome a feature like this. However, as @pradyunsg brought up, this is going to require a nontrivial amount of work to come up with a design and port the codebase's error handling to support this new feature. For some initial guidance, pip's errors are split into two groups:
There's actually one more: unhandled exceptions that bubble up resulting in crashes, but those should be easy to tack on to whatever infrastructure we end up with as a special case. Errors (barring the last category) are eventually caught and presented in Alternatively, you can just design something that works for the relevant errors that pipx would need at the minimum. Either way, you'll have to special case for the ResolutionImpossible error at least (or provide a way for additional structured information to be tracked). Feel free to explore the codebase and start drafting a proposal @chrysle. |
Thanks for the informative response! I'll see what can be done. |
What's the problem this feature will solve?
Currently,
pip install --report
reports errors and exceptions in plain text which is inconvenient for parsing.Describe the solution you'd like
Instead of
report errors and exceptions in JSON format, for example:
Alternative Solutions
Let users parse plain text and let them hope for the best.
Additional context
jazzband/pip-tools#1654 (comment)
Code of Conduct
The text was updated successfully, but these errors were encountered: