Skip to content

Commit

Permalink
fix: make sure resolved python version exists in TOOL_VERSIONS
Browse files Browse the repository at this point in the history
  • Loading branch information
jvolkman committed Jan 18, 2025
1 parent 468099e commit efad703
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [0.7.0]

### Added

- Updates to support Bazel 8.0
- uv translator updates

### Fixed

- Obtain default Python version for Python hub repo from `versions.bzl` file, falling back to `interpreters.bzl` for backwards compatibility. `DEFAULT_PYTHON_VERSION` was [removed](https://github.com/bazelbuild/rules_python/blob/6a04d3832e82fec0a7b0675e9964b360bc358554/CHANGELOG.md?plain=1#L211) from `interpreters.bzl` in rules_python version 1.0.0.
Expand Down
3 changes: 2 additions & 1 deletion pycross/private/interpreter_version.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

load("@bazel_skylib//rules:common_settings.bzl", "BuildSettingInfo")
load("@pythons_hub//:versions.bzl", "MINOR_MAPPING")
load("@rules_python//python:versions.bzl", "TOOL_VERSIONS")

def _rules_python_interpreter_version_impl(ctx):
value = _flag_value(ctx.attr._python_version_flag)
value = MINOR_MAPPING.get(value, value)

if not value:
if value not in TOOL_VERSIONS:
value = ctx.attr.default_version

return [config_common.FeatureFlagInfo(value = value)]
Expand Down

0 comments on commit efad703

Please sign in to comment.