Skip to content

Commit

Permalink
feat(toolchains): default py_runtime.implementation_name to cpython (b…
Browse files Browse the repository at this point in the history
…azelbuild#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.
  • Loading branch information
rickeylev authored Oct 7, 2024
1 parent 9c3d303 commit 5c3b71c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ A brief description of the categories of changes:
[x.x.x]: https://github.com/bazelbuild/rules_python/releases/tag/x.x.x

### Changed
* Nothing yet
* (toolchains) `py_runtime.implementation_name` now defaults to `cpython`
(previously it defaulted to None).

### Fixed
* (bzlmod) correctly wire the {attr}`pip.parse.extra_pip_args` all the
Expand Down
1 change: 1 addition & 0 deletions python/private/common/py_runtime_rule.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ runtime. For a platform runtime this attribute must not be set.
),
"implementation_name": attr.string(
doc = "The Python implementation name (`sys.implementation.name`)",
default = "cpython",
),
"interpreter": attr.label(
# We set `allow_files = True` to allow specifying executable
Expand Down

0 comments on commit 5c3b71c

Please sign in to comment.