diff options
Diffstat (limited to 'tests/pip_repository_entry_points/BUILD.bazel')
-rw-r--r-- | tests/pip_repository_entry_points/BUILD.bazel | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/tests/pip_repository_entry_points/BUILD.bazel b/tests/pip_repository_entry_points/BUILD.bazel new file mode 100644 index 0000000..81c01c3 --- /dev/null +++ b/tests/pip_repository_entry_points/BUILD.bazel @@ -0,0 +1,55 @@ +load("@pip_installed//:requirements.bzl", installed_entry_point = "entry_point") +load("@pip_parsed//:requirements.bzl", parsed_entry_point = "entry_point") +load("@rules_python//python:defs.bzl", "py_test") +load("@rules_python//python:pip.bzl", "compile_pip_requirements") + +# This rule adds a convenient way to update the requirements file. +compile_pip_requirements( + name = "requirements", + extra_args = ["--allow-unsafe"], + requirements_windows = ":requirements_windows.txt", +) + +pip_parsed_sphinx = parsed_entry_point( + pkg = "sphinx", + script = "sphinx-build", +) + +pip_parsed_yamllint = parsed_entry_point("yamllint") + +py_test( + name = "pip_parse_entry_points_test", + srcs = ["pip_repository_entry_points_test.py"], + data = [ + pip_parsed_sphinx, + pip_parsed_yamllint, + ], + env = { + "SPHINX_BUILD_ENTRY_POINT": "$(rootpath {})".format(pip_parsed_sphinx), + "YAMLLINT_ENTRY_POINT": "$(rootpath {})".format(pip_parsed_yamllint), + }, + main = "pip_repository_entry_points_test.py", + deps = ["@rules_python//python/runfiles"], +) + +pip_installed_sphinx = installed_entry_point( + pkg = "sphinx", + script = "sphinx-build", +) + +pip_installed_yamllint = installed_entry_point("yamllint") + +py_test( + name = "pip_install_annotations_test", + srcs = ["pip_repository_entry_points_test.py"], + data = [ + pip_installed_sphinx, + pip_installed_yamllint, + ], + env = { + "SPHINX_BUILD_ENTRY_POINT": "$(rootpath {})".format(pip_installed_sphinx), + "YAMLLINT_ENTRY_POINT": "$(rootpath {})".format(pip_installed_yamllint), + }, + main = "pip_repository_entry_points_test.py", + deps = ["@rules_python//python/runfiles"], +) |