Skip to content

Commit 5c3b71c

Browse files
authored
feat(toolchains): default py_runtime.implementation_name to cpython (#2272)
This defaults `py_runtime.implementation_name` to `cpython`, the value that is most likely to be used. This is done not only because it's the most likely value, but because of how it affects whether precompiling works. Within py_runtime, automatically computing `pyc_tag` requires both `implementation_name` and Python version information. With upcoming changes to make `--python_version` always set to the correct value, it'll make enabling precompiling easier, especially if there are custom toolchains defined.
1 parent 9c3d303 commit 5c3b71c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ A brief description of the categories of changes:
2525
[x.x.x]: https://github.com/bazelbuild/rules_python/releases/tag/x.x.x
2626

2727
### Changed
28-
* Nothing yet
28+
* (toolchains) `py_runtime.implementation_name` now defaults to `cpython`
29+
(previously it defaulted to None).
2930

3031
### Fixed
3132
* (bzlmod) correctly wire the {attr}`pip.parse.extra_pip_args` all the

python/private/common/py_runtime_rule.bzl

+1
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ runtime. For a platform runtime this attribute must not be set.
226226
),
227227
"implementation_name": attr.string(
228228
doc = "The Python implementation name (`sys.implementation.name`)",
229+
default = "cpython",
229230
),
230231
"interpreter": attr.label(
231232
# We set `allow_files = True` to allow specifying executable

0 commit comments

Comments
 (0)