-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
WORKSPACE stuff:
pip_repository(
name = "requirements_py3",
python_interpreter = "python3",
requirements = "//lib/kubernetes:requirements.lock.txt",
)
I have this defined in my BUILD:
# Image for the API
py3_image(
name = "api_docker",
srcs = [":api"],
base = ":python3.7_image",
main = "main.py",
visibility = ["//visibility:public"],
)
py_binary(
name = "api",
srcs = glob(
["*.py"],
),
main = "main.py",
python_version = "PY3",
srcs_version = "PY3",
deps = [
"//lib/kubernetes:kubernetes_util",
"@requirements_py3//docopt",
"@requirements_py3//dulwich",
"@requirements_py3//flask",
"@requirements_py3//gevent",
"@requirements_py3//prometheus_client",
],
)
The first thing in main.py is
from gevent import monkey
monkey.patch_all()
When I try to bazel run
the docker image, I get this:
Traceback (most recent call last):
File "/app/apps/switchboard/api/api_docker.binary.runfiles/com_something/apps/switchboard/api/main.py", line 10, in <module>
from gevent import monkey
ImportError: cannot import name 'monkey' from 'gevent' (/app/apps/switchboard/api/api_docker.binary.runfiles/requirements_py3/gevent/__init__.py)
The application works as expected when running the py_binary with bazel run
Any known issues regarding using a container with pip_repository?
Metadata
Metadata
Assignees
Labels
No labels