feat: add --json output flag to auditwheel show#685
Conversation
mayeut
left a comment
There was a problem hiding this comment.
Not reviewed thoroughly yet but left a couple comments inlined in addition to the following more general comment.
Per #676 (comment), as the json output should be an "API", it should be versioned, and, ideally, we might want to have a json schema for this.
|
While this does not cover all functionality requested in #676, it does solve one of them so linking here. |
| ) | ||
| except NonPlatformWheelError as e: | ||
| logger.info("%s", e.message) | ||
| if args.JSON: |
There was a problem hiding this comment.
I'm not sure if handling this special json case is important. Also, the case below where pure wheels are allowed does not emit a json. What's the preference?
There was a problem hiding this comment.
What's the preference?
If adding this, let's try to add it properly.
If pure wheels are allowed then we should not error but output a specific json output for pure wheels, e.g. the schema could have something like:
"oneOf": [
{ "$ref": "#/$defs/result_pure" },
{ "$ref": "#/$defs/result_platform" },
{ "$ref": "#/$defs/error" }
],
adding a "pure" boolean property that's always true for result_pure and always false for result_platform
There was a problem hiding this comment.
Yeah, that's a good idea! Implemented that approach. (I also removed the unnecessary .. import json which already happens earlier in this function.)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #685 +/- ##
==========================================
+ Coverage 95.73% 95.79% +0.05%
==========================================
Files 23 23
Lines 1923 1949 +26
Branches 362 370 +8
==========================================
+ Hits 1841 1867 +26
Misses 46 46
Partials 36 36 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@mayeut, please let me know if there's something I can do to help move this work forward (assuming that there is an interest in doing so.) |
|
@lcarva, there's still interest however I'd like to get a couple fixes & the android support so it might take a bit of time before this can be reviewed again. |
Enable scripting by adding a --json flag that outputs structured JSON instead of human-readable text, including wheel tag, compatibility flags, versioned symbols, external libs, and policy upgrade info. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Enable scripting by adding a --json flag that outputs structured JSON instead of human-readable text, including wheel tag, compatibility flags, versioned symbols, external libs, and policy upgrade info.