Skip to content

fix: enforce strict python baseline < 3.13#24

Open
matthewmcneill wants to merge 2 commits intoplatformio:masterfrom
matthewmcneill:fix/strict-python-bounds
Open

fix: enforce strict python baseline < 3.13#24
matthewmcneill wants to merge 2 commits intoplatformio:masterfrom
matthewmcneill:fix/strict-python-bounds

Conversation

@matthewmcneill
Copy link
Copy Markdown

@matthewmcneill matthewmcneill commented Apr 26, 2026

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.js to 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 the venv and 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

  • Python Version Verification (src/installer/get-python.js):
    Added boundary enforcement inside findPythonExecutable(). A fast subprocess is executed to verify that sys.version_info < (3, 13) before approving a candidate executable.
  • Auto-Fallback Pathing:
    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.12 or python3.11).
  • Exception Safety:
    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant