-
-
Notifications
You must be signed in to change notification settings - Fork 242
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 optional interactive shell through click-repl #351
Conversation
By installing `click-repl`[0] the user gets an interactive shell with tab completion enabled. [0]: https://github.com/untitaker/click-repl
Thank you for this @barskern 🤔 I have the feeling that it must be a plugin, and requires therefore that we implement a plugin architecture. |
Hmm I not sure what you mean. This PR doesn't add anything really besides the fact that it will add a |
You've added an extra dependency and its integration is hard coded in the core part of Watson. I think it's not a good architecture, and that we should add plugins support for such feature. |
I don't mean to come of as being pedantic, but technically I only added metadata about a optional dependency that is not installed with watson. Further if the dependency is not present, there is no change from the previous functionality.
On a broader scale, I do understand that you want to create a plugin system of some sort so that further additions like this can be easily added.
…On 23/01/20 11:00, Julien Maupetit wrote:
You've added an extra dependency and its integration is hard coded in the core part of Watson. I think it's not a good architecture, and that we should add plugins support for such feature.
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#351 (comment)
|
Maybe you don't see it because you are the first one willing to add such pattern, but if we begin to do so, Watson will became a huge bloated mess with optional features and dependencies. |
Yeah, I understand that point. Hence my previous comment about the fact that I understand that you would like a plugin system regarding other plugins in the future.
I am however not sure how this would be added as a plugin because it needs to modify the `cli` function which is defined in `cli.py`. I will leave this for you to decide on.
…On 23/01/20 09:00, Julien Maupetit wrote:
> technically I only added metadata about a optional dependency that is not installed with watson. Further if the dependency is not present, there is no change from the previous functionality.
Maybe you don't see it because you are the first one willing to add such pattern, but if we begin to do so, Watson will became a huge bloated mess with optional features and dependencies.
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#351 (comment)
|
This PR seems very similar to the one where The point to me is if this feature makes sense for Watson users, which I'm not quite sure (I don't see myself using it). |
Yeah @davidag, it might not fit that well into everyone's workflow, however personally I find it very handy. I have a script called #!/usr/bin/env bash
watson report -G
echo "---"
watson status
watson repl And then I have a bind in my
When the script launches I get a terminal with pre-printed status information and a repl where I don't have to start every command with |
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.
I second @jmaupetit here.
Adding an optional dependency & 3 lines of conditional code seems harmless, but it means that once this is released, users will expect this option to be supported. We would now depend on the fact that click-repl is maintained & keep working in the future. It doesn't seem actively maintained nor used, so it might not be the best bet.
I like your example though, it seems very convenient. If you wanted to publish a simple package (watson-repl ;) ) to enable this, we could advertise it in the doc or the readme, as we did with past projects.
Yeah, I understand your reasoning. My script is very convenient, and I would be happy to make a package for it, however I am not sure of how to do it. Here are some of the options I could consider:
Is a lot of work to keep up-to-date.
Automatically pull latest changes from upstream through a webhook and merge into package. Potentially low maintance however probably takes some work to setup correctly.
Will probably quickly get out-of-date and hence the patch will not apply smoothly. Any better solutions or tips for my proposed solutions? |
Maybe you could package a python script which would include watson, setup the repl, and expose an entrypoint named Or, as @jmaupetit suggested, we could try to setup a plugin system. |
By installing
click-repl
0 the user gets an interactive shell withtab completion enabled.