-
-
Notifications
You must be signed in to change notification settings - Fork 13
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: CLI dispatcher #63
Conversation
Thanks for submitting your first pull request! You are awesome! 🤗 |
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.
Very nice, thank you!
Failure is unrelated. Thanks again! |
neat, thank you for the quick review and fixing this up with readme changes and so on! |
I made all CLI packages follow a convention:
def make_parser(parser=None, prog=None)
either creates a parser or adds arguments to one that’s being passeddef run(args=None)
either runs from passedargs
(argparse.Namespace
) or parsessys.argv
usingmake_parser
Together, that allows to maintain backwards compatibility, as
python -m hatch_jupyter_builder.migrate
is still possible and works the same as the newhatch-jupyter-builder migrate
.Fixes #62
Results: