Fix dependency installation cleanup#90
Open
Nightriff wants to merge 4 commits into
Open
Conversation
…rs with files in them. This should make the cleanup process more reliable for failed installations.
…-blender-plugin into fix/dependency-installation-cleanup
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.
If dependency installation fails, the add-on attempts to clean up any partially installed dependencies folder. The add-on uses presence of this folder at startup to know if dependencies are already installed or not, so it's important this folder gets cleaned up for erroneous installations.
However, it currently uses rmdir, which only works for empty directories. This PR switches to shutil.rmtree, which works to delete folders with files in them too. This should make the cleanup process more reliable during failed installations.
Additionally, if it does somehow get into a bad state, this PR also adds a "Reinstall dependencies" button to the addon preferences for troubleshooting purposes. This button in addon preferences is always available to click, whereas previously users could only see the installation button if the add-on detected there was no public dependencies folder.
Fixes #42 and hopefully fixes #75 (at the very least, it adds a button to allow anyone to reinstall the dependencies if there is a problem, which indirectly fixes it)