-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Remove configurability of config_dir in nbconfig #893
Comments
The recent change did not change the configurable status of the config manager... |
Can you look at my PR - the entire API of that class has changed in my PR. On Tue, Dec 22, 2015 at 11:26 AM, Damián Avila notifications@github.com
Brian E. Granger |
I will take a look in the next few hours... |
Here you are removing the |
IIRC, I changed the base class of the manager though. I am no longer using On Tue, Dec 22, 2015 at 12:39 PM, Damián Avila notifications@github.com
Brian E. Granger |
I might be missing something, but I tend to side with @damianavila on this one. |
@damianavila |
though, jupyter#893 argues that we might need it and that it will be complex to reintroduce it. This use a convoluted way to : - warn that this kwarg might not be given to config managers in future version - but do not warn on default installs with default config. - warn that the keyword is ignored when people use subclasses of out config manager, and pass the keyword to super(). Thus this actually advertise that the keyword **might** be removed, by still allowing us to keep it if in the end it appears that we need it. Should help with jupyter#893 without un-fixing jupyter#882.
though, jupyter#893 argues that we might need it and that it will be complex to reintroduce it. This use a convoluted way to : - warn that this kwarg might not be given to config managers in future version - but do not warn on default installs with default config. - warn that the keyword is ignored when people use subclasses of out config manager, and pass the keyword to super(). Thus this actually advertise that the keyword **might** be removed, by still allowing us to keep it if in the end it appears that we need it. Should help with jupyter#893 without un-fixing jupyter#882.
though, jupyter#893 argues that we might need it and that it will be complex to reintroduce it. This use a convoluted way to : - warn that this kwarg might not be given to config managers in future version - but do not warn on default installs with default config. - warn that the keyword is ignored when people use subclasses of out config manager, and pass the keyword to super(). Thus this actually advertise that the keyword **might** be removed, by still allowing us to keep it if in the end it appears that we need it. Should help with jupyter#893 without un-fixing jupyter#882.
Pr jupyter#882 removed `config_dir` kwarg as it was ignored. though, jupyter#893 argues that we might need it and that it will be complex to reintroduce it. This use a convoluted way to : - warn that this kwarg might not be given to config managers in future version - but do not warn on default installs with default config. - warn that the keyword is ignored when people use subclasses of out config manager, and pass the keyword to super(). Thus this actually advertise that the keyword **might** be removed, by still allowing us to keep it if in the end it appears that we need it. Should help with jupyter#893 without un-fixing jupyter#882.
@Carreau, passing Or are you proposing to remove $ git diff
diff --git a/notebook/services/config/manager.py b/notebook/services/config/manager.py
index 2399f86..7ccd623 100644
--- a/notebook/services/config/manager.py
+++ b/notebook/services/config/manager.py
@@ -7,11 +7,9 @@ import os.path
from traitlets.config.manager import BaseJSONConfigManager
from jupyter_core.paths import jupyter_config_dir
-from traitlets import Unicode
class ConfigManager(BaseJSONConfigManager):
"""Config Manager used for storing notebook frontend config"""
- config_dir = Unicode(config=True)
- def _config_dir_default(self):
- return os.path.join(jupyter_config_dir(), 'nbconfig')
+ config_dir = os.path.join(jupyter_config_dir(), 'nbconfig') If that's the case, we can probably live with it 😉 |
Then I think I'm confused of what Brian ask to revert, and what he is asking to re-add for 4.1. I'm wondering what would be a good compromise for 4.1 that would allow Brian to do his work without being impaired and not risking API breakage. |
I think I am in the same position, I don't get where is the issue... despite the fact that before my PR the
Not sure if I am completely understanding Brian, but I guess the diff posted above is a good compromise IF I understood him well... |
Let me have a look... Sent from my iPhone
|
OK, here is a summary of the past and current state: In 4.0:
In 4.1 master:
My proposal for 4.2:
My conclusion:
Summary: a bug in 4.0 essentially hides an API from users/devs in a way that allows me to change it without breaking backwards compatibility. The bug fix in 4.1 will make my 4.2 proposal backwards incompatible. But, I don't think anyone is using any of this stuff other than @damianavila et al. So if he is fine moving forward with the current state of 4.1 and is fine with my proposal for 4.2 that will break his 4.1 stuff, then I am OK. My main concern here is that I don't want us to be prevented from improving the nbextension situation for users in 4.2, just because of an obscure, unused API. |
Would you prefer to revert the configurability fix, if I show a workaround that will work on 4.0? import os
from traitlets import Unicode
from jupyter_core.paths import jupyter_config_dir
from notebook.services.config import ConfigManager
class MyConfigManager(ConfigManager):
custom_config_dir = Unicode(config=True)
def _custom_config_dir_default(self):
return os.path.join(jupyter_config_dir(), 'nbconfig')
@property
def config_dir(self):
# config_dir is a read-only alias to custom_config_dir
return self.custom_config_dir
@config_dir.setter
def config_dir(self, value):
# ignore attempts to set config_dir
pass
c.MyConfigManager.custom_config_dir = '/tmp/custom'
c.NotebookApp.config_manager_class = MyConfigManager This way a |
If that's the way we want to go, #905 restores the hardcoded value. |
Actually @damianavila I have a question. What are you trying to do in your custom The reason I say that is this - if you are going to ship a custom If, on the other hand, you are going to ship a custom These issues are much more important to me than the particular details of the changes we are discussing making to 4.1. |
@minrk thanks for the workaround... in fact, I workaround the issue in another way just setting the @ellisonbg, that's the whole point of the discussion, we are trying to install the extension inside
As I mentioned before, the implementation is a little bit different because we copy the content of the config files at the user space and add those to the config inside the env... so, in this way, we are not modifying the user space from inside the env (because that would break the env isolation and play dirty with something that only the user should modify - and not a package manager)... finally, we point to the env's config dir to start the notebook... |
@damianavila I want to understand this. Are you actively migrating user config to the sys.prefix config in the conda env? The problem with that is that the builtin jupyter CLI tools ( Why not just use the |
Yes.
We started to work on this several weeks/months ago and we developed some other tools to potentially solve this issue because the
Now, this is an option! Because we had several discussion and some consensus and your PR is now out there... From an historical perspective, so you can understand how this evolved, we put in place a machinery for some internal work when the discussion and consensus did not even birth yet... and we solved some issues on the road with custom developments.
That's interesting and it is in my todo list to do it if I am not redirected to other efforts inside the company 😉 |
Hi all. It is extremely important to not release 4.1 with the recent change to the
config_dir
attribute of the nbconfig manager. That change makes the work I am doing for 4.2 on nbextensions backwards incompatible, so we couldn't release it until 5.0. We should just revert it for 4.1.The text was updated successfully, but these errors were encountered: