-
Notifications
You must be signed in to change notification settings - Fork 990
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
[feature] Add query interface to conan inspect #13654
Comments
Thanks for your suggestion @samuel-emrys I think this makes sense, and I think I recall it is not the first time this is requested. |
I am able to do this qute nicely in v1.59 using CONAN_PACKAGE_NAME=$(conan inspect . --raw=name)
CONAN_PACKAGE_VERSION=$(conan inspect . --raw=version) We are using this in our CI scripts, exactly the use case OP mentioned. The elimination of |
With #13716, from 2.0.5, Conan will be able to return name, version, evaluating the Still, we are not sure about a specific interface to extract 1 single attribute, this is kind of standard work in CI, and $ conan inspect . --format=json > inspect.json
$ NAME=$(jq .name inspect.json) I think this approach is robust, simple, applicable to tons of other situations (every Conan command with a json output), generic and well known |
If you want this to be consistent across all interfaces, perhaps you could add a companion argument when
Or maybe this is just internally how
I'm not sure this is necessary across all interfaces, but the consistency is nice. There are certain output values that I suspect are more useful for direct evaluation on the CLI (inspecting package properties), and others that I suspect are much more valuable programatically (reasoning about the graph, build order, search, list, cache, etc). |
I work in Windows, The problem of the "companion" |
Recall that as we fixed the commands output and the $ conan inspect . --format=json | jq .name -r |
I have discussed this with the team. It seems there is a total consensus, we have fixed for 2.0.5 the major blocker that was the evaluation of the Closing this issue, thanks very much for the feedback! |
No problems, it was just a convenience thing. Thanks for the consideration 🙂 |
What is your suggestion?
I think it would be useful from a CI perspective to be able to easily extract information about a package from a conanfile.py. Currently, we have
conan inspect
, which gives some good information related to a package:But to extract the package name I currently have to do something like this:
It would be useful if this was built into the interface so that it could be accessed something like:
I think that this would help make our CI scripts a bit more readable.
Have you read the CONTRIBUTING guide?
The text was updated successfully, but these errors were encountered: