Skip to content

feat: add --json output flag to auditwheel show#685

Open
lcarva wants to merge 2 commits intopypa:mainfrom
lcarva:show-json
Open

feat: add --json output flag to auditwheel show#685
lcarva wants to merge 2 commits intopypa:mainfrom
lcarva:show-json

Conversation

@lcarva
Copy link
Copy Markdown
Contributor

@lcarva lcarva commented Mar 27, 2026

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.

Copy link
Copy Markdown
Member

@mayeut mayeut left a comment

Choose a reason for hiding this comment

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

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.

@mayeut
Copy link
Copy Markdown
Member

mayeut commented Mar 28, 2026

While this does not cover all functionality requested in #676, it does solve one of them so linking here.

lcarva and others added 2 commits April 2, 2026 15:34
The docker SDK types `exec_run` as returning `(int | None, bytes |
Iterator[bytes])`, but in non-streaming mode it always returns
`(int, bytes)`. Add isinstance assertions to satisfy mypy.

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.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
)
except NonPlatformWheelError as e:
logger.info("%s", e.message)
if args.JSON:
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.31%. Comparing base (3cdd1a7) to head (b3b3d3b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #685      +/-   ##
==========================================
+ Coverage   95.24%   95.31%   +0.06%     
==========================================
  Files          22       22              
  Lines        1830     1856      +26     
  Branches      343      350       +7     
==========================================
+ Hits         1743     1769      +26     
  Misses         48       48              
  Partials       39       39              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants