Happy to announce that our Jupyter Notebook plugin...
# plugins
j
Happy to announce that our Jupyter Notebook plugin is now working! * launches a jupyter notebook app (older version as of today) * adds targets to the
PYTHONPATH
for the app * automatically picks the appropriate python interpreter * sets the dashboard homepage to the top of the repo Next improvement: allow for different Jupyter Notebook versions depending on if PY2 or PY3 was chosen. https://gist.github.com/rcuza/bbcf8f5a13964db7760ff376649c1a44 Big thank you to @hundreds-father-404 and everyone else who helped out.
❤️ 3
🔥 1
🎉 3
📔 1
h
Yay!! Raúl and I were talking about how much we’d love to upstream Jupyter to core Pants. I think the only blocker to upstreaming will be getting this to work with the most recent Jupyter version
two small things I notice, btw: * line 176 is no-oping.
PurePath(my_str)
creates a
PurePath
object, then
.as_posix()
converts it back to a string. You can delete that line and use
":".join(sources.source_roots)
on 179 * For
hermetic_env=False
, I’m curious what env vars need to be set for things to work. Would you be willing to share the result of running
env
in your terminal either here or in DM?
j
I did the
PurePath
when I thought I would need be adding a full path instead of a relative path. It also ensures that the string is in the right format. Since we are getting the input from another pants source and not users, I assume it is safe to just treat it as a string. Thank you for catching that.
👍 1
I just tested
hermetic_env=True
and it works fine. I think I did this when I was thinking I would need to pass
JUPYTER_...
env to the running process. At this point I don't think this is needed. Also, I think there is a way to configure environment variables that get passed through the hermetic seal which is a better way to go.
💯 1
h
I think you might be calling
":".join()
one too many times on the source roots
Also, you can delete lines 53-57. Those never get used
j
Thank you! Good catch.