Skip to content

Commit 155489f

Browse files
committed
incorporate feedback
1 parent cadfc9a commit 155489f

File tree

5 files changed

+10
-29
lines changed

5 files changed

+10
-29
lines changed

docs/toolchains.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ Currently the following flags are used to influence toolchain selection:
562562

563563
To run the interpreter that Bazel will use, you can use the
564564
`@rules_python//python/bin:python` target. This is a binary target with
565-
the executable pointing at the `python3` binary plus the relevent runfiles.
565+
the executable pointing at the `python3` binary plus its relevent runfiles.
566566

567567
```console
568568
$ bazel run @rules_python//python/bin:python
@@ -596,5 +596,5 @@ a fixed version.
596596

597597
:::{note}
598598
The `python` target does not provide access to any modules from `py_*`
599-
targets on its own. Work is ongoing to support that.
599+
targets on its own. Please file a feature request if this is desired.
600600
:::

python/bin/BUILD.bazel

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
load(":interpreter.bzl", "interpreter")
2-
3-
package(default_visibility = ["//visibility:public"])
1+
load("//python/private:interpreter.bzl", _interpreter_binary="interpreter_binary")
42

53
filegroup(
64
name = "distribution",
75
srcs = glob(["**"]),
8-
visibility = ["//python:__pkg__"],
6+
visibility = ["//:__subpackages__"],
97
)
108

11-
interpreter(
9+
_interpreter_binary(
1210
name = "python",
1311
binary = ":python_src",
12+
visibility = ["//visibility:public"],
1413
)
1514

1615
# The user can modify this flag to source different interpreters for the

python/bin/interpreter.bzl

Lines changed: 0 additions & 19 deletions
This file was deleted.

python/private/interpreter.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ load("//python:py_runtime_info.bzl", "PyRuntimeInfo")
1919
load(":sentinel.bzl", "SentinelInfo")
2020
load(":toolchain_types.bzl", "TARGET_TOOLCHAIN_TYPE")
2121

22-
def _interpreter_impl(ctx):
22+
def _interpreter_binary_impl(ctx):
2323
if SentinelInfo in ctx.attr.binary:
2424
toolchain = ctx.toolchains[TARGET_TOOLCHAIN_TYPE]
2525
runtime = toolchain.py3_runtime
@@ -52,8 +52,8 @@ def _interpreter_impl(ctx):
5252
),
5353
]
5454

55-
interpreter = rule(
56-
implementation = _interpreter_impl,
55+
interpreter_binary = rule(
56+
implementation = _interpreter_binary_impl,
5757
toolchains = [TARGET_TOOLCHAIN_TYPE],
5858
executable = True,
5959
attrs = {

tests/interpreter/interpreter_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
class InterpreterTest(unittest.TestCase):
2222
def setUp(self):
23+
super().setUp()
2324
self.interpreter = os.environ["PYTHON_BIN"]
2425

2526
def test_self_version(self):

0 commit comments

Comments
 (0)