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

[Feature Request] #3015

Open
jgbos opened this issue Jan 29, 2025 · 0 comments
Open

[Feature Request] #3015

jgbos opened this issue Jan 29, 2025 · 0 comments
Labels
enhancement Enhanvement request

Comments

@jgbos
Copy link
Contributor

jgbos commented Jan 29, 2025

🚀 Feature Request

Allow configurable plugins without use of hydra_plugin package. This is especially useful for hydra-zen users.

Motivation

I do not want to create launchers that must be installed as a package, I just want to configure my own function in my repo.

Pitch

Remove the hard runtime error here https://github.com/facebookresearch/hydra/blob/main/hydra/core/plugins.py#L102.

Suggested fix:

if not self.is_in_toplevel_plugins_module(classname):
    # All plugins must be defined inside the approved top level modules.
    # For plugins outside of hydra-core, the approved module is hydra_plugins.
    raise RuntimeError(f"Invalid plugin '{classname}': not the hydra_plugins package")

if classname not in self.class_name_to_class.keys():
    raise RuntimeError(f"Unknown plugin class : '{classname}'")
clazz = self.class_name_to_class[classname]
plugin = instantiate(config=config, _target_=clazz)

to

if self.is_in_toplevel_plugins_module(classname):
      if classname not in self.class_name_to_class.keys():
          raise RuntimeError(f"Unknown plugin class : '{classname}'")
      clazz = self.class_name_to_class[classname]
      plugin = instantiate(config=config, _target_=clazz)
else:
      plugin = instantiate(config=config)
@jgbos jgbos added the enhancement Enhanvement request label Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhanvement request
Projects
None yet
Development

No branches or pull requests

1 participant