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

[Bug] plugins are imported twice during discovery #482

Closed
omry opened this issue Mar 8, 2020 · 2 comments · Fixed by #483
Closed

[Bug] plugins are imported twice during discovery #482

omry opened this issue Mar 8, 2020 · 2 comments · Fixed by #483
Labels
bug Something isn't working

Comments

@omry
Copy link
Collaborator

omry commented Mar 8, 2020

The examples plugins have something like the following in their __init__.py file:

# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from .example_searchpath_plugin import ExampleSearchPathPlugin

__all__ = ["ExampleSearchPathPlugin"]

This causes the plugins to be imported twice during plugin discovery, making any slowdown from slow plugin import twice as bad.

This is not necessary and is actually harmful.
This should be fixed in all plugins (official and unofficial).

For official plugins (in the Hydra repository), that __init__.py should be empty:

# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
@omry omry added the bug Something isn't working label Mar 8, 2020
@omry
Copy link
Collaborator Author

omry commented Mar 8, 2020

cc @jrapin

@omry
Copy link
Collaborator Author

omry commented Mar 8, 2020

cc @jan-matthis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant