Skip to content

Commit c71629f

Browse files
committed
rename to :python and incorporate readme feedback
1 parent 91d66df commit c71629f

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

docs/toolchains.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -468,34 +468,34 @@ Currently the following flags are used to influence toolchain selection:
468468
* {obj}`--@rules_python//python/config_settings:py_freethreaded` for selecting
469469
the freethreaded experimental Python builds available from `3.13.0` onwards.
470470

471-
## Accessing the underlying interpreter
471+
## Running the underlying interpreter
472472

473-
To access the interpreter that bazel manages, you can use the
474-
`@rules_python//python/bin:interpreter` target. This is a binary target with
473+
To run the interpreter that Bazel will use, you can use the
474+
`@rules_python//python/bin:python` target. This is a binary target with
475475
the executable pointing at the `python3` binary plus the relevent runfiles.
476476

477477
```
478-
$ bazel run @rules_python//python/bin:interpreter
478+
$ bazel run @rules_python//python/bin:python
479479
Python 3.11.1 (main, Jan 16 2023, 22:41:20) [Clang 15.0.7 ] on linux
480480
Type "help", "copyright", "credits" or "license" for more information.
481481
>>>
482-
$ bazel run @rules_python//python/bin:interpreter --@rules_python//python/config_settings:python_version=3.12
482+
$ bazel run @rules_python//python/bin:python --@rules_python//python/config_settings:python_version=3.12
483483
Python 3.12.0 (main, Oct 3 2023, 01:27:23) [Clang 17.0.1 ] on linux
484484
Type "help", "copyright", "credits" or "license" for more information.
485485
>>>
486486
```
487487

488488
You can also access a specific binary's interpreter this way by using the
489-
`@rules_python//python/bin:interpreter_src` target.
489+
`@rules_python//python/bin:python_src` target.
490490

491491
```
492-
$ bazel run @rules_python//python/bin:interpreter --@rules_python//python/bin:interpreter_src=//path/to:bin
492+
$ bazel run @rules_python//python/bin:python --@rules_python//python/bin:interpreter_src=//path/to:bin
493493
Python 3.11.1 (main, Jan 16 2023, 22:41:20) [Clang 15.0.7 ] on linux
494494
Type "help", "copyright", "credits" or "license" for more information.
495495
>>>
496496
```
497497

498498
:::{note}
499-
The interpreter target does not provide access to any modules from `py_*`
499+
The `python` target does not provide access to any modules from `py_*`
500500
targets on its own. Work is ongoing to support that.
501501
:::

python/bin/BUILD.bazel

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ filegroup(
1010
)
1111

1212
interpreter(
13-
name = "interpreter",
14-
binary = ":interpreter_src",
13+
name = "python",
14+
binary = ":python_src",
1515
)
1616

1717
# The user can modify this flag to source different interpreters for the
18-
# `interpreter` target above.
18+
# `python` target above.
1919
label_flag(
20-
name = "interpreter_src",
20+
name = "python_src",
2121
build_setting_default = "//python:none",
2222
)

tests/integration/interpreter_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def _run_version_test(self, expected_version):
2424
result = self.run_bazel(
2525
"run",
2626
f"--@rules_python//python/config_settings:python_version={expected_version}",
27-
"@rules_python//python/bin:interpreter",
27+
"@rules_python//python/bin:python",
2828
input = "\r".join([
2929
"import sys",
3030
"v = sys.version_info",
@@ -48,7 +48,7 @@ def _run_module_test(self, version):
4848
result = self.run_bazel(
4949
"run",
5050
f"--@rules_python//python/config_settings:python_version={version}",
51-
"@rules_python//python/bin:interpreter",
51+
"@rules_python//python/bin:python",
5252
"--",
5353
"-m",
5454
"json.tool",

0 commit comments

Comments
 (0)