Skip to content

Commit 53b1f8d

Browse files
Update dependency rules_python to v2 (#2286)
* Update dependency rules_python to v2 * Use local python version, not rules_python downloaded one * Update dependency rules_python to v2 * Use local python version, not rules_python downloaded one * Commit module.bazel.lock --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Tom Parker-Shemilt <tom@tracemachina.com>
1 parent ff15e88 commit 53b1f8d

7 files changed

Lines changed: 9622 additions & 8 deletions

File tree

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ __pycache__
1414
.DS_Store
1515
.pre-commit-config.yaml
1616
result
17-
MODULE.bazel.lock
1817
trivy-results.sarif
1918
Pulumi.dev.yaml
2019
rust-project.json

MODULE.bazel

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,39 @@ module(
77
bazel_dep(name = "rules_cc", version = "0.2.8")
88
bazel_dep(name = "platforms", version = "1.0.0")
99
bazel_dep(name = "bazel_skylib", version = "1.8.2")
10-
bazel_dep(name = "rules_python", version = "1.3.0") # TODO(palfrey): Bump.
10+
bazel_dep(name = "rules_python", version = "2.0.0")
1111
bazel_dep(name = "rules_shell", version = "0.6.1")
1212

13-
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
14-
python.toolchain(
15-
configure_coverage_tool = True,
16-
python_version = "3.13",
13+
# We use the Nix Python install, as per https://rules-python.readthedocs.io/en/latest/toolchains.html#local-toolchain
14+
# Can't use the rules_python download versions as it breaks with the genrule stuff in nativelink-proto
15+
# Also, this way around we get a Nix-locked Python binary
16+
local_runtime_repo = use_repo_rule(
17+
"@rules_python//python/local_toolchains:repos.bzl",
18+
"local_runtime_repo",
19+
)
20+
21+
local_runtime_toolchains_repo = use_repo_rule(
22+
"@rules_python//python/local_toolchains:repos.bzl",
23+
"local_runtime_toolchains_repo",
24+
)
25+
26+
local_runtime_repo(
27+
name = "local_python3",
28+
dev_dependency = True,
29+
interpreter_path = "python3",
30+
on_failure = "fail",
31+
)
32+
33+
local_runtime_toolchains_repo(
34+
name = "local_python_toolchains",
35+
dev_dependency = True,
36+
runtimes = ["local_python3"],
37+
)
38+
39+
register_toolchains(
40+
"@local_python_toolchains//:all",
41+
dev_dependency = True,
1742
)
18-
use_repo(python, python = "python_versions")
1943

2044
bazel_dep(name = "rules_rust", version = "0.68.1")
2145
archive_override(

MODULE.bazel.lock

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

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,7 @@
482482
pkgs.git-cliff
483483
pkgs.buck2
484484
packages.update-module-hashes
485+
pkgs.python3
485486

486487
# Rust
487488
bazel

local-remote-execution/MODULE.bazel.lock

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

toolchain-examples/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ java = use_extension("//java:extensions.bzl", "toolchains")
1616
use_repo(java, "local_jdk")
1717

1818
# Python
19-
bazel_dep(name = "rules_python", version = "1.2.0")
19+
bazel_dep(name = "rules_python", version = "2.0.0")
2020

2121
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
2222
pip.parse(

toolchain-examples/MODULE.bazel.lock

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

0 commit comments

Comments
 (0)