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

merge nbserver_extensions #2108

Merged
merged 5 commits into from Feb 2, 2017

Conversation

4 participants
@minrk
Member

minrk commented Feb 1, 2017

  • test
  • handle config_file_name and config_dir Application settings

Load with ConfigManager so that merge happens recursively, unlike normal config values.

Makes loading more consistent with frontend extensions, which is good.

It is a bit icky because the same files are loaded and read twice, and one key in a traitlets-defined config file is loaded differently than all others.

This does behave more like we intend and people expect for extensions, though.

closes #2063

Merge nbserver_extensions
Load with ConfigManager so that merge happens recursively,
unlike normal config values.

Makes loading more consistent with frontend extensions,
but is a bit icky because the same files are loaded and read twice,
and one key in a traitlets-defined config file is loaded differently than all others.

This does behave more like we intend and people expect for extensions, though.

minrk added some commits Feb 1, 2017

test merging serverextensions from sys and user config
and refactor mock test environment a bit

ensures no system config files loaded or affected
remove unused code in nbextensions
- unused imports
- call jupyter_path instead of reimplementing it

@minrk minrk added this to the 5.0 milestone Feb 1, 2017

@minrk minrk changed the title from Merge nbserver_extensions to [wip] merge nbserver_extensions Feb 1, 2017

@minrk minrk changed the title from [wip] merge nbserver_extensions to merge nbserver_extensions Feb 1, 2017

@Carreau

This comment has been minimized.

Show comment
Hide comment
@Carreau

Carreau Feb 2, 2017

Member

Thanks Steve !

Member

Carreau commented Feb 2, 2017

Thanks Steve !

@Carreau Carreau merged commit 90d30d2 into jupyter:master Feb 2, 2017

4 checks passed

codecov/patch 98.61% of diff hit (target 0%)
Details
codecov/project 76.96% (+0.17%) compared to ad805b1
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@gnestor gnestor added this to Merged PRs in 5.0 Feb 4, 2017

@minrk minrk deleted the minrk:merge-server-extensions branch Feb 6, 2017

@Madhu94

This comment has been minimized.

Show comment
Hide comment
@Madhu94

Madhu94 Oct 27, 2017

Contributor

@minrk @Carreau @blink1073 This was supposed to merge nbserver_extensions for jupyter_notebook_config.py files as well, not just jupyter_notebook_config.json files ?

Contributor

Madhu94 commented Oct 27, 2017

@minrk @Carreau @blink1073 This was supposed to merge nbserver_extensions for jupyter_notebook_config.py files as well, not just jupyter_notebook_config.json files ?

@blink1073

This comment has been minimized.

Show comment
Hide comment
@blink1073

blink1073 Oct 27, 2017

Member

Looking down the rabbit hole it looks like it only applies to .json files.

Member

blink1073 commented Oct 27, 2017

Looking down the rabbit hole it looks like it only applies to .json files.

@Madhu94

This comment has been minimized.

Show comment
Hide comment
@Madhu94

Madhu94 Oct 27, 2017

Contributor

Thanks @blink1073! Was that done on purpose ? Any reason the notebook doesn't do the merge for nbserver_extensions in .py files ?

Contributor

Madhu94 commented Oct 27, 2017

Thanks @blink1073! Was that done on purpose ? Any reason the notebook doesn't do the merge for nbserver_extensions in .py files ?

@blink1073

This comment has been minimized.

Show comment
Hide comment
@blink1073

blink1073 Oct 27, 2017

Member

I'm not sure if that was a conscious decision historically or not, @minrk would be the best person to know for sure.

Member

blink1073 commented Oct 27, 2017

I'm not sure if that was a conscious decision historically or not, @minrk would be the best person to know for sure.

@minrk

This comment has been minimized.

Show comment
Hide comment
@minrk

minrk Oct 30, 2017

Member

jupyter nbextension enable/disable always happens in .json files, so that's the mechanism by which this is generally happening. Including .py files would further complicate this already complicated band-aid. My answer would be that nbextension config shouldn't ever occur in .py config files because of this special handling.

.py config files also already have a clearer, explicit merge mechanism, so shouldn't have to get mixed up in this:

c.Class.trait.update({'x': 5}) # update existing config, if any
# vs
c.Class.trait = {'x': 5} # override
Member

minrk commented Oct 30, 2017

jupyter nbextension enable/disable always happens in .json files, so that's the mechanism by which this is generally happening. Including .py files would further complicate this already complicated band-aid. My answer would be that nbextension config shouldn't ever occur in .py config files because of this special handling.

.py config files also already have a clearer, explicit merge mechanism, so shouldn't have to get mixed up in this:

c.Class.trait.update({'x': 5}) # update existing config, if any
# vs
c.Class.trait = {'x': 5} # override
@Madhu94

This comment has been minimized.

Show comment
Hide comment
@Madhu94

Madhu94 Nov 6, 2017

Contributor

Thanks @minrk

Contributor

Madhu94 commented Nov 6, 2017

Thanks @minrk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment