-
Notifications
You must be signed in to change notification settings - Fork 1
/
BUILD
140 lines (129 loc) · 4.37 KB
/
BUILD
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
load("@buildifier_prebuilt//:rules.bzl", "buildifier")
load("@pip//:requirements.bzl", "requirement")
load("@python_versions//3.10:defs.bzl", compile_pip_requirements_3_10 = "compile_pip_requirements")
load("@python_versions//3.11:defs.bzl", compile_pip_requirements_3_11 = "compile_pip_requirements")
load("@python_versions//3.12:defs.bzl", compile_pip_requirements_3_12 = "compile_pip_requirements")
load("@python_versions//3.9:defs.bzl", compile_pip_requirements_3_9 = "compile_pip_requirements")
load("@rules_python//python:defs.bzl", "py_binary")
load("@rules_python//python:packaging.bzl", "py_wheel")
DEFAULT_PYTHON = "3.10" # Also see ./MODULE.bazel
exports_files([
"LICENSE",
"setup.py",
"requirements.in",
"requirements_3_9.txt",
"requirements_3_10.txt",
"requirements_3_11.txt",
"requirements_3_12.txt",
"README.md",
"DESCRIPTION.md",
])
compile_pip_requirements_3_9(
name = "requirements_3_9",
extra_args = ["--allow-unsafe"], # need setuptools
requirements_in = "//:requirements.in",
requirements_txt = "//:requirements_3_9.txt",
visibility = ["//visibility:public"],
)
compile_pip_requirements_3_10(
name = "requirements_3_10",
extra_args = ["--allow-unsafe"], # need setuptools
requirements_in = "//:requirements.in",
requirements_txt = "//:requirements_3_10.txt",
visibility = ["//visibility:public"],
)
compile_pip_requirements_3_11(
name = "requirements_3_11",
extra_args = ["--allow-unsafe"], # need setuptools
requirements_in = "//:requirements.in",
requirements_txt = "//:requirements_3_11.txt",
visibility = ["//visibility:public"],
)
compile_pip_requirements_3_12(
name = "requirements_3_12",
extra_args = ["--allow-unsafe"], # need setuptools
requirements_in = "//:requirements.in",
requirements_txt = "//:requirements_3_12.txt",
visibility = ["//visibility:public"],
)
buildifier(
name = "bazel_formatter",
exclude_patterns = [
"./bazel-*/*",
"./.git/*",
],
lint_mode = "warn",
)
py_binary(
name = "python_formatter",
srcs = ["//tools:python_formatter.py"],
python_version = "PY3",
srcs_version = "PY3",
visibility = [
"//:__pkg__",
],
deps = [
requirement("black"),
],
)
py_binary(
name = "clang_formatter",
srcs = ["//tools:clang_formatter.py"],
python_version = "PY3",
srcs_version = "PY3",
visibility = [
"//:__pkg__",
],
)
py_binary(
name = "wheel_rename",
srcs = ["//tools:wheel_rename.py"],
python_version = "PY3",
srcs_version = "PY3",
visibility = [
"//:__pkg__",
],
deps = [
requirement("packaging"),
],
)
py_wheel(
name = "wheel",
abi = "ABI",
author = "Google Inc.",
author_email = "[email protected]",
classifiers = [
"Topic :: Security :: Cryptography",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Scientific/Engineering :: Mathematics",
],
description_file = "//:README.md",
distribution = module_name(),
extra_distinfo_files = {
"//:LICENSE": "LICENSE",
"//:README.md": "README",
},
homepage = "https://github.com/google/tf-shell",
license = "Apache 2.0",
platform = select({
"@bazel_tools//src/conditions:windows_x64": "win_amd64",
"@bazel_tools//src/conditions:windows_arm64": "win_arm64",
"@bazel_tools//src/conditions:darwin_x86_64": "macosx_12_0_x86_64",
"@bazel_tools//src/conditions:darwin_arm64": "macosx_12_0_arm64",
"@bazel_tools//src/conditions:linux_x86_64": "LINUX_x86_64",
"@bazel_tools//src/conditions:linux_aarch64": "LINUX_aarch64",
}),
python_requires = ">=3.9",
python_tag = "INTERPRETER",
requires = ["tensorflow[and-cuda]==2.18.0"], # See also: requirements.in.
# The summary is tailored for each python version because PyPI prevents
# wheel uploads for different versions which have the same contents.
# Changing the summary is sufficient to allow re-uploads.
summary = "TF-Shell: Privacy preserving machine learning with Tensorflow and the SHELL encryption library, built for python " + DEFAULT_PYTHON + ".",
version = module_version(),
deps = [
"//tf_shell:tf_shell_pkg",
"//tf_shell_ml:tf_shell_ml_pkg",
],
)