Skip to content

Conversation

Jason2866
Copy link
Owner

@Jason2866 Jason2866 commented Sep 6, 2025

Summary by CodeRabbit

  • New Features

    • Streamlined Python setup with automatic discovery and installation via UV.
    • Improved Python version compatibility checks and executable detection.
  • Refactor

    • Reworked the Python installer for a simpler, more reliable flow.
  • Chores

    • Updated package version to 12.0.0.
    • Increased minimum Node.js requirement to 20+.
  • Misc

    • Updated error reporting links to the new pioarduino organization repositories.

Jason2866 and others added 30 commits August 28, 2025 12:21
Refactor Python installation logic to support zstandard extraction and improve error handling.
Refactor Python installer to optimize performance and caching
to avoid possible blocking
Refactored Python version compatibility checks to use a centralized function for better maintainability and clarity.
Copy link

coderabbitai bot commented Sep 6, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

  • package.json: version bumped to 12.0.0; Node engine requirement raised to >=20.
  • src/installer/get-python.js: replaced registry-based flow with UV-based Python install/discovery; added helpers; changed installPortablePython signature; added exports.
  • src/misc.js: updated GitHub error report base URL.

Changes

Cohort / File(s) Summary
Release & engines
package.json
Bump version 11.4.1 → 12.0.0; update engines.node from ">=16" → ">=20".
Python installer refactor (UV-based)
src/installer/get-python.js
Replace registry/tarball logic with UV-based discovery/install; add isPythonVersionCompatible, isUVAvailable, installUV, getPythonExecutablePath; new validation helpers; findPythonExecutable reworked; installPortablePython signature changed to installPortablePython(destinationDir).
Misc URL update
src/misc.js
Change error report URL host from platformio/... to pioarduino/...; logic otherwise unchanged.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor App as Caller
  participant GP as get-python.js
  participant PATH as System PATH
  participant UV as UV Installer
  participant Sh as OS Shell
  participant Py as Python

  rect rgb(236,248,255)
    note over GP: Discovery phase (changed)
    App->>GP: findPythonExecutable()
    GP->>PATH: Iterate candidates (python, python3, etc.)
    PATH-->>GP: Candidate paths
    GP->>Sh: Invoke candidate --version
    Sh-->>GP: Version output
    alt Compatible (3.10–3.13)
      GP-->>App: Return existing Python path
    else Not found
      note over GP,UV: Installation phase via UV (new)
      GP->>UV: isUVAvailable()
      alt UV missing
        GP->>Sh: installUV (PowerShell or curl)
        Sh-->>GP: UV installed
      end
      GP->>UV: Install Python 3.13.x into destination
      UV-->>GP: Installation result
      GP->>GP: ensurePythonExeExists()
      GP->>Sh: Verify python --version
      Sh-->>GP: 3.13.x confirmed
      GP-->>App: Return installed Python path
    end
  end

  note over App,GP: Errors collected and surfaced (incl. distutils-related)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

I thump my paws—version twelve is here,
With UV’s glow, Python hops in clear. 🐇✨
Old tarball trails fade into dawn,
A fresher PATH to code upon.
Node’s grown tall—twenty’s the sky,
Bugs file new burrows—off they fly!


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cc1a8e8 and 6deebb7.

⛔ Files ignored due to path filters (2)
  • dist/index.js is excluded by !**/dist/**
  • dist/index.js.map is excluded by !**/dist/**, !**/*.map
📒 Files selected for processing (3)
  • package.json (1 hunks)
  • src/installer/get-python.js (1 hunks)
  • src/misc.js (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch uv_install_python

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Jason2866 Jason2866 merged commit aa06861 into pioarduino Sep 6, 2025
2 of 3 checks passed
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