chore: import upstream snapshot with attribution
cffconvert / validate (push) Has been skipped
License Check / license-check (push) Failing after 2s

This commit is contained in:
wehub-resource-sync
2026-07-13 12:14:16 +08:00
commit 8a852e4b4e
36502 changed files with 9277225 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
# copybara:uncomment package(default_applicable_licenses = ["//tensorflow:license"])
+51
View File
@@ -0,0 +1,51 @@
"""
A much simplified version of third_party/py/python_repo.bzl, which generates the "python_version_repo" repo.
This is just to keep the current build compatible with both WORKSPACE and Bzlmod, we may not need this in future.
"""
_PY_VERSION_BZL = """
HERMETIC_PYTHON_VERSION = "{version}"
HERMETIC_PYTHON_VERSION_KIND = "{py_kind}"
USE_PYWRAP_RULES = {use_pywrap_rules}
MACOSX_DEPLOYMENT_TARGET = "{macosx_deployment_target}"
WHEEL_COLLAB = "{wheel_collab}"
WHEEL_NAME = "{wheel_name}"
# TODO(pcloudy): Figure out how to support requirements_lock in Bzlmod.
REQUIREMENTS = "//:requirements.txt"
"""
def _python_version_repo_impl(repository_ctx):
version = repository_ctx.os.environ.get("HERMETIC_PYTHON_VERSION", "3.11")
wheel_name = repository_ctx.os.environ.get("WHEEL_NAME", "tensorflow")
wheel_collab = repository_ctx.os.environ.get("WHEEL_COLLAB", False)
macosx_deployment_target = repository_ctx.os.environ.get("MACOSX_DEPLOYMENT_TARGET", "")
use_pywrap_rules = bool(
repository_ctx.os.environ.get("USE_PYWRAP_RULES", False),
)
repository_ctx.file("BUILD.bazel", "")
repository_ctx.file(
"py_version.bzl",
_PY_VERSION_BZL.format(
version = version,
py_kind = "", # TODO(pcloudy): introduce this value properly.
use_pywrap_rules = use_pywrap_rules,
wheel_name = wheel_name,
wheel_collab = wheel_collab,
macosx_deployment_target = macosx_deployment_target,
),
)
python_version_repo = repository_rule(
implementation = _python_version_repo_impl,
environ = [
"HERMETIC_PYTHON_VERSION",
"HERMETIC_PYTHON_VERSION_KIND",
"USE_PYWRAP_RULES",
],
)
python_version_ext = module_extension(
implementation = lambda mctx: python_version_repo(name = "python_version_repo"),
)
+78
View File
@@ -0,0 +1,78 @@
"""bzlmod extensions for third-party dependencies."""
load("//third_party:java_repos.bzl", java_external_repositories = "repo")
load("//third_party:models_repos.bzl", "models_repositories")
load("//third_party/arm_neon_2_x86_sse:workspace.bzl", arm_neon_2_x86_sse = "repo")
load("//third_party/coremltools:workspace.bzl", coremltools = "repo")
load("//third_party/cython:workspace.bzl", cython = "repo")
load("//third_party/fft2d:workspace.bzl", fft2d = "repo")
load("//third_party/flatbuffers:workspace.bzl", flatbuffers = "repo")
load("//third_party/gif:workspace.bzl", gif = "repo")
load("//third_party/googleapis:workspace.bzl", googleapis = "repo")
load("//third_party/hexagon:workspace.bzl", hexagon_nn = "repo")
load("//third_party/icu:workspace.bzl", icu = "repo")
load("//third_party/jpeg:workspace.bzl", jpeg = "repo")
load("//third_party/jpegxl:workspace.bzl", jpegxl = "repo")
load("//third_party/kissfft:workspace.bzl", kissfft = "repo")
load("//third_party/libwebp:workspace.bzl", libwebp = "repo")
load("//third_party/linenoise:workspace.bzl", linenoise = "repo")
load("//third_party/nccl:workspace.bzl", nccl = "repo")
load("//third_party/nvtx:workspace.bzl", nvtx = "repo")
load("//third_party/opencl_headers:workspace.bzl", opencl_headers = "repo")
load("//third_party/png:workspace.bzl", png = "repo")
load("//third_party/pprof:workspace.bzl", pprof = "repo")
load("//third_party/py/absl_py:workspace.bzl", absl_py = "repo")
load("//third_party/ruy:workspace.bzl", ruy = "repo")
load("//third_party/six:workspace.bzl", six = "repo")
load("//third_party/skcms:workspace.bzl", skcms = "repo")
load("//third_party/sobol_data:workspace.bzl", sobol_data = "repo")
load("//third_party/sqlite:workspace.bzl", sqlite = "repo")
load("//third_party/tf_gcp_tools:workspace.bzl", tensorflow_gcp_tools = "repo")
load("//third_party/tf_runtime:workspace.bzl", tf_runtime = "repo")
load("//third_party/tflite_mobilenet:workspace.bzl", tflite_mobilenet = "repo")
load("//third_party/tflite_ovic_testdata:workspace.bzl", tflite_ovic_testdata = "repo")
load("//third_party/vulkan_headers:workspace.bzl", vulkan_headers = "repo")
load("//third_party/xctestrunner:workspace.bzl", xctestrunner = "repo")
load("//third_party/xprof:workspace.bzl", xprof = "repo")
def _third_party_ext_impl(mctx): # @unused
# go/keep-sorted start
absl_py()
arm_neon_2_x86_sse()
coremltools()
cython()
fft2d()
flatbuffers()
gif()
googleapis()
hexagon_nn()
icu()
java_external_repositories()
jpeg()
jpegxl()
kissfft()
libwebp()
linenoise()
models_repositories()
nccl()
nvtx()
opencl_headers()
png()
pprof()
ruy()
six()
skcms()
sobol_data()
sqlite()
tensorflow_gcp_tools()
tf_runtime()
tflite_mobilenet()
tflite_ovic_testdata()
vulkan_headers()
xctestrunner()
xprof()
# go/keep-sorted end
third_party_ext = module_extension(
implementation = _third_party_ext_impl,
)