I'm trying to combine the run-in-repo aspect of `r...
# plugins
b
I'm trying to combine the run-in-repo aspect of
run_pex_binary
with the
_runner
aspect of
pytest
in my plugin (so essentially "run this PEX in an environment containing the user's reqs, but in-repo") I'm using
pex_path
on the
_runner
PEX and setting it to
[my_tool.pex, requirements.pex]
, but when the pex is executed I'm getting
FileNotFoundError: [Errno 2] No such file or directory: 'my_tool.pex/PEX-INFO'
. I assume this is due to not executing with cwd being the sandbox. How can I help PEX here?
✅ 1
Ahh looking at the
repl
goal for
ipython
is a golden template
c
golden
😵 1
b
Although, I'm running into https://github.com/jupyter/notebook/issues/2636 😕
c
Oohh… that was a rather old issue.
b
I'm guessing some kind of
VenvPex
might solve it, but I'm no PEX wizard 😕
c
me either 😦
b
Changing my notebook pex to
VenvPex
fails with
/home/joshuacannon/work/techlabs/.pants.d/tmp7nklehrd/./.cache/pex_root/venvs/6be5332cff30d122c4ff9b149062819751a8ade8/ddab8011daaee380698ac2fb9701af18c90c03f6/pex: No such file or directory
However running the shim myself works 🤔 I think we're close
Instead of using
VenvPex
I'm passing
--venv prepend
as additional argvs and it works
"it works"... well
no module named modulename
. At least the kernel works 😛
😅 1
Yeah looks like the notebook kernel unconditionally changes CWD to be the same dir as the notebook, so it doesn't respect my CWD or my sys path containing my local source roots either 😠 )
AHA! Pex is setting
sys.path
, but Jupyter launches the server by looking at
PYTHONPATH
and not
sys,path
it seems