1load("@pip_installed//:requirements.bzl", installed_entry_point = "entry_point") 2load("@pip_parsed//:requirements.bzl", parsed_entry_point = "entry_point") 3load("@rules_python//python:defs.bzl", "py_test") 4load("@rules_python//python:pip.bzl", "compile_pip_requirements") 5 6# This rule adds a convenient way to update the requirements file. 7compile_pip_requirements( 8 name = "requirements", 9 extra_args = ["--allow-unsafe"], 10 requirements_windows = ":requirements_windows.txt", 11) 12 13pip_parsed_sphinx = parsed_entry_point( 14 pkg = "sphinx", 15 script = "sphinx-build", 16) 17 18pip_parsed_yamllint = parsed_entry_point("yamllint") 19 20py_test( 21 name = "pip_parse_entry_points_test", 22 srcs = ["pip_repository_entry_points_test.py"], 23 data = [ 24 pip_parsed_sphinx, 25 pip_parsed_yamllint, 26 ], 27 env = { 28 "SPHINX_BUILD_ENTRY_POINT": "$(rootpath {})".format(pip_parsed_sphinx), 29 "YAMLLINT_ENTRY_POINT": "$(rootpath {})".format(pip_parsed_yamllint), 30 }, 31 main = "pip_repository_entry_points_test.py", 32 deps = ["@rules_python//python/runfiles"], 33) 34 35pip_installed_sphinx = installed_entry_point( 36 pkg = "sphinx", 37 script = "sphinx-build", 38) 39 40pip_installed_yamllint = installed_entry_point("yamllint") 41 42py_test( 43 name = "pip_install_annotations_test", 44 srcs = ["pip_repository_entry_points_test.py"], 45 data = [ 46 pip_installed_sphinx, 47 pip_installed_yamllint, 48 ], 49 env = { 50 "SPHINX_BUILD_ENTRY_POINT": "$(rootpath {})".format(pip_installed_sphinx), 51 "YAMLLINT_ENTRY_POINT": "$(rootpath {})".format(pip_installed_yamllint), 52 }, 53 main = "pip_repository_entry_points_test.py", 54 deps = ["@rules_python//python/runfiles"], 55) 56