Skip to content

Commit

Permalink
Fix incorrect regex for PEX_PYTHON precision warning (#2622)
Browse files Browse the repository at this point in the history
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 <snip>.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 ...
```
  • Loading branch information
tgolsson authored Dec 12, 2024
1 parent c5d8d9b commit 74f34aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pex/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 74f34aa

Please sign in to comment.