-
Notifications
You must be signed in to change notification settings - Fork 58
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
Changed the default command to jupyter run
, but left in execute
as an alias with a deprecation warning
#173
Conversation
…otebook, but left in as an alias with a deprecation warning
Tiny fix suggested to print stmt, otherwise I'd go for it. Thanks so much @palewire! |
Great, thx! I've now made the IPython PR above to match this functionality in the IPython docs. |
Thanks @palewire ! |
This conflicts with the already existing jupyter-run from jupyter_client: |
Thanks for flagging that. I'd defer here to @fperez and @davidbrochart |
I didn't know this command. Looks like it executes some code from a file in a kernel, e.g.: jupyter run foo.py -f kernel-foo.json I don't know if it's still used, @minrk ? |
Mmh, I wasn't aware of it either, though at this point if it's been in real-world use for a while, we don't want to break that! Question is whether the functionalities could be subsumed together, I suspect they are similar enough that they could fall under a single umbrella. |
I'm fine with deprecating the one in juptyer_client to be an alias to nbclient if available. I don't know if anyone uses it. |
Do you mean that we would use nbclient if the file is a notebook, and jupyter_client otherwise? |
Ah, I misread. I thought it did the same thing, but was moving to a new package. The least disruptive would be to use an available name, e.g. I don't have particularly strong feelings, but usually lean toward not breaking things, even if I don't use them. |
There is a problem with having two packages with the same |
Thinking about it, as @minrk mentioned, |
Whatever the solution, I would argue for avoiding prefixes like My take is that a dis-ambiguation strategy is the best long term solution. Even if we stick with execute, we are left with two similar verbs, execute and run, that do two slightly different things. That could be a new source of confusion. For that reason, I am sympathetic to an approach that either merges the two commands, or changes the existing one to a more specific namespace like run-cell. |
I see merging the two commands as difficult because |
Gotcha. How does the scope of these two commands compare to the IPython run command from which we are drawing inspiration? I wonder if the overlap there might help us devise harmonious language. |
IPython's |
This is how I noticed and is the reason why we currently don't ship nbclient's jupyter-run in openSUSE. |
Hmm. So how could we harmonize, with the generic Jupyter package end user in mind? Write a unified command and limit it to one of these two packages? Create a new simple package just for the cli? |
jupyter_client can be installed without nbclient, so it must have the command, but this means nbclient cannot have it.
And remove it from jupyter_client and nbclient? Since this is a breaking change, we could as well replace jupyter_client's |
Gotcha. So just to think it through, here are those two routes to a unified command that mirrors the IPython %run functionality fleshed out. I'm not advocating one or the other, just talking it out. I suspect you are 10 steps ahead of me here, so thank you in advance for your patience. Route 1: Pick a package
Route 2: Spin off a CLI package
I pencil that out right? You like one or the other? Hate them both? |
Route 1 can be simplified, as nbclient already depends on jupyter_client:
|
Route 1 makes nbclient a dependency of jupyter_client, I'm not sure we want that. |
@bnavigator, thanks for the ideas. One thing I'm not clear on in your sketch: How would You are right that We could then remove the console script from |
# in jupyter-client
if jupyter_run_was_called_with_a_notebook_argument:
try:
from nbclient import cli as nbclientcli
except ImportError:
output_some_error_message("We need nbclient for this funcitionality")
sys.exit(ERROR_CODE)
nbclientcli.run(*sys.argv) You can add nbclient to an
That's the worst case. You add a dependency that was not there before.
Exactly.
As far as I understand jupyter_client is supposed to be an abstraction away from being just for ipython notebooks. Adding nbclient as dependency contradicts that. |
I definitely better understand the challenges of merging the two commands. Thanks! I guess I'm looking for some higher level package strategy to help me understand things. I worry that these noob questions might irritate maintainers who are miles and miles ahead of me in the thinking here, but I come back to: Why are nbclient and jupyter_client separate packages? Maybe there's something we can find there that would help us sort this out, or come up with a naming convention that everyone felt would be durable. |
jupyter_client doesn't know about notebooks. |
I removed |
Thanks for patching the bug. Mostly for myself, here's an attempt to redraft "Route 1" with @bnavigator's input.
I get that right? If we can all agree on a path, I'd be happy to do the work of slapping it in. |
This pull request has been mentioned on Jupyter Community Forum. There might be relevant details there: https://discourse.jupyter.org/t/jupyter-run-requires-notebook-to-be-previously-run/12250/1 |
This pull request has been mentioned on Jupyter Community Forum. There might be relevant details there: https://discourse.jupyter.org/t/jupyter-run-requires-notebook-to-be-previously-run/12250/3 |
No description provided.