-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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 "all" flag to nbextension and serverextension commands #2715
Conversation
I think it's just going to end up raising this error in some cases, and not doing what you expect in others. The machinery is designed to select one location to make a change, not a set of locations. Rather than trying to add this for all commands, I'd focus on the There are questions over what it should do if you don't have write permissions to all the directories it wants to change (there are system config locations, so that will be common if you run it as a regular user). Should it always error out in that case, or only if it would change a non-writable file? Should it fail quickly, or make any changes it can before throwing an error? |
I don't think setting sys_prefix and user both to True will do the right thing, because only one is triggered in the end, unless something changed. I thought this would through a mutually-exclusive flag error. I think you'll need to handle
Option 1. seems like the more logical behavior, to me. It has the potential disadvantage (like pip) that you have to re-run it until it shows nothing installed to be sure that it's truly gone if you have something enabled/installed at multiple levels. But it has the advantage that it only does one action. Option 2. might better address the specific use case @ellisonbg brings up in #2149, where the real goal is "scrub every trace of this and start from scratch". However, 'disable' is not quite the right action for that use case, because This ambiguity doesn't affect It seems like what would be really nice is if uninstalling an extension also removed enabling configuration, but that's getting pretty complicated. Per @takluyver's comment about errors, I think it should raise any PermissionErrors it encounters. |
Thanks @takluyver! I'm going to close this one... |
@takluyver @minrk I'm not sure whether this is the right approach... As opposed to "check every level where the enable config is defined", this is just adding an "all" trait to the top-level class and some logic to the
start
method that will setuser
andsys_prefix
toTrue
if the all flag is enabled. This requires all subclass instances to callsuper(CommandInstance, self).start()
.Closes #2149