You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following changes are required from plugins to be compliant with Hydra 1.0:
Hydra 0.11 used pkg_resource style packages for plugins, because they are backward compatible with Python 2.7.
Now that Hydra no longer supports Python 2.7, we can move to native namespace packages.
Doing it is quiet simple, but it's important that all plugins are going doing it, otherwise they might interfere with other plugins.
Remove hydra_plugins/__init__.py:
Previously, plugins had an hydra_plugins/__init__.py file that looked like:
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved # type: ignore __path__=__import__("pkgutil").extend_path(__path__, __name__)
Remove it.
Update your setup.py to properly package your plugin
Without hydra_plugins/__init__.py, setuptools find_packages() will fail to pick up your plugin package, change it to (and of course the import of find_packages to find_namespace_packages too)
For users still wanting to use find_packages for their regular packages, the change would involve concatenating the results from both find_packages and find_namespace_packages.
Python 3 namespace packages
The following changes are required from plugins to be compliant with Hydra 1.0:
Hydra 0.11 used
pkg_resource
style packages for plugins, because they are backward compatible with Python 2.7.Now that Hydra no longer supports Python 2.7, we can move to native namespace packages.
Doing it is quiet simple, but it's important that all plugins are going doing it, otherwise they might interfere with other plugins.
Remove
hydra_plugins/__init__.py
:Previously, plugins had an
hydra_plugins/__init__.py
file that looked like:Remove it.
Update your setup.py to properly package your plugin
Previously setup.py has something like:
Without
hydra_plugins/__init__.py
, setuptoolsfind_packages()
will fail to pick up your plugin package, change it to (and of course the import offind_packages
tofind_namespace_packages
too)If you have any other packages you are including with, you can combine find_namespace_packages() with find_package():
The text was updated successfully, but these errors were encountered: