jolly-midnight-72759
10/22/2020, 8:06 PMpants jupyter
be the same as pants --no-pantsd jupyter
?hundreds-father-404
10/22/2020, 8:08 PM--pantsd
is a global option that gets set before any goals are even considered
Is jupyter having the same issue as ipython that it doesn’t work with pantsd?jolly-midnight-72759
10/22/2020, 8:11 PMhundreds-father-404
10/22/2020, 8:15 PMhundreds-breakfast-49010
10/22/2020, 8:21 PMjupyter
in a publicly-readable form? I'm interested in seeing exactly how you're running jupyter
right nowjolly-midnight-72759
10/22/2020, 8:29 PMhundreds-breakfast-49010
10/22/2020, 8:32 PMjolly-midnight-72759
10/23/2020, 1:54 AMhundreds-breakfast-49010
10/23/2020, 2:05 AMjolly-midnight-72759
10/23/2020, 2:08 AMhundreds-breakfast-49010
10/23/2020, 2:09 AMjolly-midnight-72759
10/23/2020, 2:29 AMsubprocess.Popen
to launch the app and each kernel separately. Works great in a venv but I don't know how to get it working with pex's.hundreds-breakfast-49010
10/24/2020, 12:13 AMjupyter_stubber
entry point code is meant to work? it looks like "jupyter_stubber" might be one of your org's custom packages?hundreds-breakfast-49010
10/24/2020, 12:14 AMhundreds-father-404
10/24/2020, 12:19 AMjupyter_stubber_run
hundreds-breakfast-49010
10/24/2020, 12:42 AMhundreds-breakfast-49010
10/24/2020, 12:42 AMjolly-midnight-72759
10/24/2020, 1:16 AMgoal.py?
jolly-midnight-72759
10/24/2020, 1:45 AM--no-pantsd
, then the Jupyter app will catch the first ctrl-c similar to when run in a venv.hundreds-breakfast-49010
10/24/2020, 5:08 AMLAUNCHER_FILE
construct we use in https://github.com/pantsbuild/pants/blob/master/src/python/pants/backend/python/typecheck/mypy/rules.py#L166 based on eric's earlier suggestionjolly-midnight-72759
10/24/2020, 7:37 PMLAUNCHER_FILE
better than the stubber solution. I got it working on my repo, too.jolly-midnight-72759
10/24/2020, 7:40 PMimport
and use any python code in the target's sources along with its dependencies. So if I run pants jupyter project/src/python/helloworld
, I can do import helloworld
in a Jupyter Notebook.
Do I have to package the target and then add it to the requirements?jolly-midnight-72759
10/24/2020, 7:53 PMhundreds-breakfast-49010
10/24/2020, 9:30 PMmerged_digest
from merging the digest of the Pex
containing the jupyter executable, and the digest of all the source files associated with the targets passed into the jupyter
goalhundreds-breakfast-49010
10/24/2020, 9:30 PMmerged_digest
to InteractiveProcessRunner
hundreds-breakfast-49010
10/24/2020, 9:31 PMjupyter-py3.pex
in it, and then a tree representing the subset of the source code specified by the targets and their dependencieshundreds-breakfast-49010
10/24/2020, 9:31 PMhundreds-breakfast-49010
10/24/2020, 9:33 PMPYTHONPATH
is already set within the jupyter environment, I think based on the LAUNCHER_FILE
code that uses sys.path
. but sys.path
was already initialized by whatever the PYTHONPATH
would've been when the pex started runninghundreds-breakfast-49010
10/24/2020, 9:36 PMos.environ["PYTHONPATH"] = ":".join(sys.path)
line is doinghundreds-breakfast-49010
10/24/2020, 9:38 PMhundreds-breakfast-49010
10/24/2020, 9:39 PMPYTHONPATH
are necessary to get the right import behavior when running a notebook under jupyter could be done here in this script, but I haven't tried this myself yetjolly-midnight-72759
10/24/2020, 10:09 PMsys
stuff is copies for the stubber that was needed for v1. Maybe it isn’t needed in v2. See the note in the code explaining why we did it that way.jolly-midnight-72759
10/24/2020, 10:10 PMPYTHONPATH
.) when I’m at my keyboard next, I’ll see if the jupyter kernel starts without it.jolly-midnight-72759
10/25/2020, 1:15 AM