pyinstaller hook may now rely entirely on the entry points
# Used by pyinstaller to expose hidden imports
-# TODO: can this be loaded from keyring.backend directly?
-_backend_mod_names = 'kwallet', 'OS_X', 'SecretService', 'Windows'
+import entrypoints
-hiddenimports = [
- 'keyring.backends.' + mod_name
- for mod_name in _backend_mod_names
-]
-
-import pkg_resources
-hiddenimports.extend(
+hiddenimports = [
ep.module_name
- for ep in pkg_resources.iter_entry_points('keyring.backends')
-)
+ for ep in entrypoints.get_group_all('keyring_backends')
+]
