Skip to content

Commit 53ae726

Browse files
committed
wip: updates for bazel 8 compat
1 parent 218f8e1 commit 53ae726

File tree

6 files changed

+92
-162
lines changed

6 files changed

+92
-162
lines changed

MODULE.bazel

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ module(
66

77
bazel_dep(name = "bazel_features", version = "1.9.1")
88
bazel_dep(name = "bazel_skylib", version = "1.6.1")
9-
bazel_dep(name = "rules_cc", version = "0.0.9")
9+
bazel_dep(name = "rules_cc", version = "0.0.14")
1010
bazel_dep(name = "platforms", version = "0.0.4")
1111

1212
# Those are loaded only when using py_proto_library
1313
bazel_dep(name = "rules_proto", version = "6.0.0-rc1")
14-
bazel_dep(name = "protobuf", version = "24.4", repo_name = "com_google_protobuf")
14+
bazel_dep(name = "protobuf", version = "27.0", repo_name = "com_google_protobuf")
1515

1616
internal_deps = use_extension("//python/private:internal_deps.bzl", "internal_deps")
1717
use_repo(
@@ -70,15 +70,31 @@ use_repo(pip, "rules_python_publish_deps")
7070
bazel_dep(name = "stardoc", version = "0.6.2", repo_name = "io_bazel_stardoc")
7171

7272
# ===== DEV ONLY DEPS AND SETUP BELOW HERE =====
73-
bazel_dep(name = "rules_bazel_integration_test", version = "0.20.0", dev_dependency = True)
73+
bazel_dep(name = "rules_bazel_integration_test", version = "0.26.1", dev_dependency = True)
7474
bazel_dep(name = "rules_testing", version = "0.6.0", dev_dependency = True)
75-
bazel_dep(name = "rules_shell", version = "0.2.0", dev_dependency = True)
75+
bazel_dep(name = "rules_shell", version = "0.3.0", dev_dependency = True)
7676
bazel_dep(name = "rules_multirun", version = "0.9.0", dev_dependency = True)
77+
bazel_dep(name = "bazel_ci_rules", version = "1.0.0", dev_dependency = True)
7778

7879
# Extra gazelle plugin deps so that WORKSPACE.bzlmod can continue including it for e2e tests.
7980
# We use `WORKSPACE.bzlmod` because it is impossible to have dev-only local overrides.
8081
bazel_dep(name = "rules_go", version = "0.41.0", dev_dependency = True, repo_name = "io_bazel_rules_go")
8182
bazel_dep(name = "gazelle", version = "0.33.0", dev_dependency = True, repo_name = "bazel_gazelle")
83+
bazel_dep(name = "rules_python_gazelle_plugin", version = "0", dev_dependency = True)
84+
85+
internal_dev_deps = use_extension(
86+
"//python/private:internal_dev_deps.bzl",
87+
"internal_dev_deps",
88+
dev_dependency = True,
89+
)
90+
use_repo(internal_dev_deps, "wheel_for_testing")
91+
92+
# Add gazelle plugin so that we can run the gazelle example as an e2e integration
93+
# test and include the distribution files.
94+
local_path_override(
95+
module_name = "rules_python_gazelle_plugin",
96+
path = "gazelle",
97+
)
8298

8399
dev_python = use_extension(
84100
"//python/extensions:python.bzl",

WORKSPACE.bzlmod

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -17,44 +17,8 @@ workspace(name = "rules_python")
1717

1818
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
1919

20-
# Used for Bazel CI
21-
http_archive(
22-
name = "bazelci_rules",
23-
sha256 = "eca21884e6f66a88c358e580fd67a6b148d30ab57b1680f62a96c00f9bc6a07e",
24-
strip_prefix = "bazelci_rules-1.0.0",
25-
url = "https://github.com/bazelbuild/continuous-integration/releases/download/rules-1.0.0/bazelci_rules-1.0.0.tar.gz",
26-
)
27-
28-
load("@bazelci_rules//:rbe_repo.bzl", "rbe_preconfig")
29-
30-
# Creates a default toolchain config for RBE.
31-
# Use this as is if you are using the rbe_ubuntu16_04 container,
32-
# otherwise refer to RBE docs.
33-
rbe_preconfig(
34-
name = "buildkite_config",
35-
toolchain = "ubuntu1804-bazel-java11",
36-
)
37-
38-
# Add gazelle plugin so that we can run the gazelle example as an e2e integration
39-
# test and include the distribution files.
40-
local_repository(
41-
name = "rules_python_gazelle_plugin",
42-
path = "gazelle",
43-
)
44-
4520
#####################
4621

47-
# This wheel is purely here to validate the wheel extraction code. It's not
48-
# intended for anything else.
49-
http_file(
50-
name = "wheel_for_testing",
51-
downloaded_file_path = "numpy-1.25.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
52-
sha256 = "0d60fbae8e0019865fc4784745814cff1c421df5afee233db6d88ab4f14655a2",
53-
urls = [
54-
"https://files.pythonhosted.org/packages/50/67/3e966d99a07d60a21a21d7ec016e9e4c2642a86fea251ec68677daf71d4d/numpy-1.25.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl",
55-
],
56-
)
57-
5822
# rules_proto expects //external:python_headers to point at the python headers.
5923
bind(
6024
name = "python_headers",

examples/bzlmod/MODULE.bazel.lock

Lines changed: 14 additions & 105 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal_deps.bzl

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@ def rules_python_internal_deps():
3737
# This version is also used in python/tests/toolchains/workspace_template/WORKSPACE.tmpl
3838
# and tests/ignore_root_user_error/WORKSPACE.
3939
# If you update this dependency, please update the tests as well.
40+
4041
http_archive(
4142
name = "bazel_skylib",
42-
sha256 = "c6966ec828da198c5d9adbaa94c05e3a1c7f21bd012a0b29ba8ddbccb2c93b0d",
43+
sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f",
4344
urls = [
44-
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.1.1/bazel-skylib-1.1.1.tar.gz",
45-
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.1.1/bazel-skylib-1.1.1.tar.gz",
45+
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz",
46+
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz",
4647
],
4748
)
4849

@@ -181,10 +182,10 @@ def rules_python_internal_deps():
181182

182183
http_archive(
183184
name = "com_google_protobuf",
184-
sha256 = "616bb3536ac1fff3fb1a141450fa28b875e985712170ea7f1bfe5e5fc41e2cd8",
185-
strip_prefix = "protobuf-24.4",
185+
sha256 = "da288bf1daa6c04d03a9051781caa52aceb9163586bff9aa6cfb12f69b9395aa",
186+
strip_prefix = "protobuf-27.0",
186187
urls = [
187-
"https://github.com/protocolbuffers/protobuf/releases/download/v24.4/protobuf-24.4.tar.gz",
188+
"https://github.com/protocolbuffers/protobuf/releases/download/v27.0/protobuf-27.0.tar.gz",
188189
],
189190
)
190191

@@ -227,9 +228,9 @@ def rules_python_internal_deps():
227228

228229
http_archive(
229230
name = "rules_cc",
230-
sha256 = "2037875b9a4456dce4a79d112a8ae885bbc4aad968e6587dca6e64f3a0900cdf",
231-
strip_prefix = "rules_cc-0.0.9",
232-
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"],
231+
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.14/rules_cc-0.0.14.tar.gz"],
232+
sha256 = "906e89286acc67c20819c3c88b3283de0d5868afda33635d70acae0de9777bb7",
233+
strip_prefix = "rules_cc-0.0.14",
233234
)
234235

235236
http_archive(

0 commit comments

Comments
 (0)