Skip to content
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

pass profile-dir instead of profile name to Kernel #4098

Merged
merged 3 commits into from
Aug 29, 2013

Conversation

minrk
Copy link
Member

@minrk minrk commented Aug 23, 2013

avoids relative path issues for local profiles when the notebook server starts in a different directory from the kernels.

moves the profile-dir alias from the parallel apps up to the base IPython app

Candidate for backport to 1.1

allows specifying exact path to profile directory,
rather than just the name.
store a copy so it can't be manipulated
avoids relative path issues for local profiles
when the notebook server starts in a different directory
from the kernels.
# Kernel should inherit default config file from frontend
self.kernel_argv.append("--IPKernelApp.parent_appname='%s'" % self.name)
# Kernel should get *absolute* path to profile directory
self.kernel_argv.extend(["--profile-dir", self.profile_dir.location])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you like to use --ProfileDir.location explicitely ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The advantage of --profile-dir the alias over --ProfileDir.location is that the Class.trait approach must be merged into a single string, whereas --profile-dir and path can be separate items in the list. So there's a smaller chance of escape issues.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fine with me then.

@Carreau
Copy link
Member

Carreau commented Aug 23, 2013

+1 should I test on euroscipy profile ? Trust you ?
Do you think we shoudl write test for that ?

@minrk
Copy link
Member Author

minrk commented Aug 23, 2013

Go ahead and test it there - I think I have, but who knows what is unique about my environment.

@takluyver
Copy link
Member

👍 Have you done all the testing that you want on this?

@minrk
Copy link
Member Author

minrk commented Aug 27, 2013

Let me play with it a little more after I get in to the office today, but I think this is fine.

@takluyver
Copy link
Member

Did you get time to play with it some more?

@minrk
Copy link
Member Author

minrk commented Aug 29, 2013

Yes, I tested it in the use case that it is meant to fix:

  1. ipython profile create --profile-dir=./profile_test
  2. edit notebook_config to have notebook_dir point somewhere else
  3. ipython notebook --profile test

Which should result in both the notebook server and the kernel finding the profile directory in the notebook server's cwd, which is not the kernel's cwd.

@takluyver
Copy link
Member

OK, merging and backporting.

takluyver added a commit that referenced this pull request Aug 29, 2013
avoids relative path issues for local profiles when the notebook server starts in a different directory from the kernels.

moves the `profile-dir` alias from the parallel apps up to the base IPython app

Candidate for backport to 1.1
takluyver added a commit that referenced this pull request Aug 29, 2013
pass profile-dir instead of profile name to Kernel
@takluyver takluyver merged commit bc2595e into ipython:master Aug 29, 2013
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
pass profile-dir instead of profile name to Kernel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants