high-yak-85899
02/20/2023, 5:05 AMpython -m <some things it expects to be on path>. When the test is executing, which python just points to the system install at /usr/bin/python.enough-analyst-54434
02/20/2023, 5:14 AMhigh-yak-85899
02/20/2023, 5:15 AMsubprocess.check_output(['which', 'python']) it points back to systemenough-analyst-54434
02/20/2023, 5:17 AMPATH adjustment, that's one thing. Your example claimed sys.path was the issue (-m ...)enough-analyst-54434
02/20/2023, 5:17 AMsys.executable -m ... should work fine.high-yak-85899
02/20/2023, 5:18 AMPYTHONPATH games to get things happy currently.enough-analyst-54434
02/20/2023, 5:18 AMPATH adjustment, this would need to be `--venv prepend`: https://github.com/pantsbuild/pants/blob/3e62816f6e2bbe180962d855438ad6fcddb669fa/src/python/pants/backend/python/util_rules/pex.py#L888enough-analyst-54434
02/20/2023, 5:21 AMpython=sys.executable ? The script you point to succumbs to that.enough-analyst-54434
02/20/2023, 5:22 AMhigh-yak-85899
02/20/2023, 5:24 AMenough-analyst-54434
02/20/2023, 5:25 AMhigh-yak-85899
02/20/2023, 5:32 AMhigh-yak-85899
02/20/2023, 5:34 AMenough-analyst-54434
02/20/2023, 5:41 AM--venv prepend thing. I think that could be a safe, global, change to all Pants VenvPex setups; so might be worth bugging & fixing.enough-analyst-54434
02/20/2023, 5:42 AMhigh-yak-85899
02/20/2023, 5:45 AMpython envvar didn't work, but setting PYTHONPATH to where my source code and deps are did. So basically copying what they do in https://github.com/apache/flink/blob/af681c63821c027bc7a233560f7765b686d0d244/flink-python/pyflink/bin/pyflink-udf-runner.sh#L28happy-kitchen-89482
02/20/2023, 2:24 PM--keep-sandboxes=always which lets you play in the sandbox the test ran in