-
Notifications
You must be signed in to change notification settings - Fork 209
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
[FEA] Smart dependency manager to replace lazy imports #468
Comments
Better code reuse here seems good, and enables memoization etc tricks Also, I think somewhere in the code I realized a useful trick was, when just a check is needed, instead of trying via an |
is it cheating to use another library to help? import importlib.util, sys
def check_umap():
umap_spec = importlib.util.find_spec("umap")
has_umap = umap_spec is not None
if has_umap and "umap" not in sys.modules:
import umap
return umap, has_umap
else:
return None, has_umap i see the way we do it now is better for >3.6, but since we want to check and not import every time perhaps if > try? |
Hmm, these calls do different things;
So yeah, maybe:
|
Motivations:
This is how we are managing dependencies now
After dependency manager it will look like
Aim
working example
The text was updated successfully, but these errors were encountered: