fix: enforce strict python baseline < 3.13#24
Open
matthewmcneill wants to merge 2 commits intoplatformio:masterfrom
Open
fix: enforce strict python baseline < 3.13#24matthewmcneill wants to merge 2 commits intoplatformio:masterfrom
matthewmcneill wants to merge 2 commits intoplatformio:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR: Enforces strict Python version compatibility (< 3.13) to prevent environmental crashes.
Rationale
With the release of Python 3.13+, several core modules have been significantly altered or deprecated, causing immediate and often silent installation failures on developer machines that sit on the "bleeding edge" (like Arch Linux, instances heavily reliant on Homebrew, or IDEs like Google Antigravity).
When PlatformIO's node-helpers execute
get-python.jsto look for a compatible Python binary alongside which to deploy the local PlatformIO Core virtual environment, it historically just checked for Python 3.6+. Because Python 3.13 introduces breaking changes to thevenvand packaging ecosystem, we must artificially cap the version ceiling to ensure stability.This PR enforces a strict upper-bound on the Python resolution algorithm, keeping developers on a stable, supported Python baseline.
Changes Included
src/installer/get-python.js):Added boundary enforcement inside
findPythonExecutable(). A fast subprocess is executed to verify thatsys.version_info < (3, 13)before approving a candidate executable.If a bleeding-edge version (e.g., Python 3.13 or 3.14) is detected during path traversal, the installer cleanly rejects it via console warning, continues the loop, and forces a fallback to a safer system Python binary (like
python3.12orpython3.11).Ensured that if the version detection subprocess fails to parse the sys version array, it fails gracefully and bypasses the incompatible binary instead of throwing a fatal Node crash.
Related Changes
FR: Official Support for Google Antigravity IDE #4417
platform-io-ide #4463 feat: decouple intellisense extension dependency