Update pip dependency reference from @pypi_XXX//:pkg to @pypi//XXX.

The `@pypi_<name>` references are deprecated and their repo names are
an implementation detail of how an underlying library is downloaded.
The modern, supported, way is to go through the hub (`@pypi`). This
also makes the code compatible with both workspace and bzlmod.

PiperOrigin-RevId: 812915387
This commit is contained in:
Yun Peng 2025-09-29 13:16:19 -07:00 committed by TensorFlower Gardener
parent dfda2351b9
commit bfc4d2d2e4
6 changed files with 13 additions and 7 deletions

View File

@ -4,12 +4,12 @@ package(default_visibility = ["//visibility:public"])
alias(
name = "numpy",
actual = "@pypi_numpy//:pkg",
actual = "@pypi//numpy",
)
alias(
name = "headers",
actual = "@pypi_numpy//:numpy_headers",
actual = "@pypi//numpy:numpy_headers",
)
genrule(

View File

@ -35,5 +35,8 @@ cc_library(
python_interpreter_target = "@{}_host//:python".format(
get_toolchain_name_per_python_version("python"),
),
extra_hub_aliases = {
"numpy": ["numpy_headers"],
},
requirements_lock = REQUIREMENTS_WITH_LOCAL_WHEELS,
)

View File

@ -4,12 +4,12 @@ package(default_visibility = ["//visibility:public"])
alias(
name = "numpy",
actual = "@pypi_numpy//:pkg",
actual = "@pypi//numpy",
)
alias(
name = "headers",
actual = "@pypi_numpy//:numpy_headers",
actual = "@pypi//numpy:numpy_headers",
)
genrule(

View File

@ -35,5 +35,8 @@ cc_library(
python_interpreter_target = "@{}_host//:python".format(
get_toolchain_name_per_python_version("python"),
),
extra_hub_aliases = {
"numpy": ["numpy_headers"],
},
requirements_lock = REQUIREMENTS_WITH_LOCAL_WHEELS,
)

View File

@ -248,7 +248,7 @@ def lit_test(
testonly = True,
deps = [
"@llvm-project//llvm:lit_lib",
"@pypi_lit//:pkg",
"@pypi//lit",
],
)
@ -282,7 +282,7 @@ def lit_test(
# called lit.cfg.py
cfg,
tools_on_path_target_name,
] + data + if_oss(["@pypi_lit//:pkg"]) +
] + data + if_oss(["@pypi//lit"]) +
if_google([
"//xla:lit_google_cfg.py",
]),

View File

@ -28,7 +28,7 @@ package(
"nomsan", # The execution engine doesn't work with msan, see b/248097619.
],
deps = ["@pypi_lit//:pkg"],
deps = ["@pypi_lit//:pkg"], # copybara:comment
deps = ["@pypi//lit"], # copybara:comment
)
for src in glob(["**/*.mlir"])
]