-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
add 'info' command to cli #959
Conversation
Note: The current implementation does not print the version anymore, when the I also noticed, that invoking One might also want to restrict the valid queries, filtering out the rather unuseful keywords. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The move up and early return skip's the version printing
I recommend reordering the logic
I'm currently not sure on the details and won't be able to try it's on a computer soon due to traveling
No worries, take your time. I'm glad you even look at it at all. The move is intentional, because I thought that behavior for In short, the code in this PR has the following intended behavior:
But if you think it would break that much legacy, I'm not married to that. |
its not that this breaks legacy, its just that the change would require a major release so i'm under the impression a little extra complexity to have a ls-only would help that |
Sorry, not sure what you mean. Do you want me to change |
correct i'm also wondering about whether listing files, versions and info should be flags instead of commands (i'm imagining something like |
I'm not averse to doing that. One could also think of re-writing the cli in something like click. Would you be averse to that and the extra dependency? |
unfortunately not - it can only be a extra dependency , never a mandatory one the argparse setup should get simpler if the new options are enable/disable flags then in a followup a json output style where each parameter can be asked for can be added |
d795a26
to
09ae7ac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry this was hanging for a while
looks good 👍
please take a look at the type nitpicks and add a scriv fragment to the changelog
src/setuptools_scm/_cli.py
Outdated
print("\n".join(data.values())) | ||
|
||
|
||
def _print_key_value(data: dict[Any, Any]) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dito
Adds an
info
command to thesetuptools_scm
command line. This info command can be used to print settings, like so:This is only a proof of concept implementation, I could work on tests, stabilization and a proper implementation if that was desired.
More details and examples: