diff --git a/BUILD.bazel b/BUILD.bazel index 9e5c70b732..ae9c87d1bf 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -27,7 +27,8 @@ load("@package_metadata//rules:package_metadata.bzl", "package_metadata") # gazelle:resolve starlark @bazel_tools//tools/build_defs/repo:http.bzl //python/private:bazel_tools # gazelle:resolve starlark @bazel_tools//tools/build_defs/repo:utils.bzl //python/private:bazel_tools -# Prevent Gazelle from incorrectly stripping the .bzl suffix from the toml.bzl repo name +# Prevent Gazelle from incorrectly stripping the .bzl suffix from the repo names +# gazelle:resolve starlark @pypackaging.bzl//:pypackaging.bzl @pypackaging.bzl//:pypackaging # gazelle:resolve starlark @toml.bzl//:toml.bzl @toml.bzl//:toml # Override Gazelle's incorrect default resolution for platforms host constraints Starlark library diff --git a/MODULE.bazel b/MODULE.bazel index 98ae8114b5..2fea2d486c 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -8,6 +8,7 @@ bazel_dep(name = "bazel_features", version = "1.55.0") bazel_dep(name = "bazel_skylib", version = "1.8.2") bazel_dep(name = "package_metadata", version = "0.0.13") bazel_dep(name = "platforms", version = "0.0.11") +bazel_dep(name = "pypackaging.bzl", version = "0.4.0") bazel_dep(name = "rules_cc", version = "0.2.17") bazel_dep(name = "toml.bzl", version = "0.4.1") diff --git a/WORKSPACE b/WORKSPACE index 631b94118d..f282982d82 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -61,14 +61,17 @@ load("@stardoc_maven//:defs.bzl", stardoc_pinned_maven_install = "pinned_maven_i stardoc_pinned_maven_install() +load("//python:repositories.bzl", "py_repositories", "python_register_multi_toolchains") + +# This needs to be called before the internal setup, because the repository +# rules that it loads use the dependencies defined here. +py_repositories() + load("//:internal_dev_setup.bzl", "rules_python_internal_setup") rules_python_internal_setup() load("@pythons_hub//:versions.bzl", "PYTHON_VERSIONS") -load("//python:repositories.bzl", "py_repositories", "python_register_multi_toolchains") - -py_repositories() python_register_multi_toolchains( name = "python", diff --git a/downloader_config.cfg b/downloader_config.cfg index 8bde140608..d445f15ff1 100644 --- a/downloader_config.cfg +++ b/downloader_config.cfg @@ -20,6 +20,7 @@ rewrite ^github\.com/bazelbuild/rules_swift/(.*) github.com/bazelbuild/rules_swi rewrite ^github\.com/bazelbuild/rules_testing/(.*) github.com/bazelbuild/rules_testing/$1 rewrite ^github\.com/bazelbuild/stardoc/(.*) github.com/bazelbuild/stardoc/$1 rewrite ^github\.com/google/googletest/(.*) github.com/google/googletest/$1 +rewrite ^github\.com/jvolkman/pypackaging\.bzl/(.*) github.com/jvolkman/pypackaging.bzl/$1 rewrite ^github\.com/jvolkman/toml\.bzl/(.*) github.com/jvolkman/toml.bzl/$1 rewrite ^github\.com/protocolbuffers/protobuf/(.*) github.com/protocolbuffers/protobuf/$1 # keep-sorted end @@ -48,6 +49,7 @@ rewrite ^github\.com/bazelbuild/rules_swift/(.*) mirror.bazel.build/github.com/b rewrite ^github\.com/bazelbuild/rules_testing/(.*) mirror.bazel.build/github.com/bazelbuild/rules_testing/$1 rewrite ^github\.com/bazelbuild/stardoc/(.*) mirror.bazel.build/github.com/bazelbuild/stardoc/$1 rewrite ^github\.com/google/googletest/(.*) mirror.bazel.build/github.com/google/googletest/$1 +rewrite ^github\.com/jvolkman/pypackaging\.bzl/(.*) mirror.bazel.build/github.com/jvolkman/pypackaging.bzl/$1 rewrite ^github\.com/jvolkman/toml\.bzl/(.*) mirror.bazel.build/github.com/jvolkman/toml.bzl/$1 rewrite ^github\.com/protocolbuffers/protobuf/(.*) mirror.bazel.build/github.com/protocolbuffers/protobuf/$1 # keep-sorted end diff --git a/gazelle/downloader_config.cfg b/gazelle/downloader_config.cfg index 8bde140608..d445f15ff1 100644 --- a/gazelle/downloader_config.cfg +++ b/gazelle/downloader_config.cfg @@ -20,6 +20,7 @@ rewrite ^github\.com/bazelbuild/rules_swift/(.*) github.com/bazelbuild/rules_swi rewrite ^github\.com/bazelbuild/rules_testing/(.*) github.com/bazelbuild/rules_testing/$1 rewrite ^github\.com/bazelbuild/stardoc/(.*) github.com/bazelbuild/stardoc/$1 rewrite ^github\.com/google/googletest/(.*) github.com/google/googletest/$1 +rewrite ^github\.com/jvolkman/pypackaging\.bzl/(.*) github.com/jvolkman/pypackaging.bzl/$1 rewrite ^github\.com/jvolkman/toml\.bzl/(.*) github.com/jvolkman/toml.bzl/$1 rewrite ^github\.com/protocolbuffers/protobuf/(.*) github.com/protocolbuffers/protobuf/$1 # keep-sorted end @@ -48,6 +49,7 @@ rewrite ^github\.com/bazelbuild/rules_swift/(.*) mirror.bazel.build/github.com/b rewrite ^github\.com/bazelbuild/rules_testing/(.*) mirror.bazel.build/github.com/bazelbuild/rules_testing/$1 rewrite ^github\.com/bazelbuild/stardoc/(.*) mirror.bazel.build/github.com/bazelbuild/stardoc/$1 rewrite ^github\.com/google/googletest/(.*) mirror.bazel.build/github.com/google/googletest/$1 +rewrite ^github\.com/jvolkman/pypackaging\.bzl/(.*) mirror.bazel.build/github.com/jvolkman/pypackaging.bzl/$1 rewrite ^github\.com/jvolkman/toml\.bzl/(.*) mirror.bazel.build/github.com/jvolkman/toml.bzl/$1 rewrite ^github\.com/protocolbuffers/protobuf/(.*) mirror.bazel.build/github.com/protocolbuffers/protobuf/$1 # keep-sorted end diff --git a/python/private/py_repositories.bzl b/python/private/py_repositories.bzl index 5353b8b8c5..5eeaf4415f 100644 --- a/python/private/py_repositories.bzl +++ b/python/private/py_repositories.bzl @@ -78,6 +78,12 @@ def py_repositories(transition_settings = []): strip_prefix = "toml.bzl-0.4.0", url = "https://github.com/jvolkman/toml.bzl/releases/download/v0.4.0/toml.bzl-v0.4.0.tar.gz", ) + http_archive( + name = "pypackaging.bzl", + sha256 = "d234430a5425e8b090c0071944036516a3516b41f9c9d005113fff0533f591b3", + strip_prefix = "pypackaging.bzl-0.4.0", + url = "https://github.com/jvolkman/pypackaging.bzl/releases/download/v0.4.0/pypackaging.bzl-v0.4.0.tar.gz", + ) http_archive( name = "package_metadata", sha256 = "755bd6c8a3751982e2555d96c913ec070954ca9d01f935563392255da4ebad72", diff --git a/sphinxdocs/downloader_config.cfg b/sphinxdocs/downloader_config.cfg index 8bde140608..d445f15ff1 100644 --- a/sphinxdocs/downloader_config.cfg +++ b/sphinxdocs/downloader_config.cfg @@ -20,6 +20,7 @@ rewrite ^github\.com/bazelbuild/rules_swift/(.*) github.com/bazelbuild/rules_swi rewrite ^github\.com/bazelbuild/rules_testing/(.*) github.com/bazelbuild/rules_testing/$1 rewrite ^github\.com/bazelbuild/stardoc/(.*) github.com/bazelbuild/stardoc/$1 rewrite ^github\.com/google/googletest/(.*) github.com/google/googletest/$1 +rewrite ^github\.com/jvolkman/pypackaging\.bzl/(.*) github.com/jvolkman/pypackaging.bzl/$1 rewrite ^github\.com/jvolkman/toml\.bzl/(.*) github.com/jvolkman/toml.bzl/$1 rewrite ^github\.com/protocolbuffers/protobuf/(.*) github.com/protocolbuffers/protobuf/$1 # keep-sorted end @@ -48,6 +49,7 @@ rewrite ^github\.com/bazelbuild/rules_swift/(.*) mirror.bazel.build/github.com/b rewrite ^github\.com/bazelbuild/rules_testing/(.*) mirror.bazel.build/github.com/bazelbuild/rules_testing/$1 rewrite ^github\.com/bazelbuild/stardoc/(.*) mirror.bazel.build/github.com/bazelbuild/stardoc/$1 rewrite ^github\.com/google/googletest/(.*) mirror.bazel.build/github.com/google/googletest/$1 +rewrite ^github\.com/jvolkman/pypackaging\.bzl/(.*) mirror.bazel.build/github.com/jvolkman/pypackaging.bzl/$1 rewrite ^github\.com/jvolkman/toml\.bzl/(.*) mirror.bazel.build/github.com/jvolkman/toml.bzl/$1 rewrite ^github\.com/protocolbuffers/protobuf/(.*) mirror.bazel.build/github.com/protocolbuffers/protobuf/$1 # keep-sorted end diff --git a/tests/integration/bzlmod_lockfile/MODULE.bazel.lock b/tests/integration/bzlmod_lockfile/MODULE.bazel.lock index 2f3c632adb..37e0f8cb6c 100644 --- a/tests/integration/bzlmod_lockfile/MODULE.bazel.lock +++ b/tests/integration/bzlmod_lockfile/MODULE.bazel.lock @@ -93,6 +93,8 @@ "https://bcr.bazel.build/modules/pybind11_bazel/2.11.1/MODULE.bazel": "88af1c246226d87e65be78ed49ecd1e6f5e98648558c14ce99176da041dc378e", "https://bcr.bazel.build/modules/pybind11_bazel/2.12.0/MODULE.bazel": "e6f4c20442eaa7c90d7190d8dc539d0ab422f95c65a57cc59562170c58ae3d34", "https://bcr.bazel.build/modules/pybind11_bazel/2.12.0/source.json": "6900fdc8a9e95866b8c0d4ad4aba4d4236317b5c1cd04c502df3f0d33afed680", + "https://bcr.bazel.build/modules/pypackaging.bzl/0.4.0/MODULE.bazel": "5fd3c92b01d18cb6ac6fb9581b633d75e094c63b5673935b26182439a6e30a5e", + "https://bcr.bazel.build/modules/pypackaging.bzl/0.4.0/source.json": "3d3aaa5de7e63fb1ab9953a60ddf7ade2183947003d37c1d5cc861b4f3278c5d", "https://bcr.bazel.build/modules/re2/2023-09-01/MODULE.bazel": "cb3d511531b16cfc78a225a9e2136007a48cf8a677e4264baeab57fe78a80206", "https://bcr.bazel.build/modules/re2/2024-07-02.bcr.1/MODULE.bazel": "b4963dda9b31080be1905ef085ecd7dd6cd47c05c79b9cdf83ade83ab2ab271a", "https://bcr.bazel.build/modules/re2/2024-07-02.bcr.1/source.json": "2ff292be6ef3340325ce8a045ecc326e92cbfab47c7cbab4bd85d28971b97ac4",