|
11 | 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12 | 12 | # See the License for the specific language governing permissions and
|
13 | 13 | # limitations under the License.
|
| 14 | + |
| 15 | +load("@python_versions//3.10:defs.bzl", compile_pip_requirements_3_10 = "compile_pip_requirements") |
| 16 | +load("@python_versions//3.11:defs.bzl", compile_pip_requirements_3_11 = "compile_pip_requirements") |
| 17 | + |
| 18 | +# load("@python_versions//3.9:defs.bzl", compile_pip_requirements_3_9 = "compile_pip_requirements") |
| 19 | +load("@rules_python//python:packaging.bzl", "py_package", "py_wheel") |
| 20 | +load("@rules_python//python:pip.bzl", "compile_pip_requirements") |
| 21 | +load("//:version.bzl", "SPU_VERSION") |
| 22 | + |
| 23 | +# compile_pip_requirements_3_9( |
| 24 | +# name = "requirements_3_9", |
| 25 | +# src = "requirements_3_9.txt", |
| 26 | +# requirements_txt = "requirements_lock_3_9.txt", |
| 27 | +# tags = ["manual"], |
| 28 | +# ) |
| 29 | + |
| 30 | +compile_pip_requirements_3_10( |
| 31 | + name = "requirements_3_10", |
| 32 | + src = "requirements.txt", |
| 33 | + requirements_txt = "requirements_lock_3_10.txt", |
| 34 | + tags = ["manual"], |
| 35 | +) |
| 36 | + |
| 37 | +compile_pip_requirements_3_11( |
| 38 | + name = "requirements_3_11", |
| 39 | + src = "requirements.txt", |
| 40 | + requirements_txt = "requirements_lock_3_11.txt", |
| 41 | + tags = ["manual"], |
| 42 | +) |
| 43 | + |
| 44 | +compile_pip_requirements( |
| 45 | + name = "requirements-dev", |
| 46 | + src = "requirements-dev.txt", |
| 47 | + requirements_txt = "requirements_dev_lock.txt", |
| 48 | + tags = ["manual"], |
| 49 | +) |
| 50 | + |
| 51 | +exports_files([ |
| 52 | + "README.md", |
| 53 | +]) |
| 54 | + |
| 55 | +# https://rules-python.readthedocs.io/en/latest/api/rules_python/python/packaging.html#py_wheel_rule |
| 56 | +py_wheel( |
| 57 | + name = "spu_wheel", |
| 58 | + abi = select( |
| 59 | + { |
| 60 | + "@rules_python//python/config_settings:is_python_3.10": "cp310", |
| 61 | + "@rules_python//python/config_settings:is_python_3.11": "cp311", |
| 62 | + # "@rules_python//python/config_settings:is_python_3.9": "cp39", |
| 63 | + "//conditions:default": "none", |
| 64 | + }, |
| 65 | + ), |
| 66 | + author = "SecretFlow Team", |
| 67 | + author_email = "[email protected]", |
| 68 | + classifiers = [ |
| 69 | + "Programming Language :: Python :: 3.9", |
| 70 | + "Programming Language :: Python :: 3.10", |
| 71 | + "Programming Language :: Python :: 3.11", |
| 72 | + ], |
| 73 | + description_content_type = "text/markdown", |
| 74 | + description_file = "README.md", |
| 75 | + distribution = "spu", |
| 76 | + extra_distinfo_files = { |
| 77 | + "//:LICENSE": "LICENSE", |
| 78 | + }, |
| 79 | + homepage = "https://github.com/secretflow/spu", |
| 80 | + license = "Apache License 2.0", |
| 81 | + # TODO: add other fields. |
| 82 | + platform = select( |
| 83 | + { |
| 84 | + "@bazel_tools//src/conditions:linux_x86_64": "manylinux2014_x86_64", |
| 85 | + "@bazel_tools//src/conditions:darwin_arm64": "macosx_13_0_arm64", |
| 86 | + "@bazel_tools//src/conditions:linux_aarch64": "manylinux_2_28_aarch64", |
| 87 | + "//conditions:default": "any", |
| 88 | + }, |
| 89 | + ), |
| 90 | + python_requires = ">=3.9", |
| 91 | + python_tag = select( |
| 92 | + { |
| 93 | + "@rules_python//python/config_settings:is_python_3.10": "cp310", |
| 94 | + "@rules_python//python/config_settings:is_python_3.11": "cp311", |
| 95 | + # "@rules_python//python/config_settings:is_python_3.9": "cp39", |
| 96 | + "//conditions:default": "py3", |
| 97 | + }, |
| 98 | + ), |
| 99 | + requires_file = "requirements.txt", |
| 100 | + summary = "SPU aims to be a 'provable', 'measurable' secure computation device.", |
| 101 | + tags = ["manual"], |
| 102 | + twine = None, |
| 103 | + version = SPU_VERSION, |
| 104 | + deps = [ |
| 105 | + ":spu_pkg", |
| 106 | + ], |
| 107 | +) |
| 108 | + |
| 109 | +py_package( |
| 110 | + name = "spu_pkg", |
| 111 | + packages = [ |
| 112 | + "libspu", |
| 113 | + "spu", |
| 114 | + ], |
| 115 | + visibility = ["//visibility:private"], |
| 116 | + deps = [ |
| 117 | + "//spu:api", |
| 118 | + "//spu:init", |
| 119 | + "//spu:libpsi", |
| 120 | + "//spu:libspu", |
| 121 | + "//spu/ops/groupby", |
| 122 | + "//spu/utils:distributed", |
| 123 | + ], |
| 124 | +) |
0 commit comments