Skip to content

Commit 8b97dc1

Browse files
committed
format and fix py code
1 parent d3d9f5f commit 8b97dc1

File tree

5 files changed

+24
-31
lines changed

5 files changed

+24
-31
lines changed

python/private/local_runtime_repo.bzl

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -196,21 +196,6 @@ create thousands of files for every `py_test`), at the risk of having to rely on
196196
a system having the necessary Python installed.
197197
""",
198198
attrs = {
199-
"interpreter_target": attr.label(
200-
doc = """
201-
A label to a Python interpreter executable.
202-
203-
*Mutually exclusive with `interpreter_path`.*
204-
205-
On Windows, if the path doesn't exist, various suffixes will be tried to
206-
find a usable path.
207-
208-
:::{seealso}
209-
The {obj}`interpreter_path` attribute for getting the interpreter from
210-
a path or PATH environment lookup.
211-
:::
212-
""",
213-
),
214199
"interpreter_path": attr.string(
215200
doc = """
216201
An absolute path or program name on the `PATH` env var.
@@ -232,6 +217,21 @@ a label
232217
""",
233218
default = "",
234219
),
220+
"interpreter_target": attr.label(
221+
doc = """
222+
A label to a Python interpreter executable.
223+
224+
*Mutually exclusive with `interpreter_path`.*
225+
226+
On Windows, if the path doesn't exist, various suffixes will be tried to
227+
find a usable path.
228+
229+
:::{seealso}
230+
The {obj}`interpreter_path` attribute for getting the interpreter from
231+
a path or PATH environment lookup.
232+
:::
233+
""",
234+
),
235235
"on_failure": attr.string(
236236
default = _OnFailure.SKIP,
237237
values = sorted(_OnFailure.__members__.values()),
@@ -289,7 +289,6 @@ def _find_python_exe_from_target(rctx):
289289
return path, None
290290
attempted_paths.append(path)
291291

292-
resolved_path = None
293292
describe_failure = lambda: (
294293
"Target '{}' could not be resolved to a valid path. " +
295294
"Attempted paths: {paths}".format("\n".join([str(p) for p in attempted_paths]))

tests/integration/local_toolchains/MODULE.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ pbs_archive = use_repo_rule("//:pbs_archive.bzl", "pbs_archive")
4040
pbs_archive(
4141
name = "pbs_runtime",
4242
sha256 = {
43-
"windows": "005cb2abf4cfa4aaa48fb10ce4e33fe4335ea4d1f55202dbe4e20c852e45e0f9",
4443
"linux": "0a01bad99fd4a165a11335c29eb43015dfdb8bd5ba8e305538ebb54f3bf3146d",
4544
"mac osx": "4fb42ffc8aad2a42ca7646715b8926bc6b2e0d31f13d2fec25943dc236a6fd60",
45+
"windows": "005cb2abf4cfa4aaa48fb10ce4e33fe4335ea4d1f55202dbe4e20c852e45e0f9",
4646
},
4747
urls = {
48-
"windows server 2022": "https://github.com/astral-sh/python-build-standalone/releases/download/20250918/cpython-3.13.7+20250918-x86_64-pc-windows-msvc-install_only.tar.gz",
4948
"linux": "https://github.com/astral-sh/python-build-standalone/releases/download/20250918/cpython-3.13.7+20250918-x86_64-unknown-linux-gnu-install_only.tar.gz",
5049
"mac osx": "https://github.com/astral-sh/python-build-standalone/releases/download/20250918/cpython-3.13.7+20250918-x86_64-apple-darwin-install_only.tar.gz",
50+
"windows server 2022": "https://github.com/astral-sh/python-build-standalone/releases/download/20250918/cpython-3.13.7+20250918-x86_64-pc-windows-msvc-install_only.tar.gz",
5151
},
5252
)
5353

tests/integration/local_toolchains/WORKSPACE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ load("//:pbs_archive.bzl", "pbs_archive")
2626
pbs_archive(
2727
name = "pbs_runtime",
2828
sha256 = {
29-
"windows": "005cb2abf4cfa4aaa48fb10ce4e33fe4335ea4d1f55202dbe4e20c852e45e0f9",
3029
"linux": "0a01bad99fd4a165a11335c29eb43015dfdb8bd5ba8e305538ebb54f3bf3146d",
3130
"mac osx": "4fb42ffc8aad2a42ca7646715b8926bc6b2e0d31f13d2fec25943dc236a6fd60",
31+
"windows": "005cb2abf4cfa4aaa48fb10ce4e33fe4335ea4d1f55202dbe4e20c852e45e0f9",
3232
},
3333
urls = {
34-
"windows server 2022": "https://github.com/astral-sh/python-build-standalone/releases/download/20250918/cpython-3.13.7+20250918-x86_64-pc-windows-msvc-install_only.tar.gz",
3534
"linux": "https://github.com/astral-sh/python-build-standalone/releases/download/20250918/cpython-3.13.7+20250918-x86_64-unknown-linux-gnu-install_only.tar.gz",
3635
"mac osx": "https://github.com/astral-sh/python-build-standalone/releases/download/20250918/cpython-3.13.7+20250918-x86_64-apple-darwin-install_only.tar.gz",
36+
"windows server 2022": "https://github.com/astral-sh/python-build-standalone/releases/download/20250918/cpython-3.13.7+20250918-x86_64-pc-windows-msvc-install_only.tar.gz",
3737
},
3838
)
3939

tests/integration/local_toolchains/local_runtime_test.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
import unittest
77

88

9-
import config
10-
11-
print(f"{config.CONFIG=}")
12-
139
class LocalToolchainTest(unittest.TestCase):
1410
maxDiff = None
1511

@@ -32,7 +28,7 @@ def test_python_from_path_used(self):
3228
import sys
3329
print(sys.executable)
3430
print(sys._base_executable)
35-
=
31+
"""
3632
)
3733
f.flush()
3834
output_lines = (

tests/integration/local_toolchains/pbs_archive.bzl

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
"""A repository rule to download and extract a Python runtime archive."""
22

3-
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
4-
53
BUILD_BAZEL = """
64
# Generated by pbs_archive.bzl
75
@@ -38,17 +36,17 @@ def _pbs_archive_impl(repository_ctx):
3836
pbs_archive = repository_rule(
3937
implementation = _pbs_archive_impl,
4038
attrs = {
41-
"urls": attr.string_dict(
42-
doc = "A dictionary of URLs to the runtime archives, keyed by OS name (e.g., 'linux', 'windows').",
43-
mandatory = True,
44-
),
4539
"sha256": attr.string_dict(
4640
doc = "A dictionary of SHA256 checksums for the archives, keyed by OS name.",
4741
mandatory = True,
4842
),
4943
"strip_prefix": attr.string(
5044
doc = "The prefix to strip from the archive.",
5145
),
46+
"urls": attr.string_dict(
47+
doc = "A dictionary of URLs to the runtime archives, keyed by OS name (e.g., 'linux', 'windows').",
48+
mandatory = True,
49+
),
5250
},
5351
doc = """
5452
Downloads and extracts a Python runtime archive for the current OS.

0 commit comments

Comments
 (0)