-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hooks: hydra: add work-around for python < 3.10 and PyInstaller >= 5.8
Under python < 3.10, `hydra`'s plugin manager continues to use deprecated PEP-302 functionality that was removed from PyInstaller's `PyiFrozenImporter` in PyInstaller 5.8 (pyinstaller/pyinstaller#7344.). At run-time, this results in `AttributeError: 'PyiFrozenImporter' object has no attribute 'find_module'`. As a work-around, check python version and PyInstaller version, and if using python < 3.10 and PyInstaller >= 5.8, set module collection mode for `hydra._internal.core_plugins` and `hydra_plugins` packages to `py` to collect their modules as source .py files only. This way, they end up handled by python's built-in finder/importer, instead of PyInstaller's `PyiFrozenImporter`.
- Loading branch information
Showing
3 changed files
with
26 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Update ``hydra`` hook to include work-around for ``hydra``'s plugin | ||
manager, which under python < 3.10 (still) uses deprecated PEP-302 | ||
that was removed from PyInstaller's ``PyiFrozenImporter`` in | ||
PyInstaller 5.8. When building using python < 3.10 and PyInstaller >= 5.8, | ||
the modules collected from ``hydra._internal.core_plugins`` and | ||
``hydra_plugins`` packages are now collected as source .py files only; | ||
this way, they are handled by built-in python's finder/importer instead | ||
of PyInstaller's ``PyiFrozenImporter``. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters