bazel run adds $PYTHONPATH to paths while bazel test does not #2867
Labels
P3
We're not considering working on this, but happy to review a PR. (No assignee)
stale
Issues or PRs that are stale (no activity for 30 days)
team-Rules-Python
Native rules for Python
type: bug
echo $PYTHONPATH
-> /usr/lib/spark/python:/usr/lib/spark/python/build:/usr/lib/spark/python/lib/py4j-0.10.4-src.zip
bazel test --spawn_strategy=standalone --test_output=errors --force_python=PY3 --host_force_python=PY3 //src/model:utils_test
-> print(sys.path) yields
['/home/ubuntu/mono/src/model', '/home/ubuntu/.cache/bazel/_bazel_ubuntu/a668d06d6b766d20e5a2cc9d6a3f6fb6/execroot/mono/bazel-out/local-py3-fastbuild/bin/src/model/utils_test.runfiles', '/home/ubuntu/.cache/bazel/_bazel_ubuntu/a668d06d6b766d20e5a2cc9d6a3f6fb6/execroot/mono/bazel-out/local-py3-fastbuild/bin/src/model/utils_test.runfiles/pavlov', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/usr/lib/python3.5/lib-dynload', '/usr/local/lib/python3.5/dist-packages', '/usr/local/lib/python3.5/dist-packages/setuptools-33.1.1-py3.5.egg', '/usr/lib/python3/dist-packages']
bazel run --spawn_strategy=standalone --test_output=errors --force_python=PY3 --host_force_python=PY3 //src/model:utils_test
-> print(sys.path) yields
['/home/ubuntu/mono/src/model', '/home/ubuntu/.cache/bazel/_bazel_ubuntu/a668d06d6b766d20e5a2cc9d6a3f6fb6/execroot/mono/bazel-out/local-py3-fastbuild/bin/src/model/utils_test.runfiles', '/home/ubuntu/.cache/bazel/_bazel_ubuntu/a668d06d6b766d20e5a2cc9d6a3f6fb6/execroot/mono/bazel-out/local-py3-fastbuild/bin/src/model/utils_test.runfiles/pavlov', '/usr/lib/spark/python', '/usr/lib/spark/python/build', '/usr/lib/spark/python/lib/py4j-0.10.4-src.zip', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/usr/lib/python3.5/lib-dynload', '/usr/local/lib/python3.5/dist-packages', '/usr/local/lib/python3.5/dist-packages/setuptools-33.1.1-py3.5.egg', '/usr/lib/python3/dist-packages']
#753 seemed to imply that running tests in standalone should allow pythonpath to filter through but this doesn't seem to be the case.
Environment info
Operating System:
ubuntu 14.04
Bazel version (output of
bazel info release
):release 0.4.5
The text was updated successfully, but these errors were encountered: