Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unload handler for a dependency's loader.py code #1069

Closed
FichteFoll opened this issue Jan 22, 2016 · 1 comment
Closed

Unload handler for a dependency's loader.py code #1069

FichteFoll opened this issue Jan 22, 2016 · 1 comment

Comments

@FichteFoll
Copy link
Collaborator

At this moment, dependencies that get uninstalled or updated especially will not be removed from sys.modules. To guarantee the proper latest version of a depency to be available form import in case of a package and dependency update, the module would have to be re-imported and the easiest way to do that would be to remove it from sys.modules (and all its submodules).

During that process, the (default) loader.py code could also undo its loading steps, such as adding the dependency to sys.path, and thus doing better at cleaning up.

I propose following a similar style to how ST unloads plugins: with a module attribute (global function).

Potential issues:

  • Packages with the same name as the module, since the package path is on sys.path as well, but that is a problem when installing the dependency too.
@FichteFoll
Copy link
Collaborator Author

Since loader.py has inofficially been deprecated, will be removed in a future release, and dependency installation will be reworked in general, I believe this issue to be redundant. While still valid, surprisingly this didn't seem to have impacted anyone as far as I could tell, so it's most likely not worth fixing even for older versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants