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

[WIP] add kernelspec directory to PATH when starting kernels #233

Closed
wants to merge 1 commit into from

Conversation

minrk
Copy link
Member

@minrk minrk commented Feb 1, 2017

  • verify that pip rewrites shebang lines in data_files, otherwise this is pretty pointless it doesn't
  • test

allows kernel command to be a script in the spec dir, which should in turn allow shebang in the script to set executable, enabling kernelspecs in Python wheels, so that pip installs can behave the same as conda installs.

This should allow us to install the IPython kernelspec on pip install, making it much harder to have ipykernel installed without the IPython kernelspec present (largely eliminating any use of the NATIVE_KERNEL).

relevant to jupyter/echo_kernel#3

allows kernel command to be a script in the spec dir

which should in turn allow shebang in the script
to set executable, enabling kernelspecs in wheels
@blink1073
Copy link
Contributor

Nice! 🤞

@minrk
Copy link
Member Author

minrk commented Feb 1, 2017

Turns out pip doesn't touch shebang in data_files, so I'd need another solution. Ideally one that's not "use conda instead" which is where I am right now.

@blink1073
Copy link
Contributor

As in, it doesn't modifying the existing shebang line to point to the correct path?

@minrk
Copy link
Member Author

minrk commented Feb 1, 2017

Right. Pip does one tiny thing at install time: set the shebang line in scripts to point to the installing executable, so #!/usr/bin/env python becomes #!/path/to/env/bin/python. I was hoping to piggy-back on that by putting a script in data_files. Apparently it only does this for items identified in the metadata as scripts specifically, not any data file that happens to be a script (what I was hoping for). That's what we need for wheels to include kernelspecs: something that will be hardcoded to sys.executable at install time.

I suppose for the in-wheel case, we can rely on the env being active and use python as the executable.

@minrk
Copy link
Member Author

minrk commented Feb 1, 2017

ipython/ipykernel#223 installs the IPython kernelspec with ipykernel, using python for the executable, instead of absolute path.

@minrk minrk closed this Feb 7, 2017
@minrk
Copy link
Member Author

minrk commented Feb 7, 2017

Closing because this doesn't solve the problem I thought it did.

@minrk minrk modified the milestone: no action Feb 7, 2017
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.

2 participants