aboutsummaryrefslogtreecommitdiff
path: root/examples/pip_repository_annotations/BUILD
blob: 4fd124e6c7005f4ab12aa19008d3b49c837ee069 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
load("@pip_installed//:requirements.bzl", "requirement")
load("@rules_python//python:defs.bzl", "py_test")
load("@rules_python//python:pip.bzl", "compile_pip_requirements")

exports_files(
    glob(["data/**"]),
    visibility = ["//visibility:public"],
)

# This rule adds a convenient way to update the requirements file.
compile_pip_requirements(
    name = "requirements",
    extra_args = ["--allow-unsafe"],
)

py_test(
    name = "pip_parse_annotations_test",
    srcs = ["pip_repository_annotations_test.py"],
    env = {"WHEEL_PKG_DIR": "pip_parsed_wheel"},
    main = "pip_repository_annotations_test.py",
    deps = [
        "@pip_parsed_wheel//:pkg",
        "@rules_python//python/runfiles",
    ],
)

py_test(
    name = "pip_install_annotations_test",
    srcs = ["pip_repository_annotations_test.py"],
    env = {"WHEEL_PKG_DIR": "pip_installed_wheel"},
    main = "pip_repository_annotations_test.py",
    deps = [
        requirement("wheel"),
        "@rules_python//python/runfiles",
    ],
)