-
Notifications
You must be signed in to change notification settings - Fork 26
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
CLI: Accept --version
argument, to print the package version
#139
Conversation
f22f83b
to
4a7b5eb
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.
Test please.
4a7b5eb
to
31b5ff1
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.
Please add tests 👍
31b5ff1
to
d194ecb
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.
test suite is failing
Apologies. It worked on my machine. I will have a look. |
d194ecb
to
308bd03
Compare
897b269
to
a63df55
Compare
It looks like to works better now on CI. 🌻 |
tests/test_cli.py
Outdated
cli_args(["--version"]) | ||
assert context.value.code == 0 | ||
out, err = capsys.readouterr() | ||
assert out.startswith(("pytest", "__main__.py")) |
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.
Shouldn't this be pyproject-fmt? Perhaps we should set prog above.
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.
Also there's no assert that it prints out the correct version.
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.
Thank you.
a) The patch has been amended to define the prog
parameter to ArgumentParser
. Is it the right choice? If not, please educate me how to do it differently.
b) The test case has been adjusted to also verify the correct version number is actually used when printing to stdout.
d3f0096
to
34119ba
Compare
This helps in debugging situations to find out about the installed version of `pyproject_fmt`.
34119ba
to
0975a41
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.
Hi again,
using the
--version
argument helps in debugging situations to find out about the installed version ofpyproject-fmt
.With kind regards,
Andreas.