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 63c9d7e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions 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 63c9d7e

Please sign in to comment.