From 74f34aa30778ae3c0c9f837cbe1e80bda2fb0f3c Mon Sep 17 00:00:00 2001 From: Tom Solberg Date: Thu, 12 Dec 2024 17:35:43 +0100 Subject: [PATCH] Fix incorrect regex for PEX_PYTHON precision warning (#2622) Looks like this + is misplaced, as it means `PEX_PYTHON=3.+` would be accepted but it rejects and warns for `PEX_PYTHON=python3.11`. Leads to this funky warning message telling us to use the setting we already have :) ``` PEXWarning: Using a venv selected by PEX_PYTHON=python3.11 for .pex at ... To avoid this warning, either specify a Python binary with major and minor version in its name, like PEX_PYTHON=python3.11 or ... ``` --- pex/variables.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pex/variables.py b/pex/variables.py index aca8aec62..e14b7351a 100644 --- a/pex/variables.py +++ b/pex/variables.py @@ -905,7 +905,7 @@ def warn(message): if ( ENV.PEX_PYTHON and not precise_pex_python - and not re.match(r".*[^\d][\d]+\.[\d+]$", ENV.PEX_PYTHON) + and not re.match(r".*[^\d][\d]+\.[\d]+$", ENV.PEX_PYTHON) ): warn( dedent(