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

use dynamic default to delay import of jupyter_client optional dependency #559

Merged
merged 2 commits into from Mar 27, 2017

Conversation

Projects
None yet
3 participants
@minrk
Copy link
Member

minrk commented Mar 27, 2017

using a string as a static default doesn't defer import (which is not obvious).

closes #556

minrk added some commits Mar 27, 2017

use dynamic default to delay import of jupyter_client optional depend…
…ency

using a string as a static default doesn't defer import

@minrk minrk added this to the 5.2 milestone Mar 27, 2017

@minrk

This comment has been minimized.

Copy link
Member Author

minrk commented Mar 27, 2017

#499 didn't actually fix #495 because types declared in trait constructors are resolved at instantiation time. This surprises me, and I don't think it's always been the case, but using a dynamic default actually does resolve only when the value is requested.

@mpacer

This comment has been minimized.

Copy link
Member

mpacer commented Mar 27, 2017

Looks good to me.

@mpacer mpacer merged commit d630531 into jupyter:master Mar 27, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@damianavila

This comment has been minimized.

Copy link
Member

damianavila commented Mar 28, 2017

#499 didn't actually fix #495 because types declared in trait constructors are resolved at instantiation time. This surprises me, and I don't think it's always been the case, but using a dynamic default actually does resolve only when the value is requested.

Thanks for the explanation. Looks good to me as well and tested successfully.

@minrk minrk deleted the minrk:lazy-import branch Mar 28, 2017

takluyver added a commit to takluyver/bookbook that referenced this pull request Apr 25, 2017

Workaround extra dependency for tests
Won't be needed with nbconvert >= 5.2
jupyter/nbconvert#559

@mpacer mpacer added to_changelog and removed to_changelog labels May 24, 2017

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