-
-
Notifications
You must be signed in to change notification settings - Fork 630
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
Remove usages of legacy importlib API. #2531
Conversation
09cfab0
to
b462e93
Compare
Remaining failures look sufficiently irrelevant to call background noise. |
@Jasha10 ? |
Thanks for the ping @bwoodsend! We should be able to merge this shortly. |
Any concerns about compatibility with supported legacy Python versions? |
No, because current hydra doesn't support Python 3.5. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again @bwoodsend.
One relatively minor nit / question:
This code is running on 3.6 to 3.9, wasn't it? if sys.version_info < (3, 10):
m = importer.find_module(modname) # type: ignore |
Yes. I introduced that |
Gotcha. I did seem unfamiliar :) |
b462e93
to
0f7031b
Compare
The Python >= 3.10 compatible usages of importlib added in 277ff54 can be safely applied to any version of Python >= 3.5 which covers the full range that Hydra supports. Getting rid of the old decrecated API, asides from cleaning up, will keep Hydra compatible with PyInstaller if PyInstaller doesn't get cold feet and revert its dropping of support for the legacy API (pyinstaller/pyinstaller#7344).
Motivation
The Python >= 3.10 compatible usages of importlib added in 277ff54 can be safely applied to any version of Python >= 3.5 which covers the full range that Hydra supports.
Getting rid of the old deprecated API, asides from cleaning up, will keep Hydra compatible with PyInstaller if PyInstaller doesn't get cold feet and revert its dropping of support for the legacy API (pyinstaller/pyinstaller#7344).
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
(How should this PR be tested? Do you require special setup to run the test or repro the fixed bug?)
Standard CI/CD testing should be sufficient.
Related Issues and PRs
(Is this PR part of a group of changes? Link the other relevant PRs and Issues here. Use https://help.github.com/en/articles/closing-issues-using-keywords for help on GitHub syntax)
None.