Proposal: --json output for pixi publish --dry-run
#6729
thomas-lemma
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
This is a small follow-up related to Proposal: Version override argument for
pixi publish, motivated by CI use cases.Context.
pixi publish --dry-runalready resolves and prints the package(s) that would be built, including the resolved version. Output, for example:This is exactly the information generic CI scripts often need, for example to tag artifacts with the resolved package version. However, extracting the version currently requires grepping the rich-text output:
ver=$(pixi publish --dry-run 2>&1 | grep -oP '(?<= v)[^ ]+(?= \[)')This is fragile — any change to the human-readable format might break the script.
Question. Would a
--jsonflag (or similar, e.g.--format=json) onpixi publish --dry-runto support machine parsing fit the direction of the tooling? This would allow more robust CI workflows, e.g. usingjq:ver=$(pixi publish --dry-run --json | jq -r '.packages[0].version')This kind of flag typically coexists cleanly with the default human-readable output, as seen in tools like
kubectl -o jsonorpip list --format=json.Happy to discuss this further if it seems worth exploring. Thanks a lot!
All reactions