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

Switch internal resource loading to importlib-resources #719

Closed
omry opened this issue Jun 26, 2020 · 0 comments · Fixed by #681
Closed

Switch internal resource loading to importlib-resources #719

omry opened this issue Jun 26, 2020 · 0 comments · Fixed by #681
Milestone

Comments

@omry
Copy link
Collaborator

omry commented Jun 26, 2020

importlb-resources is the next gen Python resource loader and will become the standard one in Python 3.9 (importlib.resources).
It has several advantages over pkg_resources, such as better performance and more consistent and well designed API.

pkg_resources has some side effects related to pytest plugins that are also a reason to avoid it.

Hydra 1.0 is switching to importlib-resources based ConfigSource for loading resources from packages, and the current pkg_resources implementation will be replaced.
for simplicity there will be no phase when both approaches are supported at the same time.
For the most part, this should be transparent to users.

Hydra will be more strict about requiring an __init__.py in config modules moving forward when the included config is loaded from the module and not the file system and in general it is now recommended to always include an __init__.py file at the top config modules or directories.

NOTE:
People using Hydra from the master will have to reinstall hydra-core to run the tests and may have to uninstall hydra-pytest-plugin (if they have it installed).

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

Successfully merging a pull request may close this issue.

1 participant