From 32838e8c2ce88f1c040f5b68c9ac4941fa97fa09 Mon Sep 17 00:00:00 2001 From: Protobuf Team Bot Date: Tue, 14 Jan 2025 10:28:32 -0800 Subject: [PATCH] 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 --- MODULE.bazel | 4 ++-- WORKSPACE | 4 ++-- python/dist/BUILD.bazel | 4 ++-- python/dist/system_python.bzl | 2 +- python/google/protobuf/internal/numpy/BUILD.bazel | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index 7c51a04946..970e4d99d7 100644 --- a/MODULE.bazel +++ b/MODULE.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( diff --git a/WORKSPACE b/WORKSPACE index e5599f4d9e..18b58e22f4 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -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() diff --git a/python/dist/BUILD.bazel b/python/dist/BUILD.bazel index bdfee0ea06..e7d32cb1f4 100644 --- a/python/dist/BUILD.bazel +++ b/python/dist/BUILD.bazel @@ -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/ diff --git a/python/dist/system_python.bzl b/python/dist/system_python.bzl index 76ee09250b..390bf3c2a6 100644 --- a/python/dist/system_python.bzl +++ b/python/dist/system_python.bzl @@ -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 diff --git a/python/google/protobuf/internal/numpy/BUILD.bazel b/python/google/protobuf/internal/numpy/BUILD.bazel index 6f2a919f2e..6799b799e9 100644 --- a/python/google/protobuf/internal/numpy/BUILD.bazel +++ b/python/google/protobuf/internal/numpy/BUILD.bazel @@ -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