1load("@pip_installed//:requirements.bzl", "requirement") 2load("@rules_python//python:defs.bzl", "py_test") 3load("@rules_python//python:pip.bzl", "compile_pip_requirements") 4 5exports_files( 6 glob(["data/**"]), 7 visibility = ["//visibility:public"], 8) 9 10# This rule adds a convenient way to update the requirements file. 11compile_pip_requirements( 12 name = "requirements", 13 extra_args = ["--allow-unsafe"], 14) 15 16py_test( 17 name = "pip_parse_annotations_test", 18 srcs = ["pip_repository_annotations_test.py"], 19 env = { 20 "REQUESTS_PKG_DIR": "pip_parsed_requests", 21 "WHEEL_PKG_DIR": "pip_parsed_wheel", 22 }, 23 main = "pip_repository_annotations_test.py", 24 deps = [ 25 "@pip_parsed_requests//:pkg", 26 "@pip_parsed_wheel//:pkg", 27 "@rules_python//python/runfiles", 28 ], 29) 30 31py_test( 32 name = "pip_install_annotations_test", 33 srcs = ["pip_repository_annotations_test.py"], 34 env = { 35 "REQUESTS_PKG_DIR": "pip_installed_requests", 36 "WHEEL_PKG_DIR": "pip_installed_wheel", 37 }, 38 main = "pip_repository_annotations_test.py", 39 deps = [ 40 requirement("wheel"), 41 requirement("requests"), 42 "@rules_python//python/runfiles", 43 ], 44) 45