-
Notifications
You must be signed in to change notification settings - Fork 9
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
otk: don't use click #102
otk: don't use click #102
Conversation
5fe3419
to
2a6fcd1
Compare
This PR also drops the |
Don't use click as it is not available in RHEL, instead use the built-in argparse. This also adds minor tests for the command line. Signed-off-by: Simon de Vlieger <cmdr@supakeen.com>
These examples accidentally got into the repository. Signed-off-by: Simon de Vlieger <cmdr@supakeen.com>
Use the argparse required subcommands even if the help is a bit suboptimal it gives us clearer code. Signed-off-by: Simon de Vlieger <cmdr@supakeen.com>
We need this available earlier otherwise the next check fails. Signed-off-by: Simon de Vlieger <cmdr@supakeen.com>
Doing this makes the output show the place where the subcommand goes. Signed-off-by: Simon de Vlieger <cmdr@supakeen.com>
This can live in the constructor. Signed-off-by: Simon de Vlieger <cmdr@supakeen.com>
Setting the help makes sure the command actually show up in the help text. Signed-off-by: Simon de Vlieger <cmdr@supakeen.com>
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.
Thanks! LGTM except for a tiny comment and a type annotation.
Much cleaner now I think :)
log.info("Compiling the input file %r to %r", input, output or "STDOUT") | ||
if not src.exists(): | ||
log.fatal("INPUT path %r does not exist", str(src)) | ||
return 1 |
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.
Function's type annotation should say it returns an int
now.
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.
Added a commit to fix the signature.
Signed-off-by: Simon de Vlieger <cmdr@supakeen.com>
Click was removed in osbuild#102 so it can be safely removed from the pyproject.toml.
Click was removed in #102 so it can be safely removed from the pyproject.toml.
Start removing click from the main otk command.