Rename bazel "pip_deps" hub_name.

rules_python recommends not using "pip_deps" as a hub name unless the module is guaranteed to always be the root module, as the name must be unique between modules.

PiperOrigin-RevId: 715435028
pull/19968/head
Protobuf Team Bot 1 month ago committed by Copybara-Service
parent 7d1b040ec4
commit 32838e8c2c
  1. 4
      MODULE.bazel
  2. 4
      WORKSPACE
  3. 4
      python/dist/BUILD.bazel
  4. 2
      python/dist/system_python.bzl
  5. 4
      python/google/protobuf/internal/numpy/BUILD.bazel

@ -62,14 +62,14 @@ pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip", dev_depen
[
pip.parse(
hub_name = "pip_deps",
hub_name = "protobuf_pip_deps",
python_version = python_version,
requirements_lock = "//python:requirements.txt",
)
for python_version in SUPPORTED_PYTHON_VERSIONS
]
use_repo(pip, "pip_deps")
use_repo(pip, "protobuf_pip_deps")
crate = use_extension("@rules_rust//crate_universe:extension.bzl", "crate", dev_dependency = True)
crate.spec(

@ -186,11 +186,11 @@ http_archive(
load("@system_python//:pip.bzl", "pip_parse")
pip_parse(
name = "pip_deps",
name = "protobuf_pip_deps",
requirements = "//python:requirements.txt",
)
load("@pip_deps//:requirements.bzl", "install_deps")
load("@protobuf_pip_deps//:requirements.bzl", "install_deps")
install_deps()

@ -7,7 +7,7 @@
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
load("@bazel_skylib//lib:selects.bzl", "selects")
load("@pip_deps//:requirements.bzl", "requirement")
load("@protobuf_pip_deps//:requirements.bzl", "requirement")
load("@rules_pkg//pkg:mappings.bzl", "pkg_files", "strip_prefix")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
load("@rules_python//python:packaging.bzl", "py_wheel")
@ -304,7 +304,7 @@ genrule(
srcs = [":source_tarball"],
outs = ["protobuf-%s.tar.gz" % PROTOBUF_PYTHON_VERSION],
cmd = """
export PYTHONPATH=$$PWD/external/pip_deps_setuptools/site-packages
export PYTHONPATH=$$PWD/external/protobuf_pip_deps_setuptools/site-packages
set -eux
tar -xzvf $(location :source_tarball)
cd protobuf/

@ -242,7 +242,7 @@ def _system_python_impl(repository_ctx):
# Pip dependencies can optionally be specified using a wrapper around rules_python's repository rules:
# load("@system_python//:pip.bzl", "pip_install")
# pip_install(
# name="pip_deps",
# name="protobuf_pip_deps",
# requirements = "@com_google_protobuf//python:requirements.txt",
# )
# An optional argument `requirements_overrides` takes a dictionary mapping python versions to alternate

@ -1,7 +1,7 @@
# Protobuf python numpy Tests
# This is removed from other tests to keep numpy (and @pip_deps) as a test-only dependency
# This is removed from other tests to keep numpy (and @protobuf_pip_deps) as a test-only dependency
load("@pip_deps//:requirements.bzl", "requirement")
load("@protobuf_pip_deps//:requirements.bzl", "requirement")
load("//python:internal.bzl", "internal_py_test")
# TODO: b/278896688 - Remove this target and replace with py_library

Loading…
Cancel
Save