#2100: Resolve python versions via uv instead of ide-urls#2152
Conversation
d7bbc4b to
9e63620
Compare
|
Good job overall! The approach looks good and resolving Python versions via uv makes sense. The JUnit tests passed successfully. I only left one comment regarding the CPython filtering. Once that is addressed, the PR looks good to me. |
|
Also, please don’t forget to add labels to the PR. The corresponding checklist item is checked, but the PR currently has no labels. You can simply use the same labels as the issue. |
Coverage Report for CI Build 29477803661Warning No base build found for commit Coverage: 72.251%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsRequires a base build to compare against. How to fix this → Coverage Stats💛 - Coveralls |
| */ | ||
| public boolean isCpython() { | ||
|
|
||
| return (this.implementation == null) || "cpython".equalsIgnoreCase(this.implementation); |
There was a problem hiding this comment.
isCpython() currently treats a missing implementation as CPython. This may allow incomplete or unknown entries to be used for Python version resolution. Since the intention is to include only explicitly identified CPython distributions, could we change this to this.
| return (this.implementation == null) || "cpython".equalsIgnoreCase(this.implementation); | |
| return "cpython".equalsIgnoreCase(this.implementation); |
This PR fixes #2100
Implemented changes:
PythonRepository, aToolRepositorythat resolves the list of installable Python versions fromuv python listinstead of fromide-urls.Pythonnow uses this repository via an override ofgetToolRepository().PythonUrlUpdaterand had nodarwin/x64(Intel Mac) branch. Installable versions (e.g. 3.14.6) were therefore reported as "not found" on Intel Mac. Sourcing versions fromuv(the tool that actually installs Python) removes this class of gap, sinceuvonly lists versions it can install for the current OS/architecture. Still entries for Intel Macs(darwin/x64), Windows on arm(win32/arm64), and Linux on arm(linux/arm64).Uv#parsePythonListJson(...)(defensive JSON parsing ofuv python list) and thePythonUvListEntryrecord, with non-CPython entries (e.g. PyPy) are filtered out.getPythonRepository()intoIdeContextandAbstractIdeContextfetchUvPythonList()uses therunToolvariant that ensuresuvis installed before running it.ide-urls, which only need the tool folder andare unaffected by the per-platform gap.
UvRepository.Testing instructions
Automated:
PythonRepositoryTest.javaandPythonTest.java.Manual:
uvavailable, you can confirm thatuv python list --all-versions --only-downloads --output-format json --no-configlists the expected CPython versions for your platform.uvis not yet installed, runide install python 3.14*. Expected:uvis installed first, thenuv python listresolves 3.14.6, then Python 3.14.6 is installed successfully. Make sure you do it in a different new folder.Checklist for this PR
Make sure everything is checked before merging this PR. For further info please also see
our DoD.
mvn clean testlocally all tests pass and build is successful#«issue-id»: «brief summary»(e.g.#921: fixed setup.bat). If no issue ID exists, title only.In Progressand assigned to you or there is no issue (might happen for very small PRs)internal