I plan to deploy in a virtualenv within a docker container and it's a pain to not be able to do a bazel test ... before deployment.
Is there any way to make the bazel test command respect virtualenvs? Right now, if I'm in a virtualenv, I can make a test can pass when I use bazel run, but fail when I run bazel test.
I plan to deploy in a virtualenv within a docker container and it's a pain to not be able to do a bazel test ... before deployment.
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/57dab8c6-d8fd-4668-8409-424b77d46bf5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
blah.py:
"
import yamlbro
"
py_test.py:
"
import unittest
import blah
class TestStringMethods(unittest.TestCase):
def test_blah(self):
pass
if __name__ == '__main__':
unittest.main()
"
BUILD:
"
py_library(
name = "blah",
srcs = [
"blah.py",
],
)
py_test(
name = "py_test",
srcs = [
"py_test.py",
],
deps = [
":blah",
],
)
"
I activate a virtualenv that has yamlbro installed, but my normal python installation does not have it.
bazel run :py_test succeeds.
bazel test :py_test fails with:
"ImportError: No module named yamlbro"
My guess is that whatever config virtualenv does is not making it's way to bazel test.
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/f83105d4-e110-4fe8-b8c3-1ea410d05b33%40googlegroups.com.
However, that didn't fix the problem. I got the exact same test failure as before.
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/691f7abd-0c7f-4229-85b2-83ddde952ed7%40googlegroups.com.
On Wednesday, September 7, 2016 at 7:14:11 AM UTC-7, Kristina Chodorow wrote:
> It looks like you also have to set --spawn_strategy=standalone:
>
>
> bazel test --spawn_strategy=standalone --test_strategy=standalone //your-tests
>
>
> On Tue, Sep 6, 2016 at 8:25 PM, <tweet...@gmail.com> wrote:
> Thanks for the response. I tried the quick and dirty way. I ran the following command:
>
> "bazel test --test_strategy=standalone py_test"
>
>
>
> However, that didn't fix the problem. I got the exact same test failure as before.
>
>
>
> --
>
> You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
>
> To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
>
> To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/691f7abd-0c7f-4229-85b2-83ddde952ed7%40googlegroups.com.
>
>
>
> For more options, visit https://groups.google.com/d/optout.
Thanks a lot, that worked.
I might be worth putting that in documentation somewhere. I imagine my use case will be pretty common. It's infeasible (except for large development teams) to build everything you need from PyPi from scratch in Bazel.
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/a4d5f39b-66ec-4e75-9800-8f4661c378fc%40googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "bazel-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bazel-discuss/oRDudISQXjQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/ea86a59a-2326-47c4-93f8-8f2a63463cf3%40googlegroups.com.