new_http_archive 규칙을 사용하여 요청을 가져 오려고하면 "ImportError : No named named requests"오류가 발생합니다.bazel으로 python 요청 가져 오기 new_http_archive 규칙
WORKSPACE :
new_http_archive(
name = "requests",
urls = ["https://github.com/requests/requests/tarball/master/requests-requests-v2.18.4-90-g81b6341.tar.gz"],
build_file_content = """
py_library(
name = "srcs",
srcs = glob(["requests/*.py"]),
visibility = ["//visibility:public"]
)"""
)
BUILD :
py_library(
name = "foo",
deps = ["@requests//:srcs"],
srcs = glob(["foo.py",]),
)
py_test(
name = "foo_test",
srcs = glob(["foo_test.py",]),
deps = glob([":foo",]),
)
내가 사용하는 경우
'SRCS = 글로브 ([ "*"])'는 new_http_archive 규칙에, 나는 모든 종류의 오류를 얻을 수없는 약 .py 파일 (어떤 의미가 - 요청 리포 지 토리에있는 모든 종류의 파일이 있습니다)내 질문은 어떻게 작동 요청 라이브러리를 줄 것이라고 그런 식으로 build_file_content를 지정하는 것입니다? (이 시점에서 올바른 URL을 사용하고 있고 build_file_content에 올바른 규칙이 있는지 확실하지 않습니다.) Bazel을 사용하여 Python 코드를 실행하고 Bazel에서 요청 라이브러리를 제공하도록 관리하고 싶습니다.