[Backport main] Fix: Addon Manager Python dependency update detection in Flatpak#362
Open
github-actions[bot] wants to merge 6 commits intomainfrom
Open
[Backport main] Fix: Addon Manager Python dependency update detection in Flatpak#362github-actions[bot] wants to merge 6 commits intomainfrom
github-actions[bot] wants to merge 6 commits intomainfrom
Conversation
When updating Python dependencies with pip using --target directory, old package version metadata (.dist-info directories) are not always removed. This causes FreeCAD to detect the old version instead of the newly installed version, particularly in Flatpak installations. This fix adds cleanup logic to remove old package version metadata after a successful update, keeping only the newest version of each package. Fixes #26510 (cherry picked from commit 96800d7)
for more information, see https://pre-commit.ci (cherry picked from commit 3ab0ce7)
Added unit tests covering: - Removal of old versions while keeping newest - Single version packages (no removal) - Empty and nonexistent directories - Permission error handling - PEP 503 package name normalization - Non-.dist-info directory filtering - Invalid version format handling Tests use proper mocking to avoid filesystem operations and follow existing test patterns in the codebase. These tests verify the cleanup logic works correctly across various scenarios including edge cases like permission errors and malformed directory names. All tests use mocks to ensure fast, reliable execution without touching the actual filesystem. (cherry picked from commit 7079ecb)
for more information, see https://pre-commit.ci (cherry picked from commit bd1b6ac)
- Use os.path.join() for all path construction to ensure Windows compatibility - Remove logging count assertion as suggested in review - Tests now work across all platforms (Windows, Linux, macOS) (cherry picked from commit b6cf067)
for more information, see https://pre-commit.ci (cherry picked from commit f3cd818)
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.
Description
Backport of #308 to
main.