xref: /aosp_15_r20/external/tink/python/examples/aead/BUILD.bazel (revision e7b1675dde1b92d52ec075b0a92829627f2c52a5)
1load("@rules_python//python:defs.bzl", "py_binary")
2load("@pip_deps//:requirements.bzl", "requirement")
3
4package(default_visibility = ["//visibility:private"])
5
6licenses(["notice"])
7
8exports_files(["aead_test_keyset.json"])
9
10py_binary(
11    name = "aead",
12    srcs = ["aead.py"],
13    python_version = "PY3",
14    deps = [
15        requirement("absl-py"),
16        "@tink_py//tink:cleartext_keyset_handle",
17        "@tink_py//tink:tink_python",
18        "@tink_py//tink/aead",
19    ],
20)
21
22py_library(
23    name = "aead_basic",
24    srcs = ["aead_basic.py"],
25    deps = [
26        "@tink_py//tink:cleartext_keyset_handle",
27        "@tink_py//tink:tink_python",
28        "@tink_py//tink/aead",
29    ],
30)
31
32py_test(
33    name = "aead_basic_test",
34    srcs = ["aead_basic_test.py"],
35    python_version = "PY3",
36    deps = [
37        requirement("absl-py"),
38        ":aead_basic"
39    ],
40)
41
42sh_test(
43    name = "aead_test",
44    size = "small",
45    srcs = ["aead_test.sh"],
46    args = [
47        "$(rootpath :aead)",
48        "$(rootpath :aead_test_keyset.json)",
49    ],
50    data = [
51        ":aead",
52        ":aead_test_keyset.json",
53    ],
54)
55
56# This runs the previous test assuming the Tink python package has been
57# installed previously with pip3 install.
58sh_test(
59    name = "aead_test_package",
60    size = "small",
61    srcs = ["aead_test.sh"],
62    args = [
63        "'python3 $(rootpath :aead.py)'",
64        "$(rootpath :aead_test_keyset.json)",
65    ],
66    data = [
67        ":aead.py",
68        ":aead_test_keyset.json",
69    ],
70)
71