#2190: IDEasy destroys my python installation - #2384
Open
Paras14 wants to merge 4 commits into
Open
Conversation
Collaborator
Coverage Report for CI Build 33180020976Coverage decreased (-0.03%) to 73.587%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions54 previously-covered lines in 3 files lost coverage.
Coverage Stats💛 - Coveralls |
Hiepiscus
self-requested a review
August 27, 2026 11:55
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.
This PR fixes #2190
Implemented changes:
LocalToolCommandletnow really writes the.ide.software.versionfile when it is missing. The branch added in #2190: IDEasy destroys python installation #2212 logged "restoring it" but never calledwriteVersionFile, so the file stayed missing and every following command showed the warning again and asked for a CVE version selection.detectInstalledVersion(installationPath, resolvedVersion). The default returns the requested version.Pythonoverrides it and determines the version that is really installed, first frompyvenv.cfg(only if it contains a patch version, becauseuvwrites just3.13for its own interpreters) and otherwise by callingpython --version. This prevents writing a version file that claims a version the virtual environment does not have, which can happen becauseuv syncmay recreate the venv with a different python version.createToolInstallation.PythonTestthat fails without these changes. The mocked python binary in theuvtest project now answers--version.Testing instructions
mvn clean testin theclimodule. The new testPythonTest.testInstallRestoresMissingVersionFileAndPreservesPackagescovers this fix. It installs python, adds a file tosite-packages, deletes.ide.software.versionand installs again. It asserts that the version file is restored with the correct version, that the installed packages are preserved and that no "Deleting corrupted installation" happens.LocalToolCommandlet.javaandPython.javatomainand runPythonTestagain. It fails because the version file is not restored.Note for reviewers: the test pins the OS to
SystemInfoMock.LINUX_X64, because the mocked python payload in theuvtest project has a Unix stylebinfolder that collides with thebintoScriptssymlink created on Windows. Therefore the Windows specific parts ofdetectInstalledVersion(bin path resolution,.exesuffix, parsing the real interpreter output) are not covered by automated tests.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.batand notfeature/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)with
internalpom.xmlfiles or otherwise if runtime dependencies changed, you have updated our LICENSE.asciidoc