From d43f9227adce6cc85f40f80131fb4daafd281784 Mon Sep 17 00:00:00 2001 From: konstin Date: Wed, 3 Dec 2025 17:37:24 +0100 Subject: [PATCH] Fix Pyston tags This was discovered by https://github.com/astral-sh/uv/pull/16074 I'm not sure what the exact schema of the cache tag is, but since the project is dead, I don't expect any new non-matching versions to follow. --- crates/uv-python/python/get_interpreter_info.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/uv-python/python/get_interpreter_info.py b/crates/uv-python/python/get_interpreter_info.py index ca83e8d8dcd50..53da37ba7039d 100644 --- a/crates/uv-python/python/get_interpreter_info.py +++ b/crates/uv-python/python/get_interpreter_info.py @@ -46,6 +46,16 @@ def format_full_version(info): r"\1.\2", sys.implementation.cache_tag, ) + elif implementation_name == "pyston": + # Pyston reports the CPython version as sys.implementation.version, + # so we need to discover the Pyston version from the cache_tag + import re + + implementation_version = re.sub( + r"pyston-(\d)(\d+)", + r"\1.\2", + sys.implementation.cache_tag, + ) else: implementation_version = format_full_version(sys.implementation.version) else: